Browse files

Update nsis.bat so that it works on more machines.

Avoid hardcoding the location of nsis.exe.
  • Loading branch information...
1 parent 637c21b commit 094b941d5017bbafeda6c1e96069b0d60969dc14 @Mac-H Mac-H committed with Osku Salerma Dec 1, 2011
Showing with 19 additions and 1 deletion.
  1. +19 −1 nsis.bat
20 nsis.bat
@@ -1 +1,19 @@
-"C:\Program Files\NSIS\makensis" install.nsi
+@echo off
+rem #
+rem # Don't make assumptions as to where the 'makensis.exe' is - look in the obvious places
+rem #
+if exist "C:\Program Files (x86)\NSIS\makensis.exe" set NSIS_EXE="C:\Program Files (x86)\NSIS\makensis.exe"
+if exist "C:\Program Files\NSIS\makensis.exe" set NSIS_EXE="C:\Program Files\NSIS\makensis.exe"
+if exist "%ProgramFiles%\NSIS\makensis.exe" set NSIS_EXE="%ProgramFiles%\NSIS\makensis.exe"
+if exist "%ProgramFiles(x86)%\NSIS\makensis.exe" set NSIS_EXE="%ProgramFiles(x86)%\NSIS\makensis.exe"
+rem #
+rem # Backup - use the one found in the path
+rem #
+if %ERRORLEVEL% NEQ 0 set NSIS_EXE="makensis.exe"
+rem #
+rem #
+rem #
+%NSIS_EXE% install.nsi

0 comments on commit 094b941

Please sign in to comment.