From 1473a52704c6e94132c1d81cab306bb7e8b8a133 Mon Sep 17 00:00:00 2001 From: Bruno Date: Sun, 16 Feb 2025 18:12:39 -0300 Subject: [PATCH] build/windows: Do revisioning stuff with Inno scripting Also, fixes CUSTOM_GIMP_VERSION format. --- build/windows/installer/3_dist-gimp-inno.ps1 | 7 +------ build/windows/installer/base_gimp3264.iss | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/build/windows/installer/3_dist-gimp-inno.ps1 b/build/windows/installer/3_dist-gimp-inno.ps1 index b95350963e..cc6081f68e 100644 --- a/build/windows/installer/3_dist-gimp-inno.ps1 +++ b/build/windows/installer/3_dist-gimp-inno.ps1 @@ -77,7 +77,7 @@ if ($revision -notmatch '[1-9]' -or $CI_PIPELINE_SOURCE -eq 'schedule') } else { - $CUSTOM_GIMP_VERSION = "$CUSTOM_GIMP_VERSION.$revision" + $CUSTOM_GIMP_VERSION = "$CUSTOM_GIMP_VERSION-$revision" } Write-Output "(INFO): GIMP version: $CUSTOM_GIMP_VERSION" @@ -201,11 +201,6 @@ foreach ($bundle in $supported_archs) $gimp_api_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_PKGCONFIG_VERSION' | Foreach-Object {$_ -replace '#define GIMP_PKGCONFIG_VERSION "',''} | Foreach-Object {$_ -replace '"',''} - ## GIMP revision on about dialog (this does the same as '-Drevision' build option) - ## FIXME: This should be done with Inno scripting - (Get-Content "$bundle\share\gimp\*\gimp-release") | Foreach-Object {$_ -replace "revision=0","revision=$revision"} | - Set-Content "$bundle\share\gimp\*\gimp-release" - ## Split .debug symbols if ("$bundle" -eq "$GIMP32") { diff --git a/build/windows/installer/base_gimp3264.iss b/build/windows/installer/base_gimp3264.iss index 2e63992858..f5f4f97371 100644 --- a/build/windows/installer/base_gimp3264.iss +++ b/build/windows/installer/base_gimp3264.iss @@ -1528,7 +1528,7 @@ end; //PrepareInterp //Create .env files procedure PrepareGimpEnvironment(); -var EnvFile,Env: String; +var EnvFile,Env,sTemp: String; begin StatusLabel(CustomMessage('SettingUpEnvironment'),''); @@ -1554,6 +1554,20 @@ begin SuppressibleMsgBox(FmtMessage(CustomMessage('ErrorChangingEnviron'),[EnvFile]),mbInformation,mb_ok,IDOK); end; + // Set revision + EnvFile := ExpandConstant('{app}\share\gimp\{#GIMP_API_VERSION}\gimp-release'); + DebugMsg('SetRevision','Seting revision number {#REVISION} in ' + EnvFile); + + //LoadStringFromUTF8File(EnvFile,Env); + //sTemp := Replace('=0','={#REVISION}',Env); + sTemp := 'revision={#REVISION}' + #10; + + if not SaveStringToUTF8File(EnvFile,sTemp,False) then + begin + DebugMsg('PrepareGimpEnvironment','Problem seting revision'); + SuppressibleMsgBox(FmtMessage(CustomMessage('ErrorChangingEnviron'),[EnvFile]),mbInformation,mb_ok,IDOK); + end; + // Disable check-update when run with specific option if ExpandConstant('{param:disablecheckupdate|false}') = 'true' then begin