2 setlocal ENABLEDELAYEDEXPANSION
3 REM ------------------------------------------
4 REM :: SETUP ENVIRONMENT ::
5 REM ------------------------------------------
6 call "%~dp0\_paths.bat"
7 if not "%LAMEXP_ERROR%"=="0" (
8 call "%~dp0\_error.bat" "FAILD TO SETUP PATHS. CHECK YOUR 'BUILDENV.TXT' FILE"
11 REM ------------------------------------------
12 if "%LAMEXP_CONFIG%"=="" (
13 set "LAMEXP_CONFIG=Release"
15 if not "%LAMEXP_REDIST%"=="0" (
18 REM ------------------------------------------
19 REM :: SETUP BUILD DATE ::
20 REM ------------------------------------------
21 call "%~dp0\_date.bat"
22 if not "%LAMEXP_ERROR%"=="0" (
23 call "%~dp0\_error.bat" "FAILD TO SETUP BUILD-DATE"
26 REM ------------------------------------------
28 REM ------------------------------------------
29 set "OUT_PATH=%~dp0\..\..\bin\%LAMEXP_CONFIG%"
30 set "TMP_PATH=%TEMP%\~LameXP.%LAMEXP_CONFIG%.%ISO_DATE%.%RANDOM%.tmp"
31 set "OBJ_PATH=%~dp0\..\..\obj\%LAMEXP_CONFIG%"
32 set "MOC_PATH=%~dp0\..\..\tmp"
33 set "IPC_PATH=%~dp0\..\..\ipch"
34 REM ------------------------------------------
35 if "%LAMEXP_SKIP_BUILD%"=="YES" (
36 goto SkipBuildThisTime
38 REM ------------------------------------------
40 REM ------------------------------------------
41 del /Q "%OUT_PATH%\*.exe"
42 del /Q "%OUT_PATH%\*.dll"
43 del /Q "%OBJ_PATH%\*.obj"
44 del /Q "%OBJ_PATH%\*.res"
45 del /Q "%OBJ_PATH%\*.bat"
46 del /Q "%OBJ_PATH%\*.idb"
47 del /Q "%OBJ_PATH%\*.log"
48 del /Q "%OBJ_PATH%\*.manifest"
49 del /Q "%OBJ_PATH%\*.lastbuildstate"
50 del /Q "%OBJ_PATH%\*.htm"
51 del /Q "%OBJ_PATH%\*.dep"
52 del /Q "%MOC_PATH%\*.cpp"
53 del /Q "%MOC_PATH%\*.h"
54 del /Q /S "%IPC_PATH%\*.*"
55 REM ------------------------------------------
56 REM :: BUILD BINARIES ::
57 REM ------------------------------------------
58 call "%~dp0\_lupdate.bat"
59 call "%~dp0\_build.bat" "%~dp0\..\..\%PATH_VCPROJ%" "%LAMEXP_CONFIG%"
60 if not "%LAMEXP_ERROR%"=="0" (
61 call "%~dp0\_error.bat" "BUILD HAS FAILED"
64 REM ------------------------------------------
66 REM ------------------------------------------
67 REM :: READ VERSION INFO ::
68 REM ------------------------------------------
69 call "%~dp0\_version.bat"
70 if not "%LAMEXP_ERROR%"=="0" (
71 call "%~dp0\_error.bat" "FAILD TO READ VERSION INFO!"
74 REM ------------------------------------------
75 set "OUT_FILE=%OUT_PATH%\..\LameXP.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%"
76 for /L %%n in (1, 1, 99) do (
77 if exist "!OUT_FILE!.exe" set "OUT_FILE=%OUT_PATH%\..\LameXP.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%.Update-%%n"
78 if exist "!OUT_FILE!.zip" set "OUT_FILE=%OUT_PATH%\..\LameXP.%ISO_DATE%.%LAMEXP_CONFIG:_=-%.Build-%VER_LAMEXP_BUILD%.Update-%%n"
80 REM ------------------------------------------
81 REM :: DELETE OLD OUTPUT FILE ::
82 REM ------------------------------------------
86 REM ------------------------------------------
87 if exist "%OUT_FILE%.exe" (
88 call "%~dp0\_error.bat" "FAILD TO DELET EXISTING FILE"
91 if exist "%OUT_FILE%.zip" (
92 call "%~dp0\_error.bat" "FAILD TO DELET EXISTING FILE"
95 REM ------------------------------------------
97 REM ------------------------------------------
100 copy "%OUT_PATH%\*.exe" "%TMP_PATH%"
101 REM ------------------------------------------
102 if "%LAMEXP_REDIST%"=="1" (
103 copy "%QTDIR%\bin\QtCore4.dll" "%TMP_PATH%"
104 copy "%QTDIR%\bin\QtGui4.dll" "%TMP_PATH%"
105 copy "%QTDIR%\bin\QtXml4.dll" "%TMP_PATH%"
106 copy "%QTDIR%\bin\QtSvg4.dll" "%TMP_PATH%"
107 mkdir "%TMP_PATH%\imageformats"
108 copy "%QTDIR%\plugins\imageformats\q???4.dll" "%TMP_PATH%\imageformats"
110 REM ------------------------------------------
111 if "%LAMEXP_SKIP_BUILD%"=="YES" (
112 goto SkipPackingThisTime
114 REM ------------------------------------------
115 for %%f in ("%TMP_PATH%\*.exe") do (
116 "%PATH_UPXBIN%\upx.exe" --best "%%f"
118 for %%f in ("%TMP_PATH%\*.dll") do (
119 "%PATH_UPXBIN%\upx.exe" --best "%%f"
121 REM ------------------------------------------
123 REM ------------------------------------------
124 if exist "%~dp0\_postproc.bat" (
125 call "%~dp0\_postproc.bat" "%TMP_PATH%"
127 REM ------------------------------------------
128 if "%LAMEXP_REDIST%"=="1" (
129 copy "..\Redist\*.*" "%TMP_PATH%"
131 copy "%~dp0\..\..\ReadMe.txt" "%TMP_PATH%"
132 copy "%~dp0\..\..\License.txt" "%TMP_PATH%"
133 copy "%~dp0\..\..\Copying.txt" "%TMP_PATH%"
134 copy "%~dp0\..\..\doc\Changelog.html" "%TMP_PATH%"
135 copy "%~dp0\..\..\doc\Translate.html" "%TMP_PATH%"
136 copy "%~dp0\..\..\doc\Manual.html" "%TMP_PATH%"
137 copy "%~dp0\..\..\doc\FAQ.html" "%TMP_PATH%"
138 REM ------------------------------------------
139 REM :: CREATE PACKAGES ::
140 REM ------------------------------------------
141 "%PATH_SEVENZ%\7z.exe" a -tzip -r "%OUT_FILE%.zip" "%TMP_PATH%\*"
142 "%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"
143 "%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"
144 rd /S /Q "%TMP_PATH%"
145 REM ------------------------------------------
146 if not exist "%OUT_FILE%.zip" (
147 call "%~dp0\_error.bat" "PACKAGING HAS FAILED"
150 if not exist "%OUT_FILE%.exe" (
151 call "%~dp0\_error.bat" "PACKAGING HAS FAILED"
154 REM ------------------------------------------
155 attrib +R "%OUT_FILE%.zip"
156 attrib +R "%OUT_FILE%.sfx"
157 attrib +R "%OUT_FILE%.exe"
158 REM ------------------------------------------
159 REM :: CREATE SIGNATURE ::
160 REM ------------------------------------------
161 "%PATH_GNUPG1%\gpg.exe" --detach-sign "%OUT_FILE%.exe"
162 attrib +R "%OUT_FILE%.exe.sig"
163 REM ------------------------------------------
165 echo BUIDL COMPLETED SUCCESSFULLY :-)
167 REM ------------------------------------------