Make deployment script more portable + update to Qt 4.7.1
This commit is contained in:
parent
c80714b829
commit
ccaa1ba8f5
@ -5,9 +5,12 @@ echo Solution File: %1
|
||||
echo Configuration: %~n2
|
||||
echo ----------------------------------------------------------------
|
||||
call _paths.bat
|
||||
call "%PATH_MSVC90%\VC\bin\vcvars32.bat"
|
||||
if not "%LAMEXP_ERROR%"=="0" GOTO:EOF
|
||||
REM -----------------------------------------------------------------
|
||||
call "%PATH_MSVC90%\VC\bin\vcvars32.bat" x86
|
||||
call "%PATH_QTMSVC%\bin\qtvars.bat"
|
||||
REM -----------------------------------------------------------------
|
||||
set "LAMEXP_ERROR=1"
|
||||
msbuild.exe /property:Configuration=%~n2 /target:Clean /verbosity:d %1
|
||||
if exist "%~d1%~p1bin\%~n2\*.exe" GOTO:EOF
|
||||
if exist "%~d1%~p1obj\%~n2\*.obj" GOTO:EOF
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo %~n1%~x1 !!!
|
||||
echo %~1 !!!
|
||||
echo.
|
||||
pause
|
||||
|
@ -1,7 +1,40 @@
|
||||
@echo off
|
||||
set "PATH_SEVENZ=E:\7-Zip\7z.exe"
|
||||
set "PATH_MPRESS=E:\MPress\mpress.exe"
|
||||
set "PATH_UPXBIN=E:\MPUI\installer\upx.exe"
|
||||
set "PATH_MKNSIS=E:\NSIS\makensis.exe"
|
||||
set "PATH_MSVC90=D:\Microsoft Visual Studio 9.0"
|
||||
set "PATH_QTMSVC=E:\Qt\MSVC\4.7.0"
|
||||
set "LAMEXP_ERROR=1"
|
||||
REM ------------------------------------------
|
||||
set "PATH_SEVENZ="
|
||||
set "PATH_MPRESS="
|
||||
set "PATH_UPXBIN="
|
||||
set "PATH_MKNSIS="
|
||||
set "PATH_MSVC90="
|
||||
set "PATH_QTMSVC="
|
||||
REM ------------------------------------------
|
||||
for /f "tokens=2,*" %%s in (buildenv.txt) do (
|
||||
if "%%s"=="PATH_SEVENZ" set "PATH_SEVENZ=%%~t"
|
||||
if "%%s"=="PATH_MPRESS" set "PATH_MPRESS=%%~t"
|
||||
if "%%s"=="PATH_UPXBIN" set "PATH_UPXBIN=%%~t"
|
||||
if "%%s"=="PATH_MKNSIS" set "PATH_MKNSIS=%%~t"
|
||||
if "%%s"=="PATH_MSVC90" set "PATH_MSVC90=%%~t"
|
||||
if "%%s"=="PATH_QTMSVC" set "PATH_QTMSVC=%%~t"
|
||||
)
|
||||
REM ------------------------------------------
|
||||
:: echo PATH_SEVENZ=%PATH_SEVENZ%
|
||||
:: echo PATH_MPRESS=%PATH_MPRESS%
|
||||
:: echo PATH_UPXBIN=%PATH_UPXBIN%
|
||||
:: echo PATH_MKNSIS=%PATH_MKNSIS%
|
||||
:: echo PATH_MSVC90=%PATH_MSVC90%
|
||||
:: echo PATH_QTMSVC=%PATH_QTMSVC%
|
||||
REM ------------------------------------------
|
||||
set "LAMEXP_ERROR=1"
|
||||
REM ------------------------------------------
|
||||
if not exist "%PATH_SEVENZ%\7z.exe" GOTO:EOF
|
||||
if not exist "%PATH_MPRESS%\mpress.exe" GOTO:EOF
|
||||
if not exist "%PATH_UPXBIN%\upx.exe" GOTO:EOF
|
||||
if not exist "%PATH_MKNSIS%\makensis.exe" GOTO:EOF
|
||||
if not exist "%PATH_MSVC90%\VC\vcvarsall.bat" GOTO:EOF
|
||||
if not exist "%PATH_MSVC90%\VC\bin\cl.exe" GOTO:EOF
|
||||
if not exist "%PATH_QTMSVC%\bin\qtvars.bat" GOTO:EOF
|
||||
if not exist "%PATH_QTMSVC%\bin\uic.exe" GOTO:EOF
|
||||
if not exist "%PATH_QTMSVC%\bin\moc.exe" GOTO:EOF
|
||||
if not exist "%PATH_QTMSVC%\bin\rcc.exe" GOTO:EOF
|
||||
REM ------------------------------------------
|
||||
set "LAMEXP_ERROR=0"
|
||||
|
@ -7,12 +7,12 @@ set "VER_LAMEXP_MINOR_LO="
|
||||
set "VER_LAMEXP_BUILD="
|
||||
set "VER_LAMEXP_SUFFIX="
|
||||
REM ------------------------------------------
|
||||
FOR /F "tokens=2,3" %%s IN (..\..\src\Resource.h) DO (
|
||||
if "%%s"=="VER_LAMEXP_MAJOR" set "VER_LAMEXP_MAJOR=%%t"
|
||||
if "%%s"=="VER_LAMEXP_MINOR_HI" set "VER_LAMEXP_MINOR_HI=%%t"
|
||||
if "%%s"=="VER_LAMEXP_MINOR_LO" set "VER_LAMEXP_MINOR_LO=%%t"
|
||||
if "%%s"=="VER_LAMEXP_BUILD" set "VER_LAMEXP_BUILD=%%t"
|
||||
if "%%s"=="VER_LAMEXP_SUFFIX" set "VER_LAMEXP_SUFFIX=%%t"
|
||||
for /f "tokens=2,*" %%s in (..\..\src\Config.h) do (
|
||||
if "%%s"=="VER_LAMEXP_MAJOR" set "VER_LAMEXP_MAJOR=%%~t"
|
||||
if "%%s"=="VER_LAMEXP_MINOR_HI" set "VER_LAMEXP_MINOR_HI=%%~t"
|
||||
if "%%s"=="VER_LAMEXP_MINOR_LO" set "VER_LAMEXP_MINOR_LO=%%~t"
|
||||
if "%%s"=="VER_LAMEXP_BUILD" set "VER_LAMEXP_BUILD=%%~t"
|
||||
if "%%s"=="VER_LAMEXP_SUFFIX" set "VER_LAMEXP_SUFFIX=%%~t"
|
||||
)
|
||||
REM ------------------------------------------
|
||||
set "LAMEXP_ERROR=1"
|
||||
|
6
etc/Deployment/buildenv.txt
Normal file
6
etc/Deployment/buildenv.txt
Normal file
@ -0,0 +1,6 @@
|
||||
#define PATH_SEVENZ "E:\7-Zip"
|
||||
#define PATH_MPRESS "E:\MPress"
|
||||
#define PATH_UPXBIN "E:\MPUI\installer"
|
||||
#define PATH_MKNSIS "E:\NSIS"
|
||||
#define PATH_MSVC90 "D:\Microsoft Visual Studio 9.0"
|
||||
#define PATH_QTMSVC "E:\Qt\MSVC\4.7.1"
|
@ -1,17 +1,28 @@
|
||||
@echo off
|
||||
REM ------------------------------------------
|
||||
REM :: SETUP PATHS ::
|
||||
REM ------------------------------------------
|
||||
call _paths.bat
|
||||
if not "%LAMEXP_ERROR%"=="0" (
|
||||
call _error.bat "FAILD TO SETUP PATHS. CHECK YOUR 'BUILDENV.TXT' FILE"
|
||||
GOTO:EOF
|
||||
)
|
||||
REM ------------------------------------------
|
||||
set "OUT_PATH=..\..\bin\Release"
|
||||
set "OUT_DATE=%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%"
|
||||
set "OUT_FILE=%OUT_PATH%\..\LameXP.%OUT_DATE%.Release"
|
||||
set "TMP_PATH=%TEMP%\~LameXP.%OUT_DATE%.tmp"
|
||||
REM ------------------------------------------
|
||||
REM :: READ VERSION INFO ::
|
||||
REM ------------------------------------------
|
||||
call _version.bat
|
||||
if not "%LAMEXP_ERROR%"=="0" (
|
||||
call _error.bat "FAILD TO READ VERSION INFO!"
|
||||
GOTO:EOF
|
||||
)
|
||||
REM ------------------------------------------
|
||||
REM :: CLEAN UP ::
|
||||
REM ------------------------------------------
|
||||
del "%OUT_FILE%.exe"
|
||||
del "%OUT_FILE%.zip"
|
||||
if exist "%OUT_FILE%.exe" (
|
||||
@ -23,12 +34,16 @@ if exist "%OUT_FILE%.zip" (
|
||||
GOTO:EOF
|
||||
)
|
||||
REM ------------------------------------------
|
||||
REM :: BUILD BINARIES ::
|
||||
REM ------------------------------------------
|
||||
call _build.bat "..\..\LameXP.sln" Release
|
||||
if not "%LAMEXP_ERROR%"=="0" (
|
||||
call _error.bat "BUILD HAS FAILED"
|
||||
GOTO:EOF
|
||||
)
|
||||
|
||||
REM ------------------------------------------
|
||||
REM :: POST BUILD ::
|
||||
REM ------------------------------------------
|
||||
rd /S /Q "%TMP_PATH%"
|
||||
mkdir "%TMP_PATH%"
|
||||
@ -42,17 +57,19 @@ copy "%QTDIR%\bin\QtSvg4.dll" "%TMP_PATH%"
|
||||
copy "%QTDIR%\plugins\imageformats\q???4.dll" "%TMP_PATH%\imageformats"
|
||||
REM ------------------------------------------
|
||||
for %%f in ("%TMP_PATH%\*.exe") do (
|
||||
"%PATH_UPXBIN%" --best --lzma "%%f"
|
||||
"%PATH_UPXBIN%\upx.exe" --best --lzma "%%f"
|
||||
)
|
||||
for %%f in ("%TMP_PATH%\*.dll") do (
|
||||
"%PATH_UPXBIN%" --best --lzma "%%f"
|
||||
"%PATH_UPXBIN%\upx.exe" --best --lzma "%%f"
|
||||
)
|
||||
REM ------------------------------------------
|
||||
copy "..\Redist\*.*" "%TMP_PATH%"
|
||||
copy "..\..\License.txt" "%TMP_PATH%"
|
||||
REM ------------------------------------------
|
||||
"%PATH_SEVENZ%" a -tzip -r "%OUT_FILE%.zip" "%TMP_PATH%\*"
|
||||
"%PATH_MKNSIS%" "/DLAMEXP_SOURCE_PATH=%TMP_PATH%" "/DLAMEXP_OUTPUT_FILE=%OUT_FILE%.exe" "/DLAMEXP_DATE=%OUT_DATE%" "/DLAMEXP_VERSION=%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%" "/DLAMEXP_BUILD=%VER_LAMEXP_BUILD%" "/DLAMEXP_SUFFIX=%VER_LAMEXP_SUFFIX%" "..\NSIS\setup.nsi"
|
||||
REM :: CREATE PACKAGES ::
|
||||
REM ------------------------------------------
|
||||
"%PATH_SEVENZ%\7z.exe" a -tzip -r "%OUT_FILE%.zip" "%TMP_PATH%\*"
|
||||
"%PATH_MKNSIS%\makensis.exe" "/DLAMEXP_SOURCE_PATH=%TMP_PATH%" "/DLAMEXP_OUTPUT_FILE=%OUT_FILE%.exe" "/DLAMEXP_DATE=%OUT_DATE%" "/DLAMEXP_VERSION=%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%" "/DLAMEXP_BUILD=%VER_LAMEXP_BUILD%" "/DLAMEXP_SUFFIX=%VER_LAMEXP_SUFFIX%" "..\NSIS\setup.nsi"
|
||||
rd /S /Q "%TMP_PATH%"
|
||||
REM ------------------------------------------
|
||||
if not exist "%OUT_FILE%.zip" (
|
||||
|
Loading…
Reference in New Issue
Block a user