From 1bc05ac85fd6b7bc5fce8d99a43a5d2202b314fe Mon Sep 17 00:00:00 2001 From: NoahAndrews Date: Mon, 11 Apr 2016 14:09:42 -0400 Subject: [PATCH 1/3] Remove failing check NEWPATH1 (C:\MinGW\msys\bin) won't actually be created until the second script is run --- 1-setup-path-win.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat index 2c15857b..c42f3444 100644 --- a/1-setup-path-win.bat +++ b/1-setup-path-win.bat @@ -6,7 +6,6 @@ SET NEWPATH1="C:\MinGW\msys\1.0\bin" SET NEWPATH2="C:\MinGW\bin" :: Make sure paths exist -IF NOT EXIST !NEWPATH1! (ECHO Path not found: %NEWPATH1% && GOTO ExitBatch) IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch) :: Add paths From 5b86028d148f7e8b5573e4426cc67c26df82a1d4 Mon Sep 17 00:00:00 2001 From: NoahAndrews Date: Mon, 11 Apr 2016 14:14:15 -0400 Subject: [PATCH 2/3] Updated comment --- 1-setup-path-win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat index c42f3444..6965f5bb 100644 --- a/1-setup-path-win.bat +++ b/1-setup-path-win.bat @@ -5,7 +5,7 @@ SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe SET NEWPATH1="C:\MinGW\msys\1.0\bin" SET NEWPATH2="C:\MinGW\bin" -:: Make sure paths exist +:: Make sure the second path exists. The first path won't be created until the second script is run IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch) :: Add paths From b437de8874244711280f984c1db463937750072d Mon Sep 17 00:00:00 2001 From: NoahAndrews Date: Mon, 11 Apr 2016 14:30:15 -0400 Subject: [PATCH 3/3] Added admin privilege check Running this as a non-administrator appears to work at first, but the changes wouldn't stick on my Win 8.1 system. It's weird, but this script needs to run as admin. --- 1-setup-path-win.bat | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat index 6965f5bb..f612d0f4 100644 --- a/1-setup-path-win.bat +++ b/1-setup-path-win.bat @@ -5,6 +5,13 @@ SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe SET NEWPATH1="C:\MinGW\msys\1.0\bin" SET NEWPATH2="C:\MinGW\bin" +:: Make sure we're running with administrator privileges +NET SESSION >nul 2>&1 +IF ERRORLEVEL 1 ( + ECHO FAILED. Run this script with administrator privileges. + GOTO ExitBatch +) + :: Make sure the second path exists. The first path won't be created until the second script is run IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch)