From f16cdc0c80ac66abffacda1be6855260146e88ce Mon Sep 17 00:00:00 2001 From: otto Date: Fri, 13 Mar 2015 14:51:49 +0100 Subject: [PATCH] Windows release build: try to simplify this spaghetti code --- build_release_windows.bat | 69 ++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/build_release_windows.bat b/build_release_windows.bat index de52743..c256fff 100755 --- a/build_release_windows.bat +++ b/build_release_windows.bat @@ -91,47 +91,50 @@ REM 1) FlightGear release: with fgdata, output filename would be "FlightGear-x.x REM 2) FlightGear nightly: with fgdata, output filename would be "FlightGear-x.x.x-nightly-full.exe" REM 3) FlightGear nightly: without fgdata, output filename would be "FlightGear-x.x.x-nightly.exe" +IF "%IS_NIGHTLY_BUILD%" EQU 1 ( + REM Case 2) + CALL :writeBaseConfig + CALL :writeNightlyFullConfig + iscc FlightGear.iss -REM for case 1) -SET "FG_DETAILS=" + REM Case 3) + CALL :writeBaseConfig + CALL :writeNightlyDietConfig + iscc FlightGear.iss -ECHO "%IS_NIGHTLY_BUILD%" + GOTO End +)ELSE( + REM Case 1) + CALL :writeBaseConfig + CALL :writeReleaseConfig + iscc FlightGear.iss -IF "%IS_NIGHTLY_BUILD%"=="TRUE" ( - REM only for case 2) - SET "FG_DETAILS=-nightly-full" + GOTO End ) -ECHO "%FG_DETAILS%" - +:writeBaseConfig ECHO #define FGVersion "%FLIGHTGEAR_VERSION%" > InstallConfig.iss -ECHO #define FGDetails "%FG_DETAILS%" >> InstallConfig.iss +ECHO #define OSGVersion "%OSG_VERSION%" >> InstallConfig.iss +ECHO #define OSGSoNumber "%OSG_SO_NUMBER%" >> InstallConfig.iss +ECHO #define OTSoNumber "%OT_SO_NUMBER%" >> InstallConfig.iss +GOTO End + +:writeReleaseConfig +CALL :writeBaseConfig +ECHO #define FGDetails "" >> InstallConfig.iss ECHO #define IncludeData "TRUE" >> InstallConfig.iss -ECHO #define OSGVersion "%OSG_VERSION%" >> InstallConfig.iss -ECHO #define OSGSoNumber "%OSG_SO_NUMBER%" >> InstallConfig.iss -ECHO #define OTSoNumber "%OT_SO_NUMBER%" >> InstallConfig.iss +GOTO End -REM run Inno-setup for case 1) and 2) -REM use iscc instead of compil32 for better error reporting -iscc FlightGear.iss +:writeNightlyFullConfig +CALL :writeBaseConfig +ECHO #define FGDetails "-nightly-full" >> InstallConfig.iss +ECHO #define IncludeData "TRUE" >> InstallConfig.iss +GOTO End - -REM only for case 3) -IF "%IS_NIGHTLY_BUILD%"!="TRUE" ( - GOTO end -) - -SET "FG_DETAILS=-nightly" -ECHO "%FG_DETAILS%" - -ECHO #define FGVersion "%FLIGHTGEAR_VERSION%" > InstallConfig.iss -ECHO #define FGDetails "%FG_DETAILS%" >> InstallConfig.iss +:writeNightlyDietConfig +CALL :writeBaseConfig +ECHO #define FGDetails "-nightly" >> InstallConfig.iss ECHO #define IncludeData "FALSE" >> InstallConfig.iss -ECHO #define OSGVersion "%OSG_VERSION%" >> InstallConfig.iss -ECHO #define OSGSoNumber "%OSG_SO_NUMBER%" >> InstallConfig.iss -ECHO #define OTSoNumber "%OT_SO_NUMBER%" >> InstallConfig.iss - -iscc FlightGear.iss - -:end +GOTO End +:End