[gimp-help/wip/Jehan/ci-2-10-split: 1/3] build: various fixes to the InnoSetup scripts for CI.




commit 1f09e1f5c0fb1aef7ba781ad03b1520049b09edf
Author: Jehan <jehan girinstud io>
Date:   Thu Mar 17 00:03:51 2022 +0100

    build: various fixes to the InnoSetup scripts for CI.
    
    In the bat file:
    
    - Detect InnoSetup's path in the registry as we do in GIMP's CI.
    - fix Windows syntax: not sure why but various commands don't seem to
      work anymore. Or maybe these were for another shell syntax?
    - Don't use the START command: apparently it's to run in
      parallel/background commands. While it seems interesting for faster
      builds, it also requires for the CI to be able to wait for all scripts
      to finish and I don't see how to do this in this command's manual (+ I
      don't want to spend too much time searching as I cannot even test
      locally!).
    
    In the iss file:
    
    - Disable "Signed uninstaller mode".
    - rename the output file to avoid duplicate major version.
    - Use autopf instead of pf to fix:
    
    > Warning: Constant "pf" has been renamed. Use "commonpf" instead or consider using its "auto" form.
    
    - Remove WizardImageBackColor to fix:
    
    > Warning: The [Setup] section directive "WizardImageBackColor" is obsolete and ignored in this version 
of Inno Setup.
    
    - Add all the languages directly, like we do for GIMP's installer
      because InnoSetup don't seem to see the LANGUAGE inside an #if macro,
      cf. errors when running the .iss with iscc.exe:
    
    > Undeclared identifier: LANGUAGE.
    
      Note that currently all languages use the help.en.isl, which obviously
      makes no sense, but it will be fixed when we'll generate localized
      versions as we did for GIMP installer.
    
    - Source dir replaced by new HELPDIR macro set by the build.bat script.

 build/windows/installer/build.bat     | 24 ++++++++++++++++---
 build/windows/installer/gimp-help.iss | 44 +++++++++++++++++++++++------------
 2 files changed, 50 insertions(+), 18 deletions(-)
---
diff --git a/build/windows/installer/build.bat b/build/windows/installer/build.bat
index ba57d0675..5f9e122ec 100644
--- a/build/windows/installer/build.bat
+++ b/build/windows/installer/build.bat
@@ -1,11 +1,29 @@
 @echo off
 if "%1"=="" goto help
