2010-11-11 00:25:23 +01:00
|
|
|
@echo off
|
2010-11-21 23:20:14 +01:00
|
|
|
setlocal ENABLEDELAYEDEXPANSION
|
2010-11-11 00:25:23 +01:00
|
|
|
REM ------------------------------------------
|
2010-11-21 23:20:14 +01:00
|
|
|
REM :: SETUP ENVIRONMENT ::
|
2010-11-11 00:25:23 +01:00
|
|
|
REM ------------------------------------------
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_paths.bat"
|
2010-11-11 00:25:23 +01:00
|
|
|
if not "%LAMEXP_ERROR%"=="0" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "FAILD TO SETUP PATHS. CHECK YOUR 'BUILDENV.TXT' FILE"
|
2010-11-11 00:25:23 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
|
|
|
if "%LAMEXP_CONFIG%"=="" (
|
|
|
|
set "LAMEXP_CONFIG=Release"
|
|
|
|
)
|
2010-11-11 00:41:49 +01:00
|
|
|
if not "%LAMEXP_REDIST%"=="0" (
|
|
|
|
set "LAMEXP_REDIST=1"
|
|
|
|
)
|
2010-11-11 00:25:23 +01:00
|
|
|
REM ------------------------------------------
|
2011-04-21 01:45:07 +02:00
|
|
|
REM :: SETUP BUILD DATE ::
|
|
|
|
REM ------------------------------------------
|
|
|
|
call "%~dp0\_date.bat"
|
2011-04-21 20:35:03 +02:00
|
|
|
if not "%LAMEXP_ERROR%"=="0" (
|
|
|
|
call "%~dp0\_error.bat" "FAILD TO SETUP BUILD-DATE"
|
|
|
|
GOTO:EOF
|
|
|
|
)
|
2011-04-21 01:45:07 +02:00
|
|
|
REM ------------------------------------------
|
2010-11-21 23:20:14 +01:00
|
|
|
REM :: SETUP PATHS ::
|
|
|
|
REM ------------------------------------------
|
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"
|
2010-11-11 00:25:23 +01:00
|
|
|
REM ------------------------------------------
|
2011-04-16 21:20:21 +02:00
|
|
|
if "%LAMEXP_SKIP_BUILD%"=="YES" (
|
|
|
|
goto SkipBuildThisTime
|
|
|
|
)
|
2010-12-08 18:31:39 +01:00
|
|
|
REM ------------------------------------------
|
2010-11-11 00:25:23 +01:00
|
|
|
REM :: CLEAN UP ::
|
|
|
|
REM ------------------------------------------
|
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%\*.*"
|
2010-11-21 23:20:14 +01:00
|
|
|
REM ------------------------------------------
|
|
|
|
REM :: BUILD BINARIES ::
|
|
|
|
REM ------------------------------------------
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_lupdate.bat"
|
|
|
|
call "%~dp0\_build.bat" "%~dp0\..\..\%PATH_VCPROJ%" "%LAMEXP_CONFIG%"
|
2010-11-21 23:20:14 +01:00
|
|
|
if not "%LAMEXP_ERROR%"=="0" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "BUILD HAS FAILED"
|
2010-11-21 23:20:14 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
2011-04-16 21:20:21 +02:00
|
|
|
:SkipBuildThisTime
|
2010-12-08 18:31:39 +01:00
|
|
|
REM ------------------------------------------
|
2010-11-21 23:20:14 +01:00
|
|
|
REM :: READ VERSION INFO ::
|
|
|
|
REM ------------------------------------------
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_version.bat"
|
2010-11-21 23:20:14 +01:00
|
|
|
if not "%LAMEXP_ERROR%"=="0" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "FAILD TO READ VERSION INFO!"
|
2010-11-21 23:20:14 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
2011-04-21 20:35:03 +02:00
|
|
|
set "OUT_FILE=%OUT_PATH%\..\LameXP.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%"
|
2010-11-21 23:20:14 +01:00
|
|
|
for /L %%n in (1, 1, 99) do (
|
2011-04-21 20:35:03 +02:00
|
|
|
if exist "!OUT_FILE!.exe" set "OUT_FILE=%OUT_PATH%\..\LameXP.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%.Update-%%n"
|
|
|
|
if exist "!OUT_FILE!.zip" set "OUT_FILE=%OUT_PATH%\..\LameXP.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%.Update-%%n"
|
2010-11-21 23:20:14 +01:00
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
|
|
|
REM :: DELETE OLD OUTPUT FILE ::
|
|
|
|
REM ------------------------------------------
|
2010-11-11 00:25:23 +01:00
|
|
|
del "%OUT_FILE%.exe"
|
2011-10-02 23:32:15 +02:00
|
|
|
del "%OUT_FILE%.sfx"
|
2010-11-11 00:25:23 +01:00
|
|
|
del "%OUT_FILE%.zip"
|
2010-11-12 21:02:14 +01:00
|
|
|
REM ------------------------------------------
|
2010-11-11 00:25:23 +01:00
|
|
|
if exist "%OUT_FILE%.exe" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "FAILD TO DELET EXISTING FILE"
|
2010-11-11 00:25:23 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
if exist "%OUT_FILE%.zip" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "FAILD TO DELET EXISTING FILE"
|
2010-11-11 00:25:23 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
|
|
|
REM :: POST BUILD ::
|
|
|
|
REM ------------------------------------------
|
|
|
|
rd /S /Q "%TMP_PATH%"
|
|
|
|
mkdir "%TMP_PATH%"
|
|
|
|
copy "%OUT_PATH%\*.exe" "%TMP_PATH%"
|
2010-11-11 00:41:49 +01:00
|
|
|
REM ------------------------------------------
|
|
|
|
if "%LAMEXP_REDIST%"=="1" (
|
|
|
|
copy "%QTDIR%\bin\QtCore4.dll" "%TMP_PATH%"
|
|
|
|
copy "%QTDIR%\bin\QtGui4.dll" "%TMP_PATH%"
|
|
|
|
copy "%QTDIR%\bin\QtXml4.dll" "%TMP_PATH%"
|
|
|
|
copy "%QTDIR%\bin\QtSvg4.dll" "%TMP_PATH%"
|
2010-11-11 14:11:44 +01:00
|
|
|
mkdir "%TMP_PATH%\imageformats"
|
2010-11-11 00:41:49 +01:00
|
|
|
copy "%QTDIR%\plugins\imageformats\q???4.dll" "%TMP_PATH%\imageformats"
|
|
|
|
)
|
2010-11-11 00:25:23 +01:00
|
|
|
REM ------------------------------------------
|
2011-10-08 20:12:28 +02:00
|
|
|
if "%LAMEXP_SKIP_BUILD%"=="YES" (
|
|
|
|
goto SkipPackingThisTime
|
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
2010-11-11 00:25:23 +01:00
|
|
|
for %%f in ("%TMP_PATH%\*.exe") do (
|
2011-01-29 22:50:37 +01:00
|
|
|
"%PATH_UPXBIN%\upx.exe" --best "%%f"
|
2010-11-11 00:25:23 +01:00
|
|
|
)
|
|
|
|
for %%f in ("%TMP_PATH%\*.dll") do (
|
2011-01-29 22:50:37 +01:00
|
|
|
"%PATH_UPXBIN%\upx.exe" --best "%%f"
|
2010-11-11 00:25:23 +01:00
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
2011-10-08 20:12:28 +02:00
|
|
|
:SkipPackingThisTime
|
|
|
|
REM ------------------------------------------
|
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
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
2010-11-11 00:41:49 +01:00
|
|
|
if "%LAMEXP_REDIST%"=="1" (
|
|
|
|
copy "..\Redist\*.*" "%TMP_PATH%"
|
|
|
|
)
|
2011-04-19 16:21:19 +02:00
|
|
|
copy "%~dp0\..\..\ReadMe.txt" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\License.txt" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\doc\Changelog.html" "%TMP_PATH%"
|
|
|
|
copy "%~dp0\..\..\doc\Translate.html" "%TMP_PATH%"
|
2011-12-04 20:33:06 +01:00
|
|
|
copy "%~dp0\..\..\doc\Manual.html" "%TMP_PATH%"
|
2011-04-19 16:21:19 +02:00
|
|
|
copy "%~dp0\..\..\doc\FAQ.html" "%TMP_PATH%"
|
2010-11-11 00:25:23 +01:00
|
|
|
REM ------------------------------------------
|
|
|
|
REM :: CREATE PACKAGES ::
|
|
|
|
REM ------------------------------------------
|
|
|
|
"%PATH_SEVENZ%\7z.exe" a -tzip -r "%OUT_FILE%.zip" "%TMP_PATH%\*"
|
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"
|
2010-11-11 00:25:23 +01:00
|
|
|
rd /S /Q "%TMP_PATH%"
|
|
|
|
REM ------------------------------------------
|
|
|
|
if not exist "%OUT_FILE%.zip" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "PACKAGING HAS FAILED"
|
2010-11-11 00:25:23 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
if not exist "%OUT_FILE%.exe" (
|
2011-04-19 16:21:19 +02:00
|
|
|
call "%~dp0\_error.bat" "PACKAGING HAS FAILED"
|
2010-11-11 00:25:23 +01:00
|
|
|
GOTO:EOF
|
|
|
|
)
|
|
|
|
REM ------------------------------------------
|
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"
|
|
|
|
REM ------------------------------------------
|
2010-11-29 14:00:27 +01:00
|
|
|
REM :: CREATE SIGNATURE ::
|
|
|
|
REM ------------------------------------------
|
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"
|
|
|
|
REM ------------------------------------------
|
2010-11-11 00:25:23 +01:00
|
|
|
echo.
|
|
|
|
echo BUIDL COMPLETED SUCCESSFULLY :-)
|
|
|
|
echo.
|
|
|
|
REM ------------------------------------------
|
|
|
|
pause
|