Don't show update confirmation message again when going back.
[mplayer-setup-win32.git] / !_Build.bat
bloba24b5afe33fcfc490c771a4607f5dd804728b09d
1 @echo off
3 REM Build Number and other version info
4 call "%~dp0\!_Version.bat"
5 if "%BUILD_NO%"==""         echo BUILD_NO is not defined!         & pause & goto:eof
6 if "%MPLAYER_REVISION%"=="" echo MPLAYER_REVISION is not defined! & pause & goto:eof
7 if "%SMPLAYER_VERSION%"=="" echo SMPLAYER_VERSION is not defined! & pause & goto:eof
8 if "%MPUI_VERSION%"==""     echo MPUI_VERSION is not defined!     & pause & goto:eof
9 if "%CODECS_DATE%"==""      echo CODECS_DATE is not defined!      & pause & goto:eof
10 if "%BUILD_NO%"==""         echo BUILD_NO is not defined!         & pause & goto:eof
12 REM BSetup prerequisites path
13 call "%~dp0\!_Paths.bat"
14 if "%NSIS_PATH%"==""   echo NSIS_PATH is not defined!   & pause & goto:eof
15 if "%UPX_PATH%"==""    echo UPX_PATH is not defined!    & pause & goto:eof
16 if "%SEVENZ_PATH%"=="" echo SEVENZ_PATH is not defined! & pause & goto:eof
17 if "%VPATCH_PATH%"=="" echo VPATCH_PATH is not defined! & pause & goto:eof
19 REM --------------------------------------------------------------------------
20 REM Do NOT modify any lines below!
21 REM --------------------------------------------------------------------------
23 echo ---------------------------------------------------------
24 echo BUILD_NO: %BUILD_NO%
25 echo MPLAYER_REVISION: %MPLAYER_REVISION%
26 echo SMPLAYER_VERSION: %SMPLAYER_VERSION%
27 echo MPUI_VERSION: %MPUI_VERSION%
28 echo CODECS_DATE: %CODECS_DATE%
29 echo ---------------------------------------------------------
31 REM Get current Date
32 set ISO_DATE=
33 for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\Utils\Date.exe" +ISODATE:%%Y-%%m-%%d') do (
34         if "%%a"=="ISODATE" set "ISO_DATE=%%b"
37 REM Check for MakeNSIS
38 if not exist "%NSIS_PATH%\makensis.exe" (
39         echo MAKENSIS executable not found, check path!
40         pause
41         goto:eof
44 REM Print some Info
45 echo Build #%BUILD_NO%, Date: %ISO_DATE%
46 echo.
48 REM Create outputfolder, if not exists yet
49 mkdir "%~dp0\.Compile" 2> NUL
50 mkdir "%~dp0\.Release" 2> NUL
52 REM Generate docs
53 call "%~dp0\Docs\minify.cmd"
55 REM Build update tool
56 "%NSIS_PATH%\makensis.exe" "/DMPLAYER_BUILDNO=%BUILD_NO%" "/DMPLAYER_DATE=%ISO_DATE%" "/DUPX_PATH=%UPX_PATH%" "/DMPLAYER_OUTFILE=%~dp0\.Compile\Updater.exe" "%~dp0\MPUI_Updater.nsi"
57 if %ERRORLEVEL% NEQ 0 (
58         pause
59         goto:eof
61 "%NSIS_PATH%\peheader.exe" "%~dp0\.Compile\Updater.exe"
62 if %ERRORLEVEL% NEQ 0 (
63         pause
64         goto:eof
67 REM Build main installer
68 "%NSIS_PATH%\makensis.exe" "/DMPLAYER_BUILDNO=%BUILD_NO%" "/DMPLAYER_DATE=%ISO_DATE%" "/DMPLAYER_REVISION=%MPLAYER_REVISION%" "/DSMPLAYER_VERSION=%SMPLAYER_VERSION%" "/DMPUI_VERSION=%MPUI_VERSION%" "/DCODECS_DATE=%CODECS_DATE%" "/DUPX_PATH=%UPX_PATH%" "/DMPLAYER_OUTFILE=%~dp0\.Release\MPUI.%ISO_DATE%.sfx" "%~dp0\MPUI_Setup.nsi"
69 if %ERRORLEVEL% NEQ 0 (
70         pause
71         goto:eof
73 "%NSIS_PATH%\peheader.exe" "%~dp0\.Release\MPUI.%ISO_DATE%.sfx"
74 if %ERRORLEVEL% NEQ 0 (
75         pause
76         goto:eof
79 REM Build installer wrapper
80 call "%SEVENZ_PATH%\7zSD.cmd" "%~dp0\.Release\MPUI.%ISO_DATE%.sfx" "%~dp0\.Release\MPUI.%ISO_DATE%.exe" "MPlayer for Windows" "MPUI-Setup-r%BUILD_NO%"
81 if %ERRORLEVEL% NEQ 0 (
82         pause
83         goto:eof
85 "%NSIS_PATH%\peheader.exe" "%~dp0\.Release\MPUI.%ISO_DATE%.exe"
86 if %ERRORLEVEL% NEQ 0 (
87         pause
88         goto:eof
91 set "VERPATCH_PRODUCT=MPlayer for Windows (Installer)"
92 set "VERPATCH_FILEVER=%ISO_DATE:-=.%.%BUILD_NO%"
93 "%VPATCH_PATH%\VerPatch.exe" "%~dp0\.Release\MPUI.%ISO_DATE%.exe" "%VERPATCH_FILEVER%" /pv "%VERPATCH_FILEVER%" /fn /s desc "%VERPATCH_PRODUCT%" /s product "%VERPATCH_PRODUCT%" /s title "MPUI Setup SFX" /s copyright "Copyright (C) LoRd_MuldeR" /s company "Free Software Foundation"
94 if %ERRORLEVEL% NEQ 0 (
95         pause
96         goto:eof
99 pause