-for /a:d %l in (N:\gimp\output\2.10.12\x86_64-w64-mingw32\share\gimp\2.0\help\*) if not 
"%l"=="N:\gimp\output\2.10.12\x86_64-w64-mingw32\share\gimp\2.0\help\." .and. not 
"%l"=="N:\gimp\output\2.10.12\x86_64-w64-mingw32\share\gimp\2.0\help\.." (
-       echo %@name[%l]
-       start "" /LOW "D:\Program Files\Inno Setup 6 Dev\iscc.exe" "Gimp - Help.iss" /DVERSION="%1" 
/DLANG="%@name[%l]"
+
+if [%INNOPATH%]==[] (
+FOR /F "usebackq tokens=5,* skip=2" %%A IN (`REG QUERY 
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1" /v "Inno Setup: App 
Path" /reg:32`) DO set INNOPATH=%%B
+) else (if [%INNOPATH%]==[] (
+FOR /F "usebackq tokens=5,* skip=2" %%A IN (`REG QUERY 
"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1" /v "Inno Setup: App Path" 
/reg:32`) DO set INNOPATH=%%B
+))
+if not exist "%INNOPATH%\iscc.exe" goto noinno
+
+echo "%INNOPATH%"
+FOR /D %%l in (..\..\..\htdocs\2.10\*) DO if not "%l"=="..\..\..\htdocs\2.10\." (
+    if not "%l"=="..\..\..\htdocs\2.10\.." (
+            echo Creating installer for %%~nxl
+            "%INNOPATH%\iscc.exe" "gimp-help.iss" /DVERSION="%1" /DLANG="%%~nxl" 
/DHELPDIR="..\..\..\htdocs\2.10"
+    )
 )
 goto end
+
 :help
 echo Usage: %0 version
 goto end
+
+:noinno
+echo Inno Setup path could not be read from Registry - install Inno Setup or set INNOPATH environment 
variable pointing at it's
+echo install directory
+goto :end
+
 :end
diff --git a/build/windows/installer/gimp-help.iss b/build/windows/installer/gimp-help.iss
index 76b3bbaef..3bcdee9ce 100644
--- a/build/windows/installer/gimp-help.iss
+++ b/build/windows/installer/gimp-help.iss
@@ -94,6 +94,7 @@
 #elif LANG=='zh_CN'
        #define LANGUAGE='ChineseSimplified'
 #endif
+
 [Setup]
 AppName={cm:GimpHelp} {#VERSION}
 AppID=GIMP-Help-2
@@ -101,13 +102,12 @@ AppVerName=GIMP Help {#VERSION}
 AppPublisherURL=https://www.gimp.org/
 AppSupportURL=https://www.gimp.org/
 AppUpdatesURL=https://www.gimp.org/
-DefaultDirName={pf}\GIMP Help 2
+DefaultDirName={autopf}\GIMP Help 2
 DirExistsWarning=no
 DisableProgramGroupPage=yes
 DisableDirPage=yes
 FlatComponentsList=yes
 WizardImageFile=big.bmp
-WizardImageBackColor=$ffffff
 WizardSmallImageFile=small.bmp
 WizardImageStretch=no
 CreateUninstallRegKey=no
@@ -125,27 +125,41 @@ OutputDir=_Output
 Compression=lzma/ultra
 InternalCompressLevel=ultra
 SolidCompression=yes
-OutputBaseFilename=gimp-help-2-{#VERSION}-{#LANG}-setup
+OutputBaseFilename=gimp-help-{#VERSION}-{#LANG}-setup
 #endif
-SignedUninstaller=yes
-SignedUninstallerDir=_Uninst
+;SignedUninstaller=yes
+;SignedUninstallerDir=_Uninst
 PrivilegesRequired=lowest
 PrivilegesRequiredOverridesAllowed=commandline
 
 [Languages]
-#if FileExists('D:\Program Files\Inno Setup 6 Dev\Languages\' + LANGUAGE + '.isl')
-       #if FileExists('help.'+LANG+'.isl')
-Name: "{#LANG}"; MessagesFile: 
"compiler:Languages\{#LANGUAGE}.isl,N:\gimp\compile\gimp\build\windows\installer\lang\en.setup.isl,N:\gimp\compile\gimp\build\windows\installer\lang\{#LANG}.setup.isl"
-       #else
-Name: "{#LANG}"; MessagesFile: 
"compiler:Languages\{#LANGUAGE}.isl,N:\gimp\compile\gimp\build\windows\installer\lang\en.setup.isl"
-       #endif
-#else
-Name: "en"; MessagesFile: 
"compiler:Default.isl,N:\gimp\compile\gimp\build\windows\installer\lang\en.setup.isl"
-#endif
+Name: "en"; MessagesFile: "compiler:Default.isl,lang\help.en.isl"
+Name: "ca"; MessagesFile: "compiler:Languages\Catalan.isl,lang\help.en.isl"
+Name: "cs"; MessagesFile: "compiler:Languages\Czech.isl,lang\help.en.isl"
+Name: "da"; MessagesFile: "compiler:Languages\Danish.isl,lang\help.en.isl"
+Name: "de"; MessagesFile: "compiler:Languages\German.isl,lang\help.en.isl"
+Name: "el"; MessagesFile: "compiler:Languages\Unofficial\Greek.isl,lang\help.en.isl"
+Name: "en_GB"; MessagesFile: "compiler:Languages\Unofficial\EnglishBritish.isl,lang\help.en.isl"
+Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl,lang\help.en.isl"
+Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl,lang\help.en.isl"
+Name: "fr"; MessagesFile: "compiler:Languages\French.isl,lang\help.en.isl"
+Name: "hr"; MessagesFile: "compiler:Languages\Unofficial\Croatian.isl,lang\help.en.isl"
+Name: "it"; MessagesFile: "compiler:Languages\Italian.isl,lang\help.en.isl"
+Name: "ja"; MessagesFile: "compiler:Languages\Japanese.isl,lang\help.en.isl"
+Name: "ko"; MessagesFile: "compiler:Languages\Unofficial\Korean.isl,lang\help.en.isl"
+Name: "lt"; MessagesFile: "compiler:Languages\Unofficial\Lithuanian.isl,lang\help.en.isl"
+Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl,lang\help.en.isl"
+Name: "nn"; MessagesFile: "compiler:Languages\Unofficial\NorwegianNynorsk.isl,lang\help.en.isl"
+Name: "pt_BR"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl,lang\help.en.isl"
+Name: "ro"; MessagesFile: "compiler:Languages\Unofficial\Romanian.isl,lang\help.en.isl"
+Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl,lang\help.en.isl"
+Name: "sl"; MessagesFile: "compiler:Languages\Slovenian.isl,lang\help.en.isl"
+Name: "sv"; MessagesFile: "compiler:Languages\Unofficial\Swedish.isl,lang\help.en.isl"
+Name: "zh_CN"; MessagesFile: "compiler:Languages\Unofficial\ChineseSimplified.isl,lang\help.en.isl"
 
 [Files]
 #ifndef nofiles
-Source: "N:\gimp\output\2.10.12\x86_64-w64-mingw32\share\gimp\2.0\help\{#LANG}\*.*"; DestDir: 
"{app}\share\gimp\2.0\help\{#LANG}"; Flags: recursesubdirs ignoreversion
+Source: "{#HELPDIR}\{#LANG}\*.*"; DestDir: "{app}\share\gimp\2.0\help\{#LANG}"; Flags: recursesubdirs 
ignoreversion
 #endif
 ;Source: "html\{#LANG}\*.jpg"; DestDir: "{app}\share\gimp\2.0\help\{#LANG}"; Flags: recursesubdirs 
nocompression
 ;Source: "html\{#LANG}\*.png"; DestDir: "{app}\share\gimp\2.0\help\{#LANG}"; Flags: recursesubdirs 
nocompression


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]