2 REM ///////////////////////////////////////////////////////////////////////////
3 set "MSVC_PATH=D:\Microsoft Visual Studio 10.0\VC"
4 set "NSIS_PATH=E:\NSIS\_Unicode"
5 set "QTVC_PATH=E:\QtSDK\Desktop\Qt\4.8.0\msvc2010"
7 REM ///////////////////////////////////////////////////////////////////////////
8 if exist "%QTVC_PATH%\bin\qtvars.bat" ( call "%QTVC_PATH%\bin\qtvars.bat" )
9 if exist "%QTVC_PATH%\bin\qtenv2.bat" ( call "%QTVC_PATH%\bin\qtenv2.bat" )
10 call "%MSVC_PATH%\vcvarsall.bat" x86
11 echo ---------------------------------------------------------------------
13 echo ---------------------------------------------------------------------
14 MSBuild.exe /property:Configuration=release /target:clean "%~dp0\x264_launcher.sln"
15 if not "%ERRORLEVEL%"=="0" goto BuildError
16 MSBuild.exe /property:Configuration=release /target:rebuild "%~dp0\x264_launcher.sln"
17 if not "%ERRORLEVEL%"=="0" goto BuildError
18 echo ---------------------------------------------------------------------
20 echo ---------------------------------------------------------------------
21 set "PACK_PATH=%TMP%\~%RANDOM%%RANDOM%.tmp"
23 mkdir "%PACK_PATH%\imageformats"
24 mkdir "%PACK_PATH%\toolset"
25 copy "%~dp0\bin\Release\*.exe" "%PACK_PATH%"
26 copy "%~dp0\bin\Release\toolset\*.exe" "%PACK_PATH%\toolset"
27 REM ///////////////////////////////////////////////////////////////////////////
28 copy "%MSVC_PATH%\redist\x86\Microsoft.VC100.CRT\*.dll" "%PACK_PATH%"
29 copy "%QTVC_PATH%\bin\QtCore4.dll" "%PACK_PATH%"
30 copy "%QTVC_PATH%\bin\QtGui4.dll" "%PACK_PATH%"
31 copy "%QTVC_PATH%\bin\QtSvg4.dll" "%PACK_PATH%"
32 copy "%QTVC_PATH%\bin\QtXml4.dll" "%PACK_PATH%"
33 copy "%QTVC_PATH%\bin\QtXml4.dll" "%PACK_PATH%"
34 copy "%QTVC_PATH%\plugins\imageformats\*.dll" "%PACK_PATH%\imageformats"
35 del "%PACK_PATH%\imageformats\*d4.dll"
36 REM ///////////////////////////////////////////////////////////////////////////
37 "%UPX3_PATH%\upx.exe" --brute "%PACK_PATH%\*.exe"
38 "%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\*.dll"
39 REM ///////////////////////////////////////////////////////////////////////////
40 if not exist "%~dp0\etc\date.exe" BuildError
41 for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d') do (
42 if "%%a"=="ISODATE" set "ISO_DATE=%%b"
44 if "%ISO_DATE%"=="" BuildError
45 REM ///////////////////////////////////////////////////////////////////////////
46 set "NSI_FILE=%TMP%\~%RANDOM%%RANDOM%.nsi"
47 set "OUT_NAME=x264_x64.%ISO_DATE%"
48 set "OUT_PATH=%~dp0\bin"
49 set "OUT_FULL=%OUT_PATH%\%OUT_NAME%.exe"
50 REM ///////////////////////////////////////////////////////////////////////////
52 if exist "%OUT_FULL%" (
53 set "OUT_NAME=%OUT_NAME%.new"
54 set "OUT_FULL=%OUT_PATH%\%OUT_NAME%.exe"
55 goto GenerateOutfileName
57 REM ///////////////////////////////////////////////////////////////////////////
58 echo !define ZIP2EXE_NAME `Simple x264 Launcher (%ISO_DATE%)` > "%NSI_FILE%"
59 echo !define ZIP2EXE_OUTFILE `%OUT_FULL%` >> "%NSI_FILE%"
60 echo !define ZIP2EXE_COMPRESSOR_LZMA >> "%NSI_FILE%"
61 echo !define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\MuldeR\Simple x264 Launcher v2` >> "%NSI_FILE%"
62 echo !include `${NSISDIR}\Contrib\zip2exe\Base.nsh` >> "%NSI_FILE%"
63 echo !include `${NSISDIR}\Contrib\zip2exe\Modern.nsh` >> "%NSI_FILE%"
64 echo !insertmacro SECTION_BEGIN >> "%NSI_FILE%"
65 echo File /r `%PACK_PATH%\*.*` >> "%NSI_FILE%"
66 echo !insertmacro SECTION_END >> "%NSI_FILE%"
67 REM ///////////////////////////////////////////////////////////////////////////
68 "%NSIS_PATH%\makensis.exe" "%NSI_FILE%"
69 if not "%ERRORLEVEL%"=="0" goto BuildError
70 attrib +R "%OUT_FULL%"
72 rmdir /Q /S "%PACK_PATH%"
73 REM ///////////////////////////////////////////////////////////////////////////
79 REM ///////////////////////////////////////////////////////////////////////////
82 echo Build has failed !!!