-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgimp-help.iss
712 lines (581 loc) · 20.5 KB
/
gimp-help.iss
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
;Installer for GIMP Help
;
;.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,
; ;
;Copyright (c) 2002-2012 Jernej Simon�i� ;
; ;
;This software is provided 'as-is', without any express or implied ;
;warranty. In no event will the authors be held liable for any damages ;
;arising from the use of this software. ;
; ;
;Permission is granted to anyone to use this software for any purpose, ;
;including commercial applications, and to alter it and redistribute it ;
;freely, subject to the following restrictions: ;
; ;
; 1. The origin of this software must not be misrepresented; you must ;
; not claim that you wrote the original software. If you use this ;
; software in a product, an acknowledgment in the product ;
; documentation would be appreciated but is not required. ;
; ;
; 2. Altered source versions must be plainly marked as such, and must ;
; not be misrepresented as being the original software. ;
; ;
; 3. This notice may not be removed or altered from any source ;
; distribution. ;
;.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.;
;#define dontcompress
;#define nofiles
#ifndef MAJORVERSION
#error MAJORVERSION must be defined
#endif
#ifndef MINORVERSION
#error MINORVERSION must be defined
#endif
#ifndef MICROVERSION
#error MICROVERSION must be defined
#endif
#ifndef LANG
#error LANG must be defined
#endif
#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'
#elif LANG=='bg'
#define LANGFILE='Languages\Bulgarian.isl'
#elif LANG=='ca'
#define LANGFILE='Languages\Catalan.isl'
#elif LANG=='cs'
#define LANGFILE='Languages\Czech.isl'
#elif LANG=='de'
#define LANGFILE='Languages\German.isl'
#elif LANG=='da'
#define LANGFILE='Languages\Danish.isl'
#elif LANG=='el'
#define LANGFILE='Languages\Unofficial\Greek.isl'
#elif LANG=='en_GB'
#define LANGFILE='Languages\Unofficial\EnglishBritish.isl'
#elif LANG=='es'
#define LANGFILE='Languages\Spanish.isl'
#elif LANG=='fa'
#define LANGFILE='Languages\Unofficial\Farsi.isl'
#elif LANG=='fi'
#define LANGFILE='Languages\Finnish.isl'
#elif LANG=='fr'
#define LANGFILE='Languages\French.isl'
#elif LANG=='hr'
#define LANGFILE='Languages\Unofficial\Croatian.isl'
#elif LANG=='hu'
#define LANGFILE='Languages\Hungarian.isl'
#elif LANG=='it'
#define LANGFILE='Languages\Italian.isl'
#elif LANG=='ja'
#define LANGFILE='Languages\Japanese.isl'
#elif LANG=='ko'
#define LANGFILE='Languages\Korean.isl'
#elif LANG=='lt'
#define LANGFILE='Languages\Unofficial\Lithuanian.isl'
#elif LANG=='nl'
#define LANGFILE='Languages\Dutch.isl'
#elif LANG=='no'
#define LANGFILE='Languages\Norwegian.isl'
#elif LANG=='nn'
#define LANGFILE='Languages\Unofficial\NorwegianNynorsk.isl'
#elif LANG=='pl'
#define LANGFILE='Languages\Polish.isl'
#elif LANG=='pt'
#define LANGFILE='Languages\Portuguese.isl'
#elif LANG=='pt_BR'
#define LANGFILE='Languages\BrazilianPortuguese.isl'
#elif LANG=='ro'
#define LANGFILE='Languages\Unofficial\Romanian.isl'
#elif LANG=='ru'
#define LANGFILE='Languages\Russian.isl'
#elif LANG=='sl'
#define LANGFILE='Languages\Slovenian.isl'
#elif LANG=='sv'
#define LANGFILE='Languages\Swedish.isl'
#elif LANG=='tr'
#define LANGFILE='Languages\Turkish.isl'
#elif LANG=='uk'
#define LANGFILE='Languages\Ukrainian.isl'
#elif LANG=='zh_CN'
#define LANGFILE='Languages\Unofficial\ChineseSimplified.isl'
#endif
[Setup]
AppName=GIMP Help {#VERSION}
AppID=GIMP-Help-{#MAJORVERSION}
AppVerName=GIMP Help {#VERSION}
AppPublisherURL=https://docs.gimp.org/
AppSupportURL=https://docs.gimp.org/
AppUpdatesURL=https://docs.gimp.org/download.html
AppPublisher=The GIMP Team
DefaultDirName={autopf}\GIMP Help {#MAJORVERSION}
DirExistsWarning=no
DisableProgramGroupPage=yes
DisableDirPage=yes
FlatComponentsList=yes
WizardImageFile=big.bmp
WizardSmallImageFile=small.bmp
WizardImageStretch=no
CreateUninstallRegKey=no
UpdateUninstallLogAppName=no
UninstallFilesDir={app}\uninst
UsePreviousLanguage=no
VersionInfoDescription=GIMP Help {#VERSION}
VersionInfoProductName=GIMP Help {#VERSION}
#ifdef dontcompress
OutputDir=_Output\unc
Compression=none
InternalCompressLevel=0
#else
OutputDir=_Output
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
OutputBaseFilename=gimp-help-{#VERSION}-{#LANG}-setup
#endif
;SignedUninstaller=yes
;SignedUninstallerDir=_Uninst
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=commandline
[Languages]
Name: "{#LANG}"; MessagesFile: "compiler:{#LANGFILE},lang\help.en.isl,lang\help.{#LANG}.isl"
[Files]
#ifndef nofiles
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
[Code]
function WideCharToMultiByte(CodePage: Cardinal; dwFlags: DWORD; lpWideCharStr: String; cchWideCharStr: Integer;
lpMultiByteStr: PAnsiChar; cbMultiByte: Integer; lpDefaultChar: Integer;
lpUsedDefaultChar: Integer): Integer; external 'WideCharToMultiByte@Kernel32 stdcall';
function MultiByteToWideChar(CodePage: Cardinal; dwFlags: DWORD; lpMultiByteStr: PAnsiChar; cbMultiByte: Integer;
lpWideCharStr: String; cchWideChar: Integer): Integer;
external 'MultiByteToWideChar@Kernel32 stdcall';
function GetLastError(): DWORD; external 'GetLastError@Kernel32 stdcall';
const
SHACF_FILESYSTEM = $1;
CP_UTF8 = 65001;
BCM_SETSHIELD = $160C;
#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';
type
TGimpInstall = record
Path: String;
RequireAdmin: Boolean;
InstallCheckbox: TCheckbox;
end;
TGimpInstalls = array of TGimpInstall;
TInstallModePreReqs = record
Dir: Boolean;
PrivOverride: Boolean;
end;
var
wpInstalls: TWizardPage;
GimpInstalls: TGimpInstalls;
InstallMode: (imFindInstalls, imInstall);
LogParameter: String;
SilentParameter: String;
PreparingCounter: Integer;
function Count(What, Where: String): Integer;
begin
Result := 0;
if Length(What) = 0 then //nothing to count - should this throw an error?
exit;
while Pos(What,Where)>0 do
begin
Where := Copy(Where,Pos(What,Where)+Length(What),Length(Where));
Result := Result + 1;
end;
end;
//split text to array
procedure Explode(var ADest: TArrayOfString; aText, aSeparator: String);
var tmp: Integer;
begin
if aSeparator='' then
exit;
SetArrayLength(ADest,Count(aSeparator,aText)+1)
tmp := 0;
repeat
if Pos(aSeparator,aText)>0 then
begin
ADest[tmp] := Copy(aText,1,Pos(aSeparator,aText)-1);
aText := Copy(aText,Pos(aSeparator,aText)+Length(aSeparator),Length(aText));
tmp := tmp + 1;
end else
begin
ADest[tmp] := aText;
aText := '';
end;
until Length(aText)=0;
end;
//compares two version numbers, returns -1 if vA is newer, 0 if both are identical, 1 if vB is newer
function CompareVersion(vA,vB: String): Integer;
var tmp: TArrayOfString;
verA,verB: Array of Integer;
i,len: Integer;
begin
StringChange(vA,'-','.');
StringChange(vB,'-','.');
Explode(tmp,vA,'.');
SetArrayLength(verA,GetArrayLength(tmp));
for i := 0 to GetArrayLength(tmp) - 1 do
verA[i] := StrToIntDef(tmp[i],0);
Explode(tmp,vB,'.');
SetArrayLength(verB,GetArrayLength(tmp));
for i := 0 to GetArrayLength(tmp) - 1 do
verB[i] := StrToIntDef(tmp[i],0);
len := GetArrayLength(verA);
if GetArrayLength(verB) < len then
len := GetArrayLength(verB);
for i := 0 to len - 1 do
if verA[i] < verB[i] then
begin
Result := 1;
exit;
end else
if verA[i] > verB[i] then
begin
Result := -1;
exit
end;
if GetArrayLength(verA) < GetArrayLength(verB) then
begin
Result := 1;
exit;
end else
if GetArrayLength(verA) > GetArrayLength(verB) then
begin
Result := -1;
exit;
end;
Result := 0;
end;
function RevPos(const SearchStr, Str: string): Integer;
var i: Integer;
begin
if Length(SearchStr) < Length(Str) then
for i := (Length(Str) - Length(SearchStr) + 1) downto 1 do
begin
if Copy(Str, i, Length(SearchStr)) = SearchStr then
begin
Result := i;
exit;
end;
end;
Result := 0;
end;
function Replace(pSearchFor, pReplaceWith, pText: String): String;
begin
StringChangeEx(pText,pSearchFor,pReplaceWith,True);
Result := pText;
end;
function Utf82String(const pInput: AnsiString): String;
var Output: String;
ret, outLen, nulPos: Integer;
begin
outLen := MultiByteToWideChar(CP_UTF8, 0, pInput, -1, Output, 0);
Output := StringOfChar(#0,outLen);
ret := MultiByteToWideChar(CP_UTF8, 0, pInput, -1, Output, outLen);
if ret = 0 then
RaiseException('MultiByteToWideChar failed: ' + IntToStr(GetLastError));
nulPos := Pos(#0,Output) - 1;
if nulPos = -1 then
nulPos := Length(Output);
Result := Copy(Output,1,nulPos);
end;
function LoadStringFromUTF8File(const pFileName: String; var oS: String): Boolean;
var Utf8String: AnsiString;
begin
Result := LoadStringFromFile(pFileName, Utf8String);
oS := Utf82String(Utf8String);
end;
function String2Utf8(const pInput: String): AnsiString;
var Output: AnsiString;
ret, outLen, nulPos: Integer;
begin
outLen := WideCharToMultiByte(CP_UTF8, 0, pInput, -1, Output, 0, 0, 0);
Output := StringOfChar(#0,outLen);
ret := WideCharToMultiByte(CP_UTF8, 0, pInput, -1, Output, outLen, 0, 0);
if ret = 0 then
RaiseException('WideCharToMultiByte failed: ' + IntToStr(GetLastError));
nulPos := Pos(#0,Output) - 1;
if nulPos = -1 then
nulPos := Length(Output);
Result := Copy(Output,1,nulPos);
end;
function SaveStringToUTF8File(const pFileName, pS: String; const pAppend: Boolean): Boolean;
begin
Result := SaveStringToFile(pFileName, String2Utf8(pS), pAppend);
end;
procedure SaveToUninstInf(const pText: AnsiString);
var sUnInf: String;
sOldContent: String;
begin
sUnInf := ExpandConstant('{app}\uninst\uninst.inf');
if not FileExists(sUnInf) then //save small header
SaveStringToUTF8File(sUnInf,#$feff+'#Additional uninstall tasks'#13#10+ //#$feff BOM is required for LoadStringsFromFile
'#This file uses UTF-8 encoding'#13#10+
'#'#13#10+
'#Empty lines and lines beginning with # are ignored'#13#10+
'#'#13#10+
'#Add uninstallers for GIMP add-ons that should be removed together with GIMP like this:'#13#10+
'#Run:<description>/<full path to uninstaller>/<parameters for automatic uninstall>'#13#10+
'#'#13#10+
'#The file is parsed in reverse order' + #13#10 +
'' + #13#10 //needs '' in front, otherwise preprocessor complains
,False)
else
begin
if LoadStringFromUTF8File(sUnInf,sOldContent) then
if Pos(#13#10+pText+#13#10,sOldContent) > 0 then //don't write duplicate lines
exit;
end;
SaveStringToUTF8File(sUnInf,pText+#13#10,True);
end;
function ExtractGimpVersion(const VerStr: String): String;
var p: Integer;
begin
p := Pos('gimp ',LowerCase(VerStr));
if p > 0 then
Result := Copy(VerStr,p+5,Length(VerStr))
else
Result := '0';
end;
procedure GetGimpInstall(const RootKey: Integer);
var n: Integer;
Path, Version: String;
begin
if RegQueryStringValue(RootKey, RegGimpUnins, RegGimpUninsPathKey, Path) then
if RegQueryStringValue(RootKey, RegGimpUnins, RegGimpUninsDispVerKey, Version) then
begin
Log('Found GIMP install: ' + Path + '; ' + Version);
if CompareVersion('{#MIN_VERSION}', Version) >= 0 then
begin
n := GetArrayLength(GimpInstalls);
Inc(n);
SetArrayLength(GimpInstalls,n);
GimpInstalls[n-1].Path := Path;
GimpInstalls[n-1].RequireAdmin := not (RootKey = HKCU);
end;
end;
end;
function GetGimpInfo(): Boolean;
begin
if IsWin64 then
GetGimpInstall(HKLM64);
GetGimpInstall(HKLM);
GetGimpInstall(HKCU);
if GetArrayLength(GimpInstalls) = 0 then
begin
SuppressibleMsgBox(FmtMessage(CustomMessage('NoGimpInstallsFound'),[CustomMessage('GimpHelp'), '{#MIN_VERSION}']),mbError,MB_OK,IDOK);
Result := False
end else
begin
Result := True;
end;
end;
procedure WriteUninstallInfo();
begin
SaveToUninstInf('Run:GIMP Help/'+ExpandConstant('{uninstallexe}')+'//SILENT /NORESTART');
end;
function InitializeSetup(): Boolean;
var i: Integer;
InstallModePreReqs: TInstallModePreReqs;
begin
Result := True;
InstallMode := imFindinstalls; //default
PreparingCounter := 0;
SilentParameter := '/SILENT'
InstallModePreReqs.Dir := False;
InstallModePreReqs.PrivOverride := False;
for i := 0 to ParamCount do
begin
if LowerCase(ParamStr(i)) = '/install' then
InstallMode := imInstall
else if LowerCase(Copy(ParamStr(i),1,5)) = '/dir=' then
InstallModePreReqs.Dir := True
else if (LowerCase(Copy(ParamStr(i),1,9)) = '/allusers') or (LowerCase(Copy(ParamStr(i),1,12)) = '/currentuser') then
InstallModePreReqs.PrivOverride := True
else if LowerCase(Copy(ParamStr(i),1,4)) = '/log' then
LogParameter := ParamStr(i)
else if LowerCase(ParamStr(i)) = '/verysilent' then
SilentParameter := '/VERYSILENT';
end;
if InstallMode = imInstall then
begin
//check for required parameters
if (InstallModePreReqs.Dir = False) or (InstallModePreReqs.PrivOverride = False) then
begin
SuppressibleMsgBox(CustomMessage('MissingParameters'),mbError,MB_OK,IDOK);
Result := False;
end;
exit;
end;
if Pos('=',LogParameter) > 0 then //needed, because only 1 instance of Setup can write to the same log file
begin
i := RevPos('.', LogParameter);
if i > 0 then
LogParameter := Copy(LogParameter, 1, i) + '?' + Copy(LogParameter, i, Length(LogParameter) - i + 1)
else
LogParameter := LogParameter + '.?';
Log('New LogParameter: ' + LogParameter);
end;
Result := GetGimpInfo();
end;
procedure CurStepChanged(pCurStep: TSetupStep);
begin
case pCurStep of
ssInstall:
if InstallMode = imFindinstalls then
begin
Abort();
end;
ssPostInstall:
begin
WriteUninstallInfo();
end;
end;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
var n, r: Integer;
Params: String;
begin
if InstallMode = imFindInstalls then
begin
WizardForm.Hide;
for n := 0 to GetArrayLength(GimpInstalls) - 1 do
if (GimpInstalls[n].InstallCheckbox = nil) or (GimpInstalls[n].InstallCheckbox.Checked) then
begin
Params := '"' + ExpandConstant('{srcexe}') + '" ' + SilentParameter + ' /NOCANCEL /INSTALL /DIR="' +
GimpInstalls[n].Path + '" ' +
Replace('?', IntToStr(n + 1), LogParameter);
if GimpInstalls[n].RequireAdmin then
Params := Params + ' /ALLUSERS'
else
Params := Params + ' /CURRENTUSER';
Log('Running: ' + Params);
if Exec('>', Params, GetCurrentDir, SW_SHOW, ewWaitUntilTerminated, r) then
Log('Success, Setup return code: ' + IntToStr(r))
else
Log('Failed, return code: ' + IntToStr(r) + ' (' + SysErrorMessage(r) + ')');
end;
WizardForm.Show;
if not WizardSilent then
Result := 'Abort'; //nothing to install in this session, abuse this to abort the setup, and show "finished" page
//(only in non-silent mode, to not show an error dialog; in silent mode, abort in ssInstall)
end;
end;
procedure InstallChecks();
var n: Integer;
SomethingSelected, AdminReqd: Boolean;
begin
AdminReqd := False;
SomethingSelected := False;
for n := 0 to GetArrayLength(GimpInstalls) - 1 do
begin
if (GimpInstalls[n].InstallCheckbox = nil) or GimpInstalls[n].InstallCheckbox.Checked then
begin
SomethingSelected := True;
if GimpInstalls[n].RequireAdmin then
AdminReqd := True;
end;
end;
WizardForm.NextButton.Enabled := SomethingSelected;
if AdminReqd then
PostMessage(WizardForm.NextButton.Handle, BCM_SETSHIELD, 0, 1)
else
PostMessage(WizardForm.NextButton.Handle, BCM_SETSHIELD, 0, 0);
end;
procedure CBInstallOnClick(Sender: TObject);
begin
InstallChecks();
end;
procedure InitializeWizard();
var n: Integer;
lblInfo: TNewStaticText;
begin
if (InstallMode = imFindInstalls) and (GetArrayLength(GimpInstalls) > 1) then
begin
wpInstalls := CreateCustomPage(wpWelcome, CustomMessage('SelectGimpInstallsCaption'),
FmtMessage(CustomMessage('SelectGimpInstallsDescription'),[CustomMessage('GimpHelp')]));
lblInfo := TNewStaticText.Create(wpInstalls);
with lblInfo do
begin
Top := 0;
Left := 0;
Parent := wpInstalls.Surface;
Caption := 'Text';
Visible := False;
end;
WizardForm.AdjustLabelHeight(lblInfo);
for n := 0 to GetArrayLength(GimpInstalls) - 1 do
begin
GimpInstalls[n].InstallCheckbox := TCheckBox.Create(wpInstalls);
with GimpInstalls[n].InstallCheckbox do
begin
Left := 0;
Width := wpInstalls.Surface.Width - Left;
if n = 0 then
Top := 0 //lblInfo.Top + lblInfo.Height + ScaleY(12)
else
Top := GimpInstalls[n-1].InstallCheckbox.Top + GimpInstalls[n-1].InstallCheckbox.Height + ScaleY(12);
Height := lblInfo.Height;
Tag := n;
Checked := True;
Caption := GimpInstalls[n].Path;
OnClick := @CBInstallOnClick;
Parent := wpInstalls.Surface;
end;
end;
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
case PageID of
wpReady:
Result := GetArrayLength(GimpInstalls) > 1; //skip the Ready page when confirmation page was shown
end;
end;
procedure ChangeWPPreparing();
begin
Inc(PreparingCounter);
if PreparingCounter = 2 then //second time happens after PrepareToInstall returns non-empty string
begin
//TODO: this doesn't look like the normal Finished page
WizardForm.NextButton.Visible := False;
WizardForm.BackButton.Visible := False;
WizardForm.CancelButton.Caption := SetupMessage(msgButtonFinish);
WizardForm.PreparingErrorBitmapImage.Visible := False;
WizardForm.PreparingLabel.Caption := SetupMessage(msgClickFinish);
WizardForm.PreparingLabel.Left := 0;
WizardForm.PreparingLabel.Width := WizardForm.PreparingPage.Width;
WizardForm.AdjustLabelHeight(WizardForm.PreparingLabel);
WizardForm.PageNameLabel.Caption := Replace('[name]',CustomMessage('GimpHelp'),SetupMessage(msgFinishedHeadingLabel));
WizardForm.PageDescriptionLabel.Caption := Replace('[name]',CustomMessage('GimpHelp'),SetupMessage(msgFinishedLabel));
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
Log('CurPageChanged: ' + IntToStr(CurPageID));
if (CurPageID = wpReady) and (InstallMode = imFindInstalls) then
InstallChecks();
if (CurPageID = wpPreparing) and (InstallMode = imFindInstalls) then
ChangeWPPreparing();
if (wpInstalls <> nil) and (CurPageID = wpInstalls.ID) then
begin
InstallChecks();
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
end;
end;
#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed." + LANG + ".iss")