summaryrefslogtreecommitdiffstats
path: root/util/add-paths.bat
diff options
context:
space:
mode:
authorDidier Loiseau <didierloiseau+git@gmail.com>2016-09-11 01:26:47 +0200
committerDidier Loiseau <didierloiseau+git@gmail.com>2016-09-11 01:26:47 +0200
commitb9014c757599ca288be07629ad1d00ef66c033f1 (patch)
treeba056e704e76327c597e25d1be200c4c991efeb8 /util/add-paths.bat
parent60a826923d5a6b0dbe416b0837608149ab82e470 (diff)
parent5010df3d8b68a53c382b853c7c2e45922975b631 (diff)
Merge remote-tracking branch 'remotes/jackhumbert/master' into bépo
Diffstat (limited to 'util/add-paths.bat')
-rw-r--r--util/add-paths.bat30
1 files changed, 30 insertions, 0 deletions
diff --git a/util/add-paths.bat b/util/add-paths.bat
new file mode 100644
index 0000000000..ab3d91da17
--- /dev/null
+++ b/util/add-paths.bat
@@ -0,0 +1,30 @@
+@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
+@ECHO off
+
+SET NEWPATH1="C:\MinGW\msys\1.0\bin"
+SET NEWPATH2="C:\MinGW\bin"
+
+CD %~dp0
+
+ECHO. > add-paths.log
+
+CALL :AddPath %NEWPATH1%
+CALL :AddPath %NEWPATH2%
+
+EXIT /b
+
+:AddPath <pathToAdd>
+ECHO %PATH% | FINDSTR /C:"%~1" > nul
+IF ERRORLEVEL 1 (
+ REG add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_SZ /d "%PATH%;%~1" >> add-paths-detail.log
+ IF ERRORLEVEL 0 (
+ ECHO Adding %1 . . . Success! >> add-paths.log
+ SET "PATH=%PATH%;%~1"
+ COPY NUL UPDATE
+ ) ELSE (
+ ECHO Adding %1 . . . FAILED. Run this script with administrator privileges. >> add-paths.log
+ )
+) ELSE (
+ ECHO Skipping %1 - Already in PATH >> add-paths.log
+ )
+EXIT /b \ No newline at end of file