From 8742eb35590f88f37fa38a9a443327f8a2e41e25 Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Thu, 16 Jan 2020 19:44:11 -0500 Subject: [PATCH] Update Windows deploy scripts for new version information. These changes should work. At least the awk script has been tested. --- Building/Windows/BuildInstall.iss | 9 +-------- Building/Windows/deploy.bat | 5 ++--- Building/Windows/getBuildInfo.awk | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Building/Windows/BuildInstall.iss b/Building/Windows/BuildInstall.iss index e94666ed..8a534c95 100644 --- a/Building/Windows/BuildInstall.iss +++ b/Building/Windows/BuildInstall.iss @@ -5,13 +5,6 @@ #include "buildinfo.iss" -#define MyAppVersion MyMajorVersion+"."+MyMinorVersion+"."+MyRevision+"-"+MyReleaseStatus -#if MyReleaseStatus == "r" - #define MyAppVersion MyAppVersion+MyBuildNumber -#else - #define MyAppVersion MyAppVersion+"-"+MyBuildNumber -#endif - #define MyAppPublisher "The OSCAR Team" #define MyAppExeName "OSCAR.exe" #define MyAppName "OSCAR" @@ -52,7 +45,7 @@ AppName={#MyAppName} AppVersion={#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix} AppVerName={#MyAppName} {#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix} AppPublisher={#MyAppPublisher} -AppCopyright=Copyright 2019 {#MyAppPublisher} +AppCopyright=Copyright 2019-2020 {#MyAppPublisher} ; **** AppCopyright=Copyright {GetDateTimeString('yyyy', #0, #0)} {%MyAppPublisher} DefaultDirName={pf}\{#MyDirName} DefaultGroupName={#MyGroupName} diff --git a/Building/Windows/deploy.bat b/Building/Windows/deploy.bat index 4fb3c590..28d8c9de 100644 --- a/Building/Windows/deploy.bat +++ b/Building/Windows/deploy.bat @@ -58,8 +58,7 @@ where /q gawk.exe || set PATH=%PATH%;%ProgramW6432%\Git\usr\bin ::: used by the installer script. where /q gawk.exe || set PATH=%PATH%;%ProgramW6432%\Git\usr\bin echo ; This script auto-generated by DEPLOY.BAT >%shadowBuildDir%\buildinfo.iss -gawk -f %toolDir%getBuildInfo.awk %sourcedir%\version.h >>%shadowBuildDir%\buildInfo.iss || exit 60 -gawk -f %toolDir%getBuildInfo.awk %sourcedir%\build_number.h >>%shadowBuildDir%\buildInfo.iss || exit 61 +gawk -f %toolDir%getBuildInfo.awk %sourcedir%\VERSION >>%shadowBuildDir%\buildInfo.iss || exit 60 gawk -f %toolDir%getBuildInfo.awk %sourcedir%\git_info.h >>%shadowBuildDir%\buildInfo.iss || exit 62 echo %shadowBuildDir% | gawk -f %toolDir%getBuildInfo.awk >>%shadowBuildDir%\buildInfo.iss || exit 63 echo #define MySuffix "%1" >>%shadowBuildDir%\buildinfo.iss || exit 64 @@ -96,4 +95,4 @@ if exist Translations\*.ts del /q Translations\*.ts ::: Create installer cd .. :::"%ProgramFiles(x86)%\Inno Setup 6\compil32" /cc BuildInstall.iss -"%ProgramFiles(x86)%\Inno Setup 6\iscc" /Q BuildInstall.iss \ No newline at end of file +"%ProgramFiles(x86)%\Inno Setup 6\iscc" /Q BuildInstall.iss diff --git a/Building/Windows/getBuildInfo.awk b/Building/Windows/getBuildInfo.awk index 7ede1ffb..b2c526dc 100644 --- a/Building/Windows/getBuildInfo.awk +++ b/Building/Windows/getBuildInfo.awk @@ -7,15 +7,23 @@ # gawk -f getBuildInfo.awk version.h >>buildInfo.iss # echo %cd% | gawk -f %sourcedir%getBuildInfo.awk >>buildInfo.iss -/ build_number / { print "#define MyBuildNumber \"" substr($5,1,length($5)-1) "\""} +/#define GIT_BRANCH / { print "#define MyGitBranch", $3 } +/#define GIT_REVISION / { print "#define MyGitRevision", $3 } +/#define GIT_TAG / { print "#define MyGitTag", $3 } -/const QString GIT_BRANCH/ { print "#define MyGitBranch \"" substr($3,13,length($3)-14) "\"" } -/const QString GIT_REVISION/ { print "#define MyGitRevision \"" substr($3,15,length($3)-16) "\"" } +/#define VERSION / { + version = $3 + print "#define MyAppVersion", version -/const int major_version / { print "#define MyMajorVersion \"" substr($5,1,length($5)-1) "\""} -/const int minor_version / { print "#define MyMinorVersion \"" substr($5,1,length($5)-1) "\""} -/const int revision_number / { print "#define MyRevision \"" substr($5,1,length($5)-1) "\""} -/const QString ReleaseStatus/ { print "#define MyReleaseStatus " substr($5,1,length($5)-1) } + split(version, v, "[\.\-]") + status = v[4] ? v[4] : "r" + print "#define MyReleaseStatus \"" status "\"" + + split("alpha beta rc r", parts, " ") + for (i=1; i <= length(parts); i++) dict[parts[i]]=i + build = dict[status] + print "#define MyBuildNumber \"" (build * 32) "\"" +} /32.*bit/ { print "#define MyPlatform \"Win32\"" } /64.*bit/ { print "#define MyPlatform \"Win64\"" }