forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.iss
331 lines (297 loc) · 14.2 KB
/
setup.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
; Inno Setup
; Copyright (C) 1997-2018 Jordan Russell. All rights reserved.
; Portions by Martijn Laan
; For conditions of distribution and use, see LICENSE.TXT.
;
; Setup script
[Setup]
AppName=Inno Setup
AppId=Inno Setup 5
AppVersion=5.6.1
AppPublisher=jrsoftware.org
AppPublisherURL=http://www.innosetup.com/
AppSupportURL=http://www.innosetup.com/
AppUpdatesURL=http://www.innosetup.com/
VersionInfoCopyright=Copyright (C) 1997-2018 Jordan Russell. Portions Copyright (C) 2000-2018 Martijn Laan.
AppMutex=InnoSetupCompilerAppMutex,Global\InnoSetupCompilerAppMutex
SetupMutex=InnoSetupCompilerSetupMutex,Global\InnoSetupCompilerSetupMutex
MinVersion=0,5.0
DefaultDirName={pf}\Inno Setup 5
DefaultGroupName=Inno Setup 5
AllowNoIcons=yes
Compression=lzma2/max
SolidCompression=yes
Uninstallable=not PortableCheck
UninstallDisplayIcon={app}\Compil32.exe
LicenseFile=license.txt
TimeStampsInUTC=yes
TouchDate=none
TouchTime=00:00
WizardImageFile=compiler:WizModernImage-IS.bmp
WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp
#ifndef NOSIGNTOOL
SignTool=issigntool
SignTool=issigntool256
SignedUninstaller=yes
#endif
#define MatchingExtension(str FileName, str Extension) \
SameText(ExtractFileExt(FileName), Extension)
#sub ProcessFoundLanguagesFile
#define FileName FindGetFileName(FindHandle)
#if MatchingExtension(FileName, FindBaseExtension) ; Some systems also return .islu files when asked for *.isl
#define Name LowerCase(RemoveFileExt(FileName))
#define MessagesFile FindPathName + FileName
#pragma message "Generating [Languages] entry with name " + Name + ": " + MessagesFile
Name: {#Name}; MessagesFile: {#MessagesFile}
#endif
#endsub
#sub ProcessFoundCustomMessagesFile
#define FileName FindGetFileName(FindHandle)
#if MatchingExtension(FileName, FindBaseExtension) ; See above
#define CustomMessagesFile FindPathName + FileName
#pragma message "Including CustomMessages file: " + CustomMessagesFile
#include CustomMessagesFile
#endif
#endsub
#define FindPathName
#define FindBaseExtension
#define FindType
#define FindHandle
#define FindResult
#sub DoFindFilesLoop
#for {FindHandle = FindResult = FindFirst(FindPathName + "*." + FindBaseExtension, 0); FindResult; FindResult = FindNext(FindHandle)} FindType == 0 ? ProcessFoundLanguagesFile : ProcessFoundCustomMessagesFile
#if FindHandle
#expr FindClose(FindHandle)
#endif
#endsub
#sub DoFindFiles
#expr DoFindFilesLoop
#ifdef UNICODE
#expr FindBaseExtension = FindBaseExtension + "u"
#expr DoFindFilesLoop
#endif
#endsub
#define FindFiles(str PathName, str BaseExtension, int Type) \
FindPathName = PathName, FindBaseExtension = BaseExtension, FindType = Type, \
DoFindFiles
[Languages]
Name: english; MessagesFile: "files\Default.isl"
; Generate [Languages] entries for all official translations
#expr FindFiles("files\Languages\", "isl", 0)
; #include any translations for [CustomMessages] (includes the default custom messages)
#expr FindFiles("files\Languages\Setup\", "iss", 1)
[Messages]
; Two "Setup" on the same line looks weird, so put a line break in between
english.WelcomeLabel1=Welcome to the Inno Setup%nSetup Wizard
[Tasks]
Name: desktopicon; Description: "{cm:CreateDesktopIcon}"; Flags: unchecked
Name: fileassoc; Description: "{cm:AssocFileExtension,Inno Setup,.iss}"
[InstallDelete]
; Remove Unicode-only files if needed
#ifndef UNICODE
Type: files; Name: "{app}\Languages\*.islu"
Type: files; Name: "{app}\Examples\UnicodeExample1.iss"
#endif
; Remove ISPP files if needed (leave ISPP.chm)
Type: files; Name: "{app}\ISPP.dll"; Check: not ISPPCheck
Type: files; Name: "{app}\ISPPBuiltins.iss"; Check: not ISPPCheck
; Remove old ISPP files
Type: files; Name: "{app}\ISCmplr.dls"
Type: files; Name: "{app}\Builtins.iss"
[Files]
; Files used by [Code] first so these can be quickly decompressed despite solid compression
Source: "files\ISPP.ico"; Flags: dontcopy
; Other files
Source: "license.txt"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "ishelp\Staging\ISetup.chm"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\Compil32.exe"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\isscint.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
#ifndef isccexe
#define isccexe "ISCC.exe"
#endif
Source: "files\{#isccexe}"; DestName: "ISCC.exe"; DestDir: "{app}"; Flags: ignoreversion signonce touch
#ifndef iscmplrdll
#define iscmplrdll "ISCmplr.dll"
#endif
Source: "files\{#iscmplrdll}"; DestName: "ISCmplr.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\Setup.e32"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\SetupLdr.e32"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\Default.isl"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\Languages\*.isl"; DestDir: "{app}\Languages"; Flags: ignoreversion touch
#ifdef UNICODE
Source: "files\Languages\*.islu"; DestDir: "{app}\Languages"; Flags: ignoreversion touch
#endif
Source: "files\WizModernImage.bmp"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\WizModernImage-IS.bmp"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\WizModernSmallImage.bmp"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\WizModernSmallImage-IS.bmp"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "files\iszlib.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\isunzlib.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\isbzip.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\isbunzip.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
#ifndef islzmadll
#define islzmadll "islzma.dll"
#endif
Source: "files\{#islzmadll}"; DestName: "islzma.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\islzma32.exe"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "files\islzma64.exe"; DestDir: "{app}"; Flags: ignoreversion signonce touch
Source: "whatsnew.htm"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "ishelp\isfaq.htm"; DestDir: "{app}"; Flags: ignoreversion touch
Source: "Examples\Example1.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Example2.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Example3.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\64Bit.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\64BitTwoArch.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Components.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Languages.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\MyProg.exe"; DestDir: "{app}\Examples"; Flags: ignoreversion signonce touch
Source: "Examples\MyProg-x64.exe"; DestDir: "{app}\Examples"; Flags: ignoreversion signonce touch
Source: "Examples\MyProg.chm"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Readme.txt"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Readme-Dutch.txt"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\Readme-German.txt"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodeExample1.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodeDlg.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodeClasses.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodeDll.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodeAutomation.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodeAutomation2.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\CodePrepareToInstall.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
#ifdef UNICODE
Source: "Examples\UnicodeExample1.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
#endif
Source: "Examples\UninstallCodeExample1.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\MyDll.dll"; DestDir: "{app}\Examples"; Flags: ignoreversion signonce touch
Source: "Examples\MyDll\C\MyDll.c"; DestDir: "{app}\Examples\MyDll\C"; Flags: ignoreversion touch
Source: "Examples\MyDll\C\MyDll.def"; DestDir: "{app}\Examples\MyDll\C"; Flags: ignoreversion touch
Source: "Examples\MyDll\C\MyDll.dsp"; DestDir: "{app}\Examples\MyDll\C"; Flags: ignoreversion touch
Source: "Examples\MyDll\C#\MyDll.cs"; DestDir: "{app}\Examples\MyDll\C#"; Flags: ignoreversion touch
Source: "Examples\MyDll\C#\MyDll.csproj"; DestDir: "{app}\Examples\MyDll\C#"; Flags: ignoreversion touch
Source: "Examples\MyDll\C#\MyDll.sln"; DestDir: "{app}\Examples\MyDll\C#"; Flags: ignoreversion touch
Source: "Examples\MyDll\C#\packages.config"; DestDir: "{app}\Examples\MyDll\C#"; Flags: ignoreversion touch
Source: "Examples\MyDll\C#\Properties\AssemblyInfo.cs"; DestDir: "{app}\Examples\MyDll\C#\Properties"; Flags: ignoreversion touch
Source: "Examples\MyDll\Delphi\MyDll.dpr"; DestDir: "{app}\Examples\MyDll\Delphi"; Flags: ignoreversion touch
Source: "Examples\ISPPExample1.iss"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
Source: "Examples\ISPPExample1License.txt"; DestDir: "{app}\Examples"; Flags: ignoreversion touch
; ISPP files
Source: "Projects\ISPP\Help\Staging\ISPP.chm"; DestDir: "{app}"; Flags: ignoreversion touch
#ifndef isppdll
#define isppdll "ispp.dll"
#endif
Source: "files\{#isppdll}"; DestName: "ISPP.dll"; DestDir: "{app}"; Flags: ignoreversion signonce touch; Check: ISPPCheck
Source: "files\ISPPBuiltins.iss"; DestDir: "{app}"; Flags: ignoreversion touch; Check: ISPPCheck
[Icons]
Name: "{group}\Inno Setup Compiler"; Filename: "{app}\Compil32.exe"; WorkingDir: "{app}"; AppUserModelID: "JR.InnoSetup.IDE.5"
Name: "{group}\Inno Setup Documentation"; Filename: "{app}\ISetup.chm"
Name: "{group}\Inno Setup Example Scripts"; Filename: "{app}\Examples\"
Name: "{group}\Inno Setup FAQ"; Filename: "{app}\isfaq.htm"
Name: "{group}\Inno Setup Revision History"; Filename: "{app}\whatsnew.htm"
Name: "{commondesktop}\Inno Setup Compiler"; Filename: "{app}\Compil32.exe"; WorkingDir: "{app}"; AppUserModelID: "JR.InnoSetup.IDE.5"; Tasks: desktopicon
[Run]
Filename: "{app}\Compil32.exe"; Parameters: "/ASSOC"; StatusMsg: "{cm:AssocingFileExtension,Inno Setup,.iss}"; Tasks: fileassoc
Filename: "{app}\Compil32.exe"; WorkingDir: "{app}"; Description: "{cm:LaunchProgram,Inno Setup}"; Flags: nowait postinstall skipifsilent
[UninstallRun]
Filename: "{app}\Compil32.exe"; Parameters: "/UNASSOC"; RunOnceId: "RemoveISSAssoc"
[Code]
var
ISPPPage: TWizardPage;
ISPPCheckBox: TCheckBox;
function GetModuleHandle(lpModuleName: LongInt): LongInt;
external '[email protected] stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt;
external '[email protected] stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;
external '[email protected] stdcall';
function DestroyIcon(hIcon: LongInt): LongInt;
external '[email protected] stdcall';
const
DI_NORMAL = 3;
function CreateCustomOptionPage(AAfterId: Integer; ACaption, ASubCaption, AIconFileName, ALabel1Caption, ALabel2Caption,
ACheckCaption: String; var CheckBox: TCheckBox): TWizardPage;
var
Page: TWizardPage;
Rect: TRect;
hIcon: LongInt;
Label1, Label2: TNewStaticText;
begin
Page := CreateCustomPage(AAfterID, ACaption, ASubCaption);
try
AIconFileName := ExpandConstant('{tmp}\' + AIconFileName);
if not FileExists(AIconFileName) then
ExtractTemporaryFile(ExtractFileName(AIconFileName));
Rect.Left := 0;
Rect.Top := 0;
Rect.Right := 32;
Rect.Bottom := 32;
hIcon := ExtractIcon(GetModuleHandle(0), AIconFileName, 0);
try
with TBitmapImage.Create(Page) do begin
with Bitmap do begin
Width := 32;
Height := 32;
Canvas.Brush.Color := WizardForm.Color;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, hIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent := Page.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;
Label1 := TNewStaticText.Create(Page);
with Label1 do begin
AutoSize := False;
Left := WizardForm.SelectDirLabel.Left;
Width := Page.SurfaceWidth - Left;
WordWrap := True;
Caption := ALabel1Caption;
Parent := Page.Surface;
end;
WizardForm.AdjustLabelHeight(Label1);
Label2 := TNewStaticText.Create(Page);
with Label2 do begin
Top := Label1.Top + Label1.Height + ScaleY(12);
Caption := ALabel2Caption;
Parent := Page.Surface;
end;
WizardForm.AdjustLabelHeight(Label2);
CheckBox := TCheckBox.Create(Page);
with CheckBox do begin
Top := Label2.Top + Label2.Height + ScaleY(12);
Width := Page.SurfaceWidth;
Caption := ACheckCaption;
Parent := Page.Surface;
end;
Result := Page;
end;
procedure CreateCustomPages;
var
Caption, SubCaption1, IconFileName, Label1Caption, Label2Caption, CheckCaption: String;
begin
Caption := CustomMessage('ISPPTitle');
SubCaption1 := CustomMessage('ISPPSubtitle');
IconFileName := 'ISPP.ico';
Label1Caption := CustomMessage('ISPPText');
Label2Caption := CustomMessage('ISPPText2');
CheckCaption := CustomMessage('ISPPCheck');
ISPPPage := CreateCustomOptionPage(wpSelectProgramGroup, Caption, SubCaption1, IconFileName, Label1Caption, Label2Caption, CheckCaption, ISPPCheckBox);
end;
procedure InitializeWizard;
begin
CreateCustomPages;
ISPPCheckBox.Checked := (GetPreviousData('ISPP', '1') = '1') or (ExpandConstant('{param:ispp|0}') = '1');
end;
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
SetPreviousData(PreviousDataKey, 'ISPP', IntToStr(Ord(ISPPCheckBox.Checked)));
end;
function ISPPCheck: Boolean;
begin
Result := ISPPCheckBox.Checked;
end;
function PortableCheck: Boolean;
begin
Result := ExpandConstant('{param:portable|0}') = '1';
end;