diff --git a/.gitignore b/.gitignore index 8ba677a..7565e14 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /bin/ /ipch/ /res/toolset/ +/src/*.h.bak /*.sdf /*.suo /*.user diff --git a/etc/auto_inc.exe b/etc/auto_inc.exe new file mode 100644 index 0000000..dac6073 Binary files /dev/null and b/etc/auto_inc.exe differ diff --git a/etc/check_os.nsh b/etc/check_os.nsh index db92f6d..6539d4a 100644 --- a/etc/check_os.nsh +++ b/etc/check_os.nsh @@ -1,3 +1,5 @@ +!include "WinVer.nsh" + Function .onInit System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{79d6a7e5-35af-47b1-a7d6-f20d0e5df772}") i .r1 ?e' Pop $0 @@ -5,21 +7,32 @@ Function .onInit MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the installer is already running!" Quit ${EndIf} - + ; -------- ${IfNot} ${IsNT} - MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application does NOT support Windows 9x or Windows ME!" + MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application does NOT support Windows 9x !!!" + Quit + ${EndIf} + + ${IfNot} ${AtLeastWinXP} + MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application requires Windows XP or later!" Quit ${EndIf} - ${If} ${AtMostWinNT4} - ${StdUtils.GetParameter} $R0 "Update" "?" - ${If} $R0 == "?" - MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, your platform is not supported anymore. Installation aborted!$\nThe minimum required platform is Windows 2000." - ${Else} - MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, your platform is not supported anymore. Update not possible!$\nThe minimum required platform is Windows 2000." - ${EndIf} + ${If} ${IsWinXP} + ${AndIf} ${AtMostServicePack} 1 + MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application requires Service-Pack 2 for Windows XP or later!" + ExecShell "open" "http://www.microsoft.com/download/en/details.aspx?id=24" + Quit + ${EndIf} + + ; -------- + + UserInfo::GetAccountType + Pop $0 + ${If} $0 != "Admin" + MessageBox MB_ICONSTOP|MB_TOPMOST "Your system requires administrative permissions in order to install this software." Quit ${EndIf} FunctionEnd diff --git a/etc/finalization.nsh b/etc/finalization.nsh new file mode 100644 index 0000000..c6ce51d --- /dev/null +++ b/etc/finalization.nsh @@ -0,0 +1,3 @@ +Function .onInstSuccess + ExecShell "explore" '$INSTDIR' +FunctionEnd diff --git a/etc/shortcut.nsh b/etc/shortcut.nsh new file mode 100644 index 0000000..043299b --- /dev/null +++ b/etc/shortcut.nsh @@ -0,0 +1,4 @@ +#Function createShortcuts + MessageBox MB_ICONQUESTION|MB_TOPMOST|MB_YESNO "Create a desktop icon for Simple x264 Launcher?" IDNO +2 + CreateShortCut "$DESKTOP\Simple x264 Launcher.lnk" "$INSTDIR\x264_launcher.exe" +#FunctionEnd diff --git a/src/version.h b/src/version.h index ad97351..9b8e081 100644 --- a/src/version.h +++ b/src/version.h @@ -21,7 +21,7 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 0 -#define VER_X264_PATCH 62 +#define VER_X264_PATCH 66 #define VER_X264_MINIMUM_REV 2146 #define VER_X264_CURRENT_API 120 diff --git a/z_build.bat b/z_build.bat index c860238..5a4b294 100644 --- a/z_build.bat +++ b/z_build.bat @@ -1,13 +1,47 @@ @echo off REM /////////////////////////////////////////////////////////////////////////// -set "MSVC_PATH=D:\Microsoft Visual Studio 10.0\VC" -set "NSIS_PATH=E:\NSIS\_Unicode" -set "QTVC_PATH=E:\QtSDK\Desktop\Qt\4.8.0\msvc2010" -set "UPX3_PATH=E:\UPX" +REM // Set Paths +REM /////////////////////////////////////////////////////////////////////////// +set "MSVC_PATH=C:\Program Files\Microsoft Visual Studio 10.0\VC" +set "NSIS_PATH=C:\Program Files\NSIS\Unicode" +set "QTVC_PATH=C:\MuldeR\Qt\4.8.0" +set "UPX3_PATH=C:\Program Files\UPX" + +REM ############################################### +REM # DO NOT MODIFY ANY LINES BELOW THIS LINE !!! # +REM ############################################### + + +REM /////////////////////////////////////////////////////////////////////////// +REM // Setup environment REM /////////////////////////////////////////////////////////////////////////// if exist "%QTVC_PATH%\bin\qtvars.bat" ( call "%QTVC_PATH%\bin\qtvars.bat" ) if exist "%QTVC_PATH%\bin\qtenv2.bat" ( call "%QTVC_PATH%\bin\qtenv2.bat" ) call "%MSVC_PATH%\vcvarsall.bat" x86 + +REM /////////////////////////////////////////////////////////////////////////// +REM // Check environment +REM /////////////////////////////////////////////////////////////////////////// +if "%VCINSTALLDIR%"=="" ( + echo %%VCINSTALLDIR%% not specified. Please check your MSVC_PATH var! + goto BuildError +) +if "%QTDIR%"=="" ( + echo %%QTDIR%% not specified. Please check your MSVC_PATH var! + goto BuildError +) +if not exist "%VCINSTALLDIR%\bin\cl.exe" ( + echo C++ compiler not found. Please check your MSVC_PATH var! + goto BuildError +) +if not exist "%QTDIR%\bin\moc.exe" ( + echo Qt meta compiler not found. Please check your QTVC_PATH var! + goto BuildError +) + +REM /////////////////////////////////////////////////////////////////////////// +REM // Build the binaries +REM /////////////////////////////////////////////////////////////////////////// echo --------------------------------------------------------------------- echo BEGIN BUILD echo --------------------------------------------------------------------- @@ -15,6 +49,10 @@ MSBuild.exe /property:Configuration=release /target:clean "%~dp0\x264_launcher.s if not "%ERRORLEVEL%"=="0" goto BuildError MSBuild.exe /property:Configuration=release /target:rebuild "%~dp0\x264_launcher.sln" if not "%ERRORLEVEL%"=="0" goto BuildError + +REM /////////////////////////////////////////////////////////////////////////// +REM // Copy base files +REM /////////////////////////////////////////////////////////////////////////// echo --------------------------------------------------------------------- echo BEGIN PACKAGING echo --------------------------------------------------------------------- @@ -24,7 +62,9 @@ mkdir "%PACK_PATH%\imageformats" mkdir "%PACK_PATH%\toolset" copy "%~dp0\bin\Release\*.exe" "%PACK_PATH%" copy "%~dp0\bin\Release\toolset\*.exe" "%PACK_PATH%\toolset" -copy "%~dp0\*.txt" "%PACK_PATH%" + +REM /////////////////////////////////////////////////////////////////////////// +REM // Copy dependencies REM /////////////////////////////////////////////////////////////////////////// copy "%MSVC_PATH%\redist\x86\Microsoft.VC100.CRT\*.dll" "%PACK_PATH%" copy "%QTVC_PATH%\bin\QtCore4.dll" "%PACK_PATH%" @@ -34,49 +74,74 @@ copy "%QTVC_PATH%\bin\QtXml4.dll" "%PACK_PATH%" copy "%QTVC_PATH%\bin\QtXml4.dll" "%PACK_PATH%" copy "%QTVC_PATH%\plugins\imageformats\*.dll" "%PACK_PATH%\imageformats" del "%PACK_PATH%\imageformats\*d4.dll" + +REM /////////////////////////////////////////////////////////////////////////// +REM // Compress REM /////////////////////////////////////////////////////////////////////////// "%UPX3_PATH%\upx.exe" --brute "%PACK_PATH%\*.exe" "%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\*.dll" + +REM /////////////////////////////////////////////////////////////////////////// +REM // Get current date (in ISO format) REM /////////////////////////////////////////////////////////////////////////// if not exist "%~dp0\etc\date.exe" BuildError for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d') do ( if "%%a"=="ISODATE" set "ISO_DATE=%%b" ) if "%ISO_DATE%"=="" BuildError + +REM /////////////////////////////////////////////////////////////////////////// +REM // Setup install parameters REM /////////////////////////////////////////////////////////////////////////// set "NSI_FILE=%TMP%\~%RANDOM%%RANDOM%.nsi" set "OUT_NAME=x264_x64.%ISO_DATE%" set "OUT_PATH=%~dp0\bin" set "OUT_FULL=%OUT_PATH%\%OUT_NAME%.exe" -REM /////////////////////////////////////////////////////////////////////////// :GenerateOutfileName if exist "%OUT_FULL%" ( set "OUT_NAME=%OUT_NAME%.new" set "OUT_FULL=%OUT_PATH%\%OUT_NAME%.exe" goto GenerateOutfileName ) + REM /////////////////////////////////////////////////////////////////////////// -echo !define ZIP2EXE_NAME `Simple x264 Launcher (%ISO_DATE%)` > "%NSI_FILE%" +REM // Generate install script +REM /////////////////////////////////////////////////////////////////////////// +echo #Generated File - Do NOT modify! > "%NSI_FILE%" +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 ShowInstDetails show >> "%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 !include `%~dp0\etc\shortcut.nsh` >> "%NSI_FILE%" echo !insertmacro SECTION_END >> "%NSI_FILE%" +echo !include `%~dp0\etc\check_os.nsh` >> "%NSI_FILE%" +echo !include `%~dp0\etc\finalization.nsh` >> "%NSI_FILE%" + +REM /////////////////////////////////////////////////////////////////////////// +REM // Build the installer REM /////////////////////////////////////////////////////////////////////////// "%NSIS_PATH%\makensis.exe" "%NSI_FILE%" if not "%ERRORLEVEL%"=="0" goto BuildError attrib +R "%OUT_FULL%" del "%NSI_FILE%" rmdir /Q /S "%PACK_PATH%" + +REM /////////////////////////////////////////////////////////////////////////// +REM // COMPLETE REM /////////////////////////////////////////////////////////////////////////// echo. echo Build completed. echo. pause goto:eof + +REM /////////////////////////////////////////////////////////////////////////// +REM // FAILED REM /////////////////////////////////////////////////////////////////////////// :BuildError echo.