[gimp-help] build: handle differences between development and stable versions.



commit e6060bbe94d597868de347e72cfecb0cf1fe28d1
Author: Jehan <jehan girinstud io>
Date:   Mon Mar 21 21:38:00 2022 +0100

    build: handle differences between development and stable versions.
    
    It seems that:
    - The registry key only contains the major version for stable GIMP, but
      major.minor for development builds. This commit should fix the dev
      gimp-help installer not finding installed 2.99.x GIMP.
    - The version directory is major.minor for dev and major.0 for stable.

 build/windows/installer/gimp-help.iss | 10 ++++++++--
 build/windows/installer/version.isi   | 17 +++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/build/windows/installer/gimp-help.iss b/build/windows/installer/gimp-help.iss
index e81e77e3a..5c216d50c 100644
--- a/build/windows/installer/gimp-help.iss
+++ b/build/windows/installer/gimp-help.iss
@@ -44,6 +44,8 @@
 #define VERSION MAJORVERSION + '.' + MINORVERSION + '.' + MICROVERSION
 #define MIN_VERSION MAJORVERSION + '.' + MINORVERSION
 
+#include "version.isi"
+
 ;for picking up the correct Inno Setup language file
 #if LANG=='en'
        #define LANGFILE='Default.isl'
@@ -139,7 +141,7 @@ Name: "{#LANG}"; MessagesFile: "compiler:{#LANGFILE},lang\help.en.isl,lang\help.
 
 [Files]
 #ifndef nofiles
-Source: "{#HELPDIR}\{#LANG}\*.*"; DestDir: "{app}\share\gimp\{#MAJORVERSION}.{#MINORVERSION}\help\{#LANG}"; 
Flags: recursesubdirs ignoreversion
+Source: "{#HELPDIR}\{#LANG}\*.*"; DestDir: "{app}\share\gimp\{#DIR_VER}\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
@@ -161,7 +163,11 @@ const
 
        BCM_SETSHIELD = $160C;
 
-       RegGimpUnins = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GIMP-2_is1';
+#if Defined(DEVEL) && DEVEL != ""
+       RegGimpUnins = 
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GIMP-{#MAJORVERSION}.{#MINORVERSION}_is1';
+#else
+       RegGimpUnins = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GIMP-{#MAJORVERSION}_is1';
+#endif
        RegGimpUninsPathKey = 'Inno Setup: App Path';
        RegGimpUninsDispVerKey = 'DisplayVersion';
 
diff --git a/build/windows/installer/version.isi b/build/windows/installer/version.isi
new file mode 100644
index 000000000..e7c376aba
--- /dev/null
+++ b/build/windows/installer/version.isi
@@ -0,0 +1,17 @@
+//set the version string
+
+#define public
+
+#if !Defined(VERSION)
+  #error "VERSION must be defined"
+#endif
+
+#define public
+
+#if Int(MINORVERSION) % 2 == 1
+ #define DEVEL="-dev"
+ #define DIR_VER=MAJORVERSION + "." + MINORVERSION
+#else
+ #define DEVEL=""
+ #define DIR_VER=MAJORVERSION + ".0"
+#endif


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