Skip to content

Commit b4f94c2

Browse files
victoryforceTurboGit
authored andcommitted
Abandon versioned AppId, use different AppIds for release and non-release
1 parent 8bc1abb commit b4f94c2

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

packaging/windows/darktable.iss.in

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11

22
#define MyAppName "darktable"
33
#define MyAppVersion "${PROJECT_VERSION}"
4+
#define MyAppVersionLength Len(MyAppVersion)
45
#define MyAppCopyright "Copyright © 2009-2025 darktable developers"
56
#define MyAppPublisher "darktable team"
67
#define MyAppURL "https://darktable.org/"
78
#define MyAppExeName "darktable.exe"
89
#define MyAppCliExeName "darktable-cli.exe"
910

1011
[Setup]
11-
; The value of AppId uniquely identifies the application. We also realize that
12-
; some users install more than one darktable version (e.g. stable and nightly
13-
; snapshot), so having the app name plus version as the AppId makes sense.
14-
AppId={#MyAppName}{#MyAppVersion}
12+
; The value of AppId uniquely identifies the application. Some users install
13+
; both a darktable release and a development snapshot (as a daily driver and
14+
; for testing, respectively), so it makes sense to use the application name
15+
; along with the release/non-release discriminator as the AppId.
16+
AppId={#MyAppName}{code:SuffixIfNotRelease}
1517
AppName={#MyAppName}
1618
AppVersion={#MyAppVersion}
1719

@@ -25,7 +27,7 @@ AppPublisher={#MyAppPublisher}
2527
AppPublisherURL={#MyAppURL}
2628
AppSupportURL={#MyAppURL}
2729
AppUpdatesURL={#MyAppURL}
28-
DefaultDirName={autopf}\{#MyAppName}
30+
DefaultDirName={autopf}\{#MyAppName}{code:SuffixIfNotRelease}
2931
UninstallDisplayIcon={app}\bin\{#MyAppExeName}
3032

3133
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
@@ -39,7 +41,7 @@ ArchitecturesAllowed=x64compatible
3941
ArchitecturesInstallIn64BitMode=x64compatible
4042

4143
ChangesAssociations=yes
42-
DefaultGroupName={#MyAppName}
44+
DefaultGroupName={#MyAppName}{code:SuffixIfNotRelease}
4345
AllowNoIcons=yes
4446
LicenseFile=share\doc\darktable\LICENSE
4547

@@ -60,6 +62,14 @@ OutputBaseFilename=darktable-{#MyAppVersion}-${ARCH_STRING}-innosetup-experiment
6062
SolidCompression=yes
6163
WizardStyle=modern
6264

65+
; These parameters must be set to "no" if the AppId contains constants. We use
66+
; scripted constant to have different AppIds for release and nightly snapshot.
67+
; However, the behavior for "no" values seems logical, so these values are what
68+
; would make sense to set even if we weren't forced to.
69+
UsePreviousLanguage=no
70+
UsePreviousPrivileges=no
71+
72+
6373
[Tasks]
6474
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
6575

@@ -121,3 +131,16 @@ begin
121131
else
122132
Result := 'Environment'
123133
end;
134+
135+
function SuffixIfNotRelease(Param: String): String;
136+
begin
137+
(*
138+
The length of the release version string is 5, but let's add some safety
139+
margin (the major and minor numbers may become double digits someday),
140+
the git snapshot version is _much_ longer anyway.
141+
*)
142+
if {#MyAppVersionLength} > 7 then
143+
Result := '-dev'
144+
else
145+
Result := ''
146+
end;

0 commit comments

Comments
 (0)