2010-11-11 00:25:23 +01:00
|
|
|
@echo off
|
2010-11-21 23:20:14 +01:00
|
|
|
setlocal ENABLEDELAYEDEXPANSION
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: SETUP ENVIRONMENT
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
set "_LAMEXP_PATHS_INITIALIZED_="
|
|
|
|
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_paths.bat"
|
2014-12-22 22:40:20 +01:00
|
|
|
call "%~dp0\_date.bat"
|
|
|
|
|
2010-11-11 00:25:23 +01:00
|
|
|
if "%LAMEXP_CONFIG%"=="" (
|
|
|
|
set "LAMEXP_CONFIG=Release"
|
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2010-11-11 00:41:49 +01:00
|
|
|
if not "%LAMEXP_REDIST%"=="0" (
|
|
|
|
set "LAMEXP_REDIST=1"
|
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: SETUP PATHS
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2011-04-19 16:21:19 +02:00
|
|
|
set "OUT_PATH=%~dp0\..\..\bin\%LAMEXP_CONFIG%"
|
2011-04-22 22:10:55 +02:00
|
|
|
set "TMP_PATH=%TEMP%\~LameXP.%LAMEXP_CONFIG%.%ISO_DATE%.%RANDOM%.tmp"
|
2011-04-19 16:21:19 +02:00
|
|
|
set "OBJ_PATH=%~dp0\..\..\obj\%LAMEXP_CONFIG%"
|
|
|
|
set "MOC_PATH=%~dp0\..\..\tmp"
|
|
|
|
set "IPC_PATH=%~dp0\..\..\ipch"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2011-04-16 21:20:21 +02:00
|
|
|
if "%LAMEXP_SKIP_BUILD%"=="YES" (
|
|
|
|
goto SkipBuildThisTime
|
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: CLEAN UP
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2010-11-12 21:02:14 +01:00
|
|
|
del /Q "%OUT_PATH%\*.exe"
|
|
|
|
del /Q "%OUT_PATH%\*.dll"
|
|
|
|
del /Q "%OBJ_PATH%\*.obj"
|
|
|
|
del /Q "%OBJ_PATH%\*.res"
|
|
|
|
del /Q "%OBJ_PATH%\*.bat"
|
|
|
|
del /Q "%OBJ_PATH%\*.idb"
|
2011-04-14 21:55:05 +02:00
|
|
|
del /Q "%OBJ_PATH%\*.log"
|
|
|
|
del /Q "%OBJ_PATH%\*.manifest"
|
|
|
|
del /Q "%OBJ_PATH%\*.lastbuildstate"
|
|
|
|
del /Q "%OBJ_PATH%\*.htm"
|
|
|
|
del /Q "%OBJ_PATH%\*.dep"
|
2010-11-12 21:02:14 +01:00
|
|
|
del /Q "%MOC_PATH%\*.cpp"
|
|
|
|
del /Q "%MOC_PATH%\*.h"
|
2011-04-16 21:20:21 +02:00
|
|
|
del /Q /S "%IPC_PATH%\*.*"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: UPDATE LANGUAGE FILES AND DCOS
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
call "%~dp0\_mkdocs.bat"
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_lupdate.bat"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: BUILD THE BINARIES
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_build.bat" "%~dp0\..\..\%PATH_VCPROJ%" "%LAMEXP_CONFIG%"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2011-04-16 21:20:21 +02:00
|
|
|
:SkipBuildThisTime
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: READ VERSION INFO
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_version.bat"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: GENERATE OUTPUT FILE NAME
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2012-07-21 19:16:12 +02:00
|
|
|
mkdir "%~dp0\..\..\out" 2> NUL
|
|
|
|
set "OUT_FILE=%~dp0\..\..\out\%VER_LAMEXP_BASENAME%.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%"
|
2010-11-21 23:20:14 +01:00
|
|
|
for /L %%n in (1, 1, 99) do (
|
2012-07-21 19:16:12 +02:00
|
|
|
if exist "!OUT_FILE!.exe" set "OUT_FILE=%~dp0\..\..\out\%VER_LAMEXP_BASENAME%.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%.Update-%%n"
|
|
|
|
if exist "!OUT_FILE!.zip" set "OUT_FILE=%~dp0\..\..\out\%VER_LAMEXP_BASENAME%.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%.Update-%%n"
|
2010-11-21 23:20:14 +01:00
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: DELETE OLD OUTPUT FILE
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
for %%i in (exe,sfx,zip,txt) do (
|
|
|
|
del "%OUT_FILE%.%%i" 2> NUL
|
|
|
|
if exist "%OUT_FILE%.%%i" (
|
|
|
|
echo. && echo Failed to delete existing output file^^!
|
|
|
|
echo. && pause && exit
|
|
|
|
)
|
2010-11-11 00:25:23 +01:00
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: POST BUILD OPERATIONS
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2010-11-11 00:25:23 +01:00
|
|
|
rd /S /Q "%TMP_PATH%"
|
|
|
|
mkdir "%TMP_PATH%"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
for %%i in (exe,dll) do (
|
|
|
|
copy "%OUT_PATH%\*.%%i" "%TMP_PATH%"
|
|
|
|
)
|
|
|
|
|
2010-11-11 00:41:49 +01:00
|
|
|
if "%LAMEXP_REDIST%"=="1" (
|
2010-11-11 14:11:44 +01:00
|
|
|
mkdir "%TMP_PATH%\imageformats"
|
2014-12-22 22:40:20 +01:00
|
|
|
for %%i in (Core,Gui,Network,Xml,Svg) do (
|
|
|
|
copy "%QTDIR%\bin\Qt%%i4.dll" "%TMP_PATH%"
|
|
|
|
)
|
2010-11-11 00:41:49 +01:00
|
|
|
copy "%QTDIR%\plugins\imageformats\q???4.dll" "%TMP_PATH%\imageformats"
|
2014-12-22 22:40:20 +01:00
|
|
|
for %%i in (100,110,120) do (
|
|
|
|
if exist %PATH_MSCDIR%\VC\redist\x86\Microsoft.VC%%i.CRT\*.dll" (
|
|
|
|
copy "%PATH_MSCDIR%\VC\redist\x86\Microsoft.VC%%i.CRT\*.dll" "%TMP_PATH%"
|
|
|
|
)
|
|
|
|
)
|
2010-11-11 00:41:49 +01:00
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
for %%e in (exe,dll) do (
|
|
|
|
for %%f in (%TMP_PATH%\*.%%e) do (
|
|
|
|
"%PATH_UPXBIN%\upx.exe" --best "%%f"
|
|
|
|
)
|
2010-11-11 00:25:23 +01:00
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2011-04-19 16:21:19 +02:00
|
|
|
if exist "%~dp0\_postproc.bat" (
|
|
|
|
call "%~dp0\_postproc.bat" "%TMP_PATH%"
|
2010-11-11 00:25:23 +01:00
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
copy "%~dp0\..\..\ReadMe.txt" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\License.txt" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\Copying.txt" "%TMP_PATH%"
|
2011-04-19 16:21:19 +02:00
|
|
|
copy "%~dp0\..\..\doc\Changelog.html" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\doc\Translate.html" "%TMP_PATH%"
|
2014-12-22 22:40:20 +01:00
|
|
|
copy "%~dp0\..\..\doc\Manual.html" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\doc\FAQ.html" "%TMP_PATH%"
|
|
|
|
|
2012-07-01 21:11:04 +02:00
|
|
|
if not "%VER_LAMEXP_TYPE%" == "Final" (
|
|
|
|
if not "%VER_LAMEXP_TYPE%" == "Hotfix" (
|
|
|
|
copy "%~dp0\..\..\doc\PRE_RELEASE_INFO.txt" "%TMP_PATH%"
|
|
|
|
)
|
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2012-07-02 01:19:32 +02:00
|
|
|
attrib +R "%TMP_PATH%\*.txt"
|
|
|
|
attrib +R "%TMP_PATH%\*.html"
|
|
|
|
attrib +R "%TMP_PATH%\*.exe"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: CREATE PACKAGES
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2014-01-08 21:43:24 +01:00
|
|
|
"%~dp0\..\Utilities\Echo.exe" LameXP - Audio Encoder Front-End > "%OUT_FILE%.txt"
|
|
|
|
"%~dp0\..\Utilities\Echo.exe" v%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO% %VER_LAMEXP_TYPE%-%VER_LAMEXP_PATCH% (Build #%VER_LAMEXP_BUILD%)\n >> "%OUT_FILE%.txt"
|
|
|
|
"%~dp0\..\Utilities\Echo.exe" Built on %ISO_DATE% at %TIME%\n\n >> "%OUT_FILE%.txt"
|
|
|
|
"%~dp0\..\Utilities\Echo.exe" ---------------------------\nREADME.TXT\n--------------------------- >> "%OUT_FILE%.txt"
|
|
|
|
"%~dp0\..\Utilities\Cat.exe" "%~dp0\..\..\ReadMe.txt" >> "%OUT_FILE%.txt"
|
|
|
|
"%~dp0\..\Utilities\Echo.exe" \n\n---------------------------\nLICENSE.TXT\n---------------------------\n >> "%OUT_FILE%.txt"
|
|
|
|
"%~dp0\..\Utilities\Cat.exe" "%~dp0\..\..\License.txt" >> "%OUT_FILE%.txt"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2014-01-08 21:43:24 +01:00
|
|
|
pushd "%TMP_PATH%"
|
|
|
|
"%~dp0\..\Utilities\Zip.exe" -r -9 -z "%OUT_FILE%.zip" "*.*" < "%OUT_FILE%.txt"
|
|
|
|
popd
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2011-10-02 23:32:15 +02:00
|
|
|
"%PATH_MKNSIS%\makensis.exe" "/DLAMEXP_UPX_PATH=%PATH_UPXBIN%" "/DLAMEXP_DATE=%ISO_DATE%" "/DLAMEXP_VERSION=%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%" "/DLAMEXP_BUILD=%VER_LAMEXP_BUILD%" "/DLAMEXP_INSTTYPE=%VER_LAMEXP_TYPE%" "/DLAMEXP_PATCH=%VER_LAMEXP_PATCH%" "/DLAMEXP_OUTPUT_FILE=%OUT_FILE%.sfx" "/DLAMEXP_SOURCE_PATH=%TMP_PATH%" "%~dp0\..\NSIS\setup.nsi"
|
|
|
|
"%PATH_MKNSIS%\makensis.exe" "/DLAMEXP_UPX_PATH=%PATH_UPXBIN%" "/DLAMEXP_DATE=%ISO_DATE%" "/DLAMEXP_VERSION=%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%" "/DLAMEXP_BUILD=%VER_LAMEXP_BUILD%" "/DLAMEXP_INSTTYPE=%VER_LAMEXP_TYPE%" "/DLAMEXP_PATCH=%VER_LAMEXP_PATCH%" "/DLAMEXP_OUTPUT_FILE=%OUT_FILE%.exe" "/DLAMEXP_SOURCE_FILE=%OUT_FILE%.sfx" "%~dp0\..\NSIS\wrapper.nsi"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2012-07-02 01:19:32 +02:00
|
|
|
attrib -R "%TMP_PATH%\*.txt"
|
|
|
|
attrib -R "%TMP_PATH%\*.html"
|
|
|
|
attrib -R "%TMP_PATH%\*.exe"
|
2010-11-11 00:25:23 +01:00
|
|
|
rd /S /Q "%TMP_PATH%"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
for %%i in (zip,exe) do (
|
|
|
|
if not exist "%OUT_FILE%.zip" (
|
|
|
|
echo. && echo Failed to create release packages^^!
|
|
|
|
echo. && pause && exit
|
|
|
|
)
|
2010-11-11 00:25:23 +01:00
|
|
|
)
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2010-11-21 23:20:14 +01:00
|
|
|
attrib +R "%OUT_FILE%.zip"
|
2011-10-02 23:32:15 +02:00
|
|
|
attrib +R "%OUT_FILE%.sfx"
|
2010-11-21 23:20:14 +01:00
|
|
|
attrib +R "%OUT_FILE%.exe"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: SIGN OUTPUT FILE
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2011-10-02 23:32:15 +02:00
|
|
|
"%PATH_GNUPG1%\gpg.exe" --detach-sign "%OUT_FILE%.exe"
|
2010-11-29 14:00:27 +01:00
|
|
|
attrib +R "%OUT_FILE%.exe.sig"
|
2014-12-22 22:40:20 +01:00
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: COMPLETED
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2010-11-11 00:25:23 +01:00
|
|
|
echo.
|
|
|
|
echo BUIDL COMPLETED SUCCESSFULLY :-)
|
|
|
|
echo.
|
2014-12-22 22:40:20 +01:00
|
|
|
|
2010-11-11 00:25:23 +01:00
|
|
|
pause
|