Skip to content

Commit 5a6c820

Browse files
authored
Merge pull request #19293 from victoryforce/innosetup
Add support for creating a Windows installer using Inno Setup
2 parents 5f0131d + 38d091b commit 5a6c820

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

cmake/darktable-packaging.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ endif(UNIX)
4545

4646
# Set package peoperties for Windows
4747
if(WIN32)
48+
# we want an arch string to distinguish installer artifact filenames
49+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(X86|x86)|(^i.86$)")
50+
set(ARCH_STRING "win64")
51+
else()
52+
set(ARCH_STRING "woa64")
53+
endif()
54+
55+
# add darktable association with all supported image file types for Inno Setup
56+
foreach(EXTENSION ${DT_SUPPORTED_EXTENSIONS})
57+
SET(CMAKE_ADD_DARKTABLE_TO_OPENWITHLIST "${CMAKE_ADD_DARKTABLE_TO_OPENWITHLIST}
58+
Root:HKA; Subkey: \"Software\\Classes\\.${EXTENSION}\\OpenWithList\\darktable.exe\"; Flags: uninsdeletekey
59+
")
60+
endforeach(EXTENSION)
61+
62+
configure_file(
63+
${CMAKE_SOURCE_DIR}/packaging/windows/darktable.iss.in
64+
${CMAKE_BINARY_DIR}/darktable.iss
65+
)
66+
4867
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64")
4968
# CPack currently sets this to "win64" regardless of architecture
5069
set(CPACK_SYSTEM_NAME woa64)

packaging/windows/darktable.iss.in

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
#define MyAppName "darktable"
3+
#define MyAppVersion "${PROJECT_VERSION}"
4+
#define MyAppCopyright "Copyright © 2009-2025 darktable developers"
5+
#define MyAppPublisher "darktable team"
6+
#define MyAppURL "https://darktable.org/"
7+
#define MyAppExeName "darktable.exe"
8+
#define MyAppCliExeName "darktable-cli.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{D6A9DE72-A18F-4051-85A9-D8DF95F71D80}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
AppCopyright={#MyAppCopyright}
17+
AppPublisher={#MyAppPublisher}
18+
AppPublisherURL={#MyAppURL}
19+
AppSupportURL={#MyAppURL}
20+
AppUpdatesURL={#MyAppURL}
21+
DefaultDirName={autopf}\{#MyAppName}
22+
UninstallDisplayIcon={uninstallexe}
23+
24+
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
25+
; on anything but x64 and Windows 11 on Arm.
26+
ArchitecturesAllowed=x64compatible
27+
28+
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
29+
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
30+
; meaning it should use the native 64-bit Program Files directory and
31+
; the 64-bit view of the registry.
32+
ArchitecturesInstallIn64BitMode=x64compatible
33+
34+
ChangesAssociations=yes
35+
DefaultGroupName={#MyAppName}
36+
AllowNoIcons=yes
37+
LicenseFile=share\doc\darktable\LICENSE
38+
39+
; Uncomment the following line to run in non administrative install mode (install for current user only).
40+
;PrivilegesRequired=lowest
41+
42+
PrivilegesRequiredOverridesAllowed=dialog
43+
OutputBaseFilename=darktable-{#MyAppVersion}-${ARCH_STRING}
44+
45+
; When this directive is set, the compiler will create a manifest file detailing information about the files compiled into Setup. The file will be created in the output directory unless a path is included.
46+
OutputManifestFile=darktable-manifest.txt
47+
48+
SolidCompression=yes
49+
WizardStyle=modern
50+
51+
[Tasks]
52+
; Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
53+
54+
[Files]
55+
; Source: "bin\{#MyAppExeName}"; DestDir: "{app}\bin"; Flags: ignoreversion
56+
Source: "bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs createallsubdirs
57+
Source: "lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
58+
Source: "share\*"; DestDir: "{app}\share"; Flags: ignoreversion recursesubdirs createallsubdirs
59+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
60+
61+
[Registry]
62+
${CMAKE_ADD_DARKTABLE_TO_OPENWITHLIST}
63+
64+
[Icons]
65+
Name: "{group}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"
66+
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
67+
; Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"; Tasks: desktopicon
68+
69+
[Run]
70+
Filename: "{app}\bin\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

0 commit comments

Comments
 (0)