Improved build script.

This commit is contained in:
LoRd_MuldeR 2012-02-07 00:22:25 +01:00
parent 394379d74f
commit 42a2bf73ec

View File

@ -43,19 +43,32 @@ for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d'
) )
if "%ISO_DATE%"=="" BuildError if "%ISO_DATE%"=="" BuildError
REM /////////////////////////////////////////////////////////////////////////// REM ///////////////////////////////////////////////////////////////////////////
set "NSIS_FILE=%TMP%\~%RANDOM%%RANDOM%.nsi" set "NSI_FILE=%TMP%\~%RANDOM%%RANDOM%.nsi"
echo !define ZIP2EXE_NAME `Simple x264 Launcher (%ISO_DATE%)` > "%NSIS_FILE%" set "OUT_NAME=x264_x64.%ISO_DATE%"
echo !define ZIP2EXE_OUTFILE `%~dp0\bin\x264_x64.%ISO_DATE%.exe` >> "%NSIS_FILE%" set "OUT_PATH=%~dp0\bin"
echo !define ZIP2EXE_COMPRESSOR_LZMA >> "%NSIS_FILE%" set "OUT_FULL=%OUT_PATH%\%OUT_NAME%.exe"
echo !define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\MuldeR\Simple x264 Launcher v2` >> "%NSIS_FILE%" REM ///////////////////////////////////////////////////////////////////////////
echo !include `${NSISDIR}\Contrib\zip2exe\Base.nsh` >> "%NSIS_FILE%" :GenerateOutfileName
echo !include `${NSISDIR}\Contrib\zip2exe\Modern.nsh` >> "%NSIS_FILE%" if exist "%OUT_FULL%" (
echo !insertmacro SECTION_BEGIN >> "%NSIS_FILE%" set "OUT_NAME=%OUT_NAME%.new"
echo File /r `%PACK_PATH%\*.*` >> "%NSIS_FILE%" set "OUT_FULL=%OUT_PATH%\%OUT_NAME%.exe"
echo !insertmacro SECTION_END >> "%NSIS_FILE%" goto GenerateOutfileName
"%NSIS_PATH%\makensis.exe" "%NSIS_FILE%" )
REM ///////////////////////////////////////////////////////////////////////////
echo !define ZIP2EXE_NAME `Simple x264 Launcher (%ISO_DATE%)` > "%NSI_FILE%"
echo !define ZIP2EXE_OUTFILE `%OUT_FULL%` >> "%NSI_FILE%"
echo !define ZIP2EXE_COMPRESSOR_LZMA >> "%NSI_FILE%"
echo !define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\MuldeR\Simple x264 Launcher v2` >> "%NSI_FILE%"
echo !include `${NSISDIR}\Contrib\zip2exe\Base.nsh` >> "%NSI_FILE%"
echo !include `${NSISDIR}\Contrib\zip2exe\Modern.nsh` >> "%NSI_FILE%"
echo !insertmacro SECTION_BEGIN >> "%NSI_FILE%"
echo File /r `%PACK_PATH%\*.*` >> "%NSI_FILE%"
echo !insertmacro SECTION_END >> "%NSI_FILE%"
REM ///////////////////////////////////////////////////////////////////////////
"%NSIS_PATH%\makensis.exe" "%NSI_FILE%"
if not "%ERRORLEVEL%"=="0" goto BuildError if not "%ERRORLEVEL%"=="0" goto BuildError
del "%NSIS_FILE%" attrib +R "%OUT_FULL%"
del "%NSI_FILE%"
rmdir /Q /S "%PACK_PATH%" rmdir /Q /S "%PACK_PATH%"
REM /////////////////////////////////////////////////////////////////////////// REM ///////////////////////////////////////////////////////////////////////////
echo. echo.