-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultideck.iss
More file actions
274 lines (238 loc) · 7.59 KB
/
multideck.iss
File metadata and controls
274 lines (238 loc) · 7.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
; MultiDeck Audio Player - InnoSetup Installer Script
; Requires Inno Setup 6.x
#define AppName "MultiDeck Audio Player"
#define AppVersion "0.7.0"
#define AppPublisher "Steffen Schultz"
#define AppExeName "MultiDeck.exe"
#define AppCliName "multideck-cli.exe"
#define SourceDir "dist\MultiDeck"
[Setup]
AppId={{A3F2B1C4-9D7E-4F8A-B2C3-D1E5F6A7B8C9}
AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL=https://m45.dev
AppSupportURL=https://github.com/schulle4u/multideck/issues
AppUpdatesURL=https://github.com/schulle4u/multideck/releases
LicenseFile={#SourceDir}\LICENSE
; 64-bit only
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
; Allow user to choose between all-users and current-user install
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
; Install paths depending on install mode
DefaultDirName={autopf}\MultiDeck Audio Player
DefaultGroupName={#AppName}
; Installer output
OutputDir=dist
OutputBaseFilename=multideck_win64_{#AppVersion}_Setup
Compression=lzma2/ultra64
SolidCompression=yes
LZMANumBlockThreads=4
; Visual settings
WizardStyle=modern dynamic
WizardResizable=yes
ShowLanguageDialog=auto
; Version info
VersionInfoVersion={#AppVersion}
VersionInfoCompany={#AppPublisher}
VersionInfoDescription={#AppName} Installer
VersionInfoCopyright=MIT License
; Misc
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\{#AppExeName}
UninstallDisplayName={#AppName}
[Languages]
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "startmenuicon"; Description: "Eintrag im Startmenü erstellen"; GroupDescription: "{cm:AdditionalIcons}"
[Files]
; Main executable
Source: "{#SourceDir}\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
; Commandline interface
Source: "{#SourceDir}\{#AppCliName}"; DestDir: "{app}"; Flags: ignoreversion
; Runtime files
Source: "{#SourceDir}\_internal\*"; DestDir: "{app}\_internal"; Flags: ignoreversion recursesubdirs createallsubdirs
; Documentation
Source: "{#SourceDir}\docs\*"; DestDir: "{app}\docs"; Flags: ignoreversion recursesubdirs createallsubdirs
; Locale / translations
Source: "{#SourceDir}\locale\*"; DestDir: "{app}\locale"; Flags: ignoreversion recursesubdirs createallsubdirs
; Example config (only if not already present)
Source: "{#SourceDir}\config.ini.example"; DestDir: "{app}"; Flags: ignoreversion
; License
Source: "{#SourceDir}\LICENSE"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
; Start menu shortcut (only for all-users install: Common Programs; for per-user: user Programs)
Name: "{autoprograms}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: startmenuicon
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#AppName}}"; Flags: nowait postinstall skipifsilent
[UninstallDelete]
; Remove the log file created by the application on uninstall
Type: files; Name: "{app}\multideck.log"
[Code]
var
FFmpegPage: TInputOptionWizardPage;
FFmpegFound: Boolean;
WingetFound: Boolean;
function IsGerman: Boolean;
begin
Result := ActiveLanguage = 'german';
end;
function FindOnPath(const CommandName: string): Boolean;
var
ResultCode: Integer;
begin
Result :=
Exec(
ExpandConstant('{cmd}'),
'/C where ' + AddQuotes(CommandName),
'',
SW_HIDE,
ewWaitUntilTerminated,
ResultCode
) and (ResultCode = 0);
end;
function FFmpegInstallRequested: Boolean;
begin
Result :=
(FFmpegPage <> nil) and
FFmpegPage.Values[0];
end;
procedure InitializeWizard;
var
Description: string;
SubCaption: string;
begin
FFmpegFound := FindOnPath('ffmpeg.exe');
WingetFound := FindOnPath('winget.exe');
if IsGerman then
begin
Description :=
'MultiDeck nutzt FFmpeg als externe Abhängigkeit. ' +
'FFmpeg wurde im aktuellen Systempfad nicht gefunden.';
SubCaption :=
'Durch das Aktivieren dieser Option versucht das Setup am Ende ' +
'der Installation FFmpeg über winget zu installieren ' +
'(Paket: Gyan.FFmpeg).';
end
else
begin
Description :=
'MultiDeck uses FFmpeg as an external dependency. ' +
'FFmpeg was not found in the current system path.';
SubCaption :=
'If you enable this option, Setup will try to install FFmpeg ' +
'via winget at the end of the installation ' +
'(package: Gyan.FFmpeg).';
end;
FFmpegPage :=
CreateInputOptionPage(
wpSelectTasks,
'FFmpeg',
Description,
SubCaption,
False,
False
);
if IsGerman then
FFmpegPage.Add('FFmpeg über winget installieren')
else
FFmpegPage.Add('Install FFmpeg via winget');
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
if (FFmpegPage <> nil) and (PageID = FFmpegPage.ID) then
Result := FFmpegFound or (not WingetFound);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if (FFmpegPage <> nil) and (CurPageID = wpReady) and (not FFmpegFound) and (not WingetFound) then
begin
if IsGerman then
SuppressibleMsgBox(
'FFmpeg wurde nicht im Systempfad gefunden, aber winget ist auf diesem System nicht verfügbar. ' +
'FFmpeg kann deshalb nicht automatisch installiert werden.',
mbInformation,
MB_OK,
IDOK
)
else
SuppressibleMsgBox(
'FFmpeg was not found in the system path, but winget is not available on this system. ' +
'Setup cannot install FFmpeg automatically.',
mbInformation,
MB_OK,
IDOK
);
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
InstallArgs: string;
begin
if (CurStep <> ssPostInstall) or (not FFmpegInstallRequested) then
exit;
InstallArgs :=
'/C winget install --id Gyan.FFmpeg --exact --accept-package-agreements ' +
'--accept-source-agreements';
if not Exec(ExpandConstant('{cmd}'), InstallArgs, '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
if IsGerman then
SuppressibleMsgBox(
'Der Aufruf von winget zum Installieren von FFmpeg konnte nicht gestartet werden.',
mbError,
MB_OK,
IDOK
)
else
SuppressibleMsgBox(
'Setup could not start winget to install FFmpeg.',
mbError,
MB_OK,
IDOK
);
exit;
end;
if ResultCode <> 0 then
begin
if IsGerman then
SuppressibleMsgBox(
'Die Installation von FFmpeg über winget wurde nicht erfolgreich abgeschlossen. ' +
'Bitte prüfe die Konsolenausgabe oder führe "winget install Gyan.FFmpeg" später manuell aus.',
mbError,
MB_OK,
IDOK
)
else
SuppressibleMsgBox(
'The winget installation of FFmpeg did not complete successfully. ' +
'Please check the console output or run "winget install Gyan.FFmpeg" manually later.',
mbError,
MB_OK,
IDOK
);
end
else if IsGerman then
SuppressibleMsgBox(
'FFmpeg wurde über winget installiert. Je nach System kann eine neue Sitzung oder ein Neustart erforderlich sein, ' +
'bevor der Befehl "ffmpeg" im Pfad verfügbar ist.',
mbInformation,
MB_OK,
IDOK
)
else
SuppressibleMsgBox(
'FFmpeg was installed via winget. Depending on the system, a new session or restart may be required ' +
'before the "ffmpeg" command is available in PATH.',
mbInformation,
MB_OK,
IDOK
);
end;