aboutsummaryrefslogtreecommitdiffstats
path: root/1-setup-path-win.bat
diff options
context:
space:
mode:
authorGravatar Roman Zolotarev <hi@romanzolotarev.com>2016-04-26 16:23:10 +0800
committerGravatar Roman Zolotarev <hi@romanzolotarev.com>2016-04-26 16:23:10 +0800
commit28f0b64e31b8c30a842dfd356421356cf0513177 (patch)
treee5a76f4a2fb747c3599de1e297f46e4dc6fd4f0e /1-setup-path-win.bat
parentfa2eedb7bd906634b8c500ba0d91638e63eaafed (diff)
parentbf56838fe99aafd37559d560e47b707a83c87588 (diff)
downloadqmk_firmware-28f0b64e31b8c30a842dfd356421356cf0513177.tar.gz
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to '1-setup-path-win.bat')
-rw-r--r--1-setup-path-win.bat10
1 files changed, 8 insertions, 2 deletions
diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat
index 2c15857bb..f612d0f4a 100644
--- a/1-setup-path-win.bat
+++ b/1-setup-path-win.bat
@@ -5,8 +5,14 @@ SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe
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)
+:: 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)
:: Add paths