forked from jrathlev/InnoUnpacker-Windows-GUI
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Struct6400u.pas
412 lines (397 loc) · 16.3 KB
/
Struct6400u.pas
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
unit Struct6400u;
{
Inno Setup
Copyright (C) 1997-2024 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Various records and other types that are shared by the ISCmplr, Setup,
SetupLdr, and Uninst projects
}
interface
uses
Windows, Int64Em, SHA1;
const
SetupTitle = 'Inno Setup';
SetupVersion = '6.4.0-dev';
SetupBinVersion = (6 shl 24) + (4 shl 16) + (0 shl 8) + 0;
type
TSetupID = array[0..63] of AnsiChar;
TUninstallLogID = array[0..63] of AnsiChar;
TMessagesHdrID = array[0..63] of AnsiChar;
TMessagesLangOptionsID = array[1..8] of AnsiChar;
TCompID = array[1..4] of AnsiChar;
TDiskSliceID = array[1..8] of AnsiChar;
const
{ SetupID is used by the Setup program to check if the SETUP.0 file is
compatible with it. If you make any modifications to the records in
this file it's recommended you change SetupID. Any change will do (like
changing the letters or numbers), as long as your format is
unrecognizable by the standard Inno Setup. }
SetupID: TSetupID = 'Inno Setup Setup Data (6.4.0)';
UninstallLogID: array[Boolean] of TUninstallLogID =
('Inno Setup Uninstall Log (b)', 'Inno Setup Uninstall Log (b) 64-bit');
MessagesHdrID: TMessagesHdrID = 'Inno Setup Messages (6.0.0) (u)';
MessagesLangOptionsID: TMessagesLangOptionsID = '!mlo!001';
ZLIBID: TCompID = 'zlb'#26;
DiskSliceID: TDiskSliceID = 'idska32'#26;
type
TSetupVersionDataVersion = packed record
Build: Word;
Minor, Major: Byte;
end;
TSetupVersionData = packed record
WinVersion, NTVersion: Cardinal;
NTServicePack: Word;
end;
TSetupHeaderOption = (shDisableStartupPrompt, shCreateAppDir,
shAllowNoIcons, shAlwaysRestart, shAlwaysUsePersonalGroup,
shWindowVisible, shWindowShowCaption, shWindowResizable,
shWindowStartMaximized, shEnableDirDoesntExistWarning,
shPassword, shAllowRootDirectory, shDisableFinishedPage, shUsePreviousAppDir,
shBackColorHorizontal, shUsePreviousGroup, shUpdateUninstallLogAppName,
shUsePreviousSetupType, shDisableReadyMemo, shAlwaysShowComponentsList,
shFlatComponentsList, shShowComponentSizes, shUsePreviousTasks,
shDisableReadyPage, shAlwaysShowDirOnReadyPage, shAlwaysShowGroupOnReadyPage,
shAllowUNCPath, shUserInfoPage, shUsePreviousUserInfo,
shUninstallRestartComputer, shRestartIfNeededByRun, shShowTasksTreeLines,
shAllowCancelDuringInstall, shWizardImageStretch, shAppendDefaultDirName,
shAppendDefaultGroupName, shEncryptionUsed, shSetupLogging,
shSignedUninstaller, shUsePreviousLanguage, shDisableWelcomePage,
shCloseApplications, shRestartApplications, shAllowNetworkDrive,
shForceCloseApplications, shAppNameHasConsts, shUsePreviousPrivileges,
shWizardResizable, shUninstallLogging);
TSetupLanguageDetectionMethod = (ldUILanguage, ldLocale, ldNone);
TSetupCompressMethod = (cmStored, cmZip, cmBzip, cmLZMA, cmLZMA2);
TSetupSalt = array[0..7] of Byte;
TSetupNonce = record
RandomXorStartOffset: Int64;
RandomXorFirstSlice: Int32;
RemainingRandom: array[0..2] of Int32;
end;
TSetupProcessorArchitecture = (paUnknown, paX86, paX64, paArm32, paArm64);
TSetupProcessorArchitectures = set of TSetupProcessorArchitecture;
TSetupDisablePage = (dpAuto, dpNo, dpYes);
TSetupPrivilegesRequired = (prNone, prPowerUser, prAdmin, prLowest);
TSetupPrivilegesRequiredOverride = (proCommandLine, proDialog);
TSetupPrivilegesRequiredOverrides = set of TSetupPrivilegesRequiredOverride;
TSetupWizardStyle = (wsClassic, wsModern);
const
SetupProcessorArchitectureNames: array[TSetupProcessorArchitecture] of String =
('Unknown', 'x86', 'x64', 'Arm32', 'Arm64');
const
SetupHeaderStrings = 32;
SetupHeaderAnsiStrings = 4;
type
TSetupHeader = packed record
AppName, AppVerName, AppId, AppCopyright, AppPublisher, AppPublisherURL,
AppSupportPhone, AppSupportURL, AppUpdatesURL, AppVersion, DefaultDirName,
DefaultGroupName, BaseFilename, UninstallFilesDir, UninstallDisplayName,
UninstallDisplayIcon, AppMutex, DefaultUserInfoName, DefaultUserInfoOrg,
DefaultUserInfoSerial, AppReadmeFile, AppContact, AppComments,
AppModifyPath, CreateUninstallRegKey, Uninstallable, CloseApplicationsFilter,
SetupMutex, ChangesEnvironment, ChangesAssociations,
ArchitecturesAllowed, ArchitecturesInstallIn64BitMode: String;
LicenseText, InfoBeforeText, InfoAfterText, CompiledCodeText: AnsiString;
NumLanguageEntries, NumCustomMessageEntries, NumPermissionEntries,
NumTypeEntries, NumComponentEntries, NumTaskEntries, NumDirEntries,
NumFileEntries, NumFileLocationEntries, NumIconEntries, NumIniEntries,
NumRegistryEntries, NumInstallDeleteEntries, NumUninstallDeleteEntries,
NumRunEntries, NumUninstallRunEntries: Integer;
MinVersion, OnlyBelowVersion: TSetupVersionData;
BackColor, BackColor2: Longint;
WizardStyle: TSetupWizardStyle;
WizardSizePercentX, WizardSizePercentY: Integer;
WizardImageAlphaFormat: (afIgnored, afDefined, afPremultiplied); // Must be same as Graphics.TAlphaFormat
PasswordHash: TSHA1Digest;
PasswordSalt: TSetupSalt;
EncryptionBaseNonce: TSetupNonce;
ExtraDiskSpaceRequired: Integer64;
SlicesPerDisk: Integer;
UninstallLogMode: (lmAppend, lmNew, lmOverwrite);
DirExistsWarning: (ddAuto, ddNo, ddYes);
PrivilegesRequired: TSetupPrivilegesRequired;
PrivilegesRequiredOverridesAllowed: TSetupPrivilegesRequiredOverrides;
ShowLanguageDialog: (slYes, slNo, slAuto);
LanguageDetectionMethod: TSetupLanguageDetectionMethod;
CompressMethod: TSetupCompressMethod;
DisableDirPage, DisableProgramGroupPage: TSetupDisablePage;
UninstallDisplaySize: Integer64;
Options: set of TSetupHeaderOption;
end;
const
SetupPermissionEntryStrings = 0;
SetupPermissionEntryAnsiStrings = 1;
type
PSetupPermissionEntry = ^TSetupPermissionEntry;
TSetupPermissionEntry = packed record
Permissions: AnsiString; { an array of TGrantPermissionEntry's }
end;
const
SetupLanguageEntryStrings = 6;
SetupLanguageEntryAnsiStrings = 4;
type
PSetupLanguageEntry = ^TSetupLanguageEntry;
TSetupLanguageEntry = packed record
Name, LanguageName, DialogFontName, TitleFontName, WelcomeFontName,
CopyrightFontName: String;
Data, LicenseText, InfoBeforeText, InfoAfterText: AnsiString;
LanguageID: Cardinal;
DialogFontSize: Integer;
TitleFontSize: Integer;
WelcomeFontSize: Integer;
CopyrightFontSize: Integer;
RightToLeft: Boolean;
end;
const
SetupCustomMessageEntryStrings = 2;
SetupCustomMessageEntryAnsiStrings = 0;
type
PSetupCustomMessageEntry = ^TSetupCustomMessageEntry;
TSetupCustomMessageEntry = packed record
Name, Value: String;
LangIndex: Integer;
end;
const
SetupTypeEntryStrings = 4;
SetupTypeEntryAnsiStrings = 0;
type
TSetupTypeOption = (toIsCustom);
TSetupTypeOptions = set of TSetupTypeOption;
TSetupTypeType = (ttUser, ttDefaultFull, ttDefaultCompact, ttDefaultCustom);
PSetupTypeEntry = ^TSetupTypeEntry;
TSetupTypeEntry = packed record
Name, Description, Languages, Check: String;
MinVersion, OnlyBelowVersion: TSetupVersionData;
Options: TSetupTypeOptions;
Typ: TSetupTypeType;
{ internally used: }
Size: Integer64;
end;
const
SetupComponentEntryStrings = 5;
SetupComponentEntryAnsiStrings = 0;
type
PSetupComponentEntry = ^TSetupComponentEntry;
TSetupComponentEntry = packed record
Name, Description, Types, Languages, Check: String;
ExtraDiskSpaceRequired: Integer64;
Level: Integer;
Used: Boolean;
MinVersion, OnlyBelowVersion: TSetupVersionData;
Options: set of (coFixed, coRestart, coDisableNoUninstallWarning,
coExclusive, coDontInheritCheck);
{ internally used: }
Size: Integer64;
end;
const
SetupTaskEntryStrings = 6;
SetupTaskEntryAnsiStrings = 0;
type
PSetupTaskEntry = ^TSetupTaskEntry;
TSetupTaskEntry = packed record
Name, Description, GroupDescription, Components, Languages, Check: String;
Level: Integer;
Used: Boolean;
MinVersion, OnlyBelowVersion: TSetupVersionData;
Options: set of (toExclusive, toUnchecked, toRestart, toCheckedOnce,
toDontInheritCheck);
end;
const
SetupDirEntryStrings = 7;
SetupDirEntryAnsiStrings = 0;
type
PSetupDirEntry = ^TSetupDirEntry;
TSetupDirEntry = packed record
DirName: String;
Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
Attribs: Integer;
MinVersion, OnlyBelowVersion: TSetupVersionData;
PermissionsEntry: Smallint;
Options: set of (doUninsNeverUninstall, doDeleteAfterInstall,
doUninsAlwaysUninstall, doSetNTFSCompression, doUnsetNTFSCompression);
end;
const
SetupFileEntryStrings = 10;
SetupFileEntryAnsiStrings = 0;
type
PSetupFileEntry = ^TSetupFileEntry;
TSetupFileEntry = packed record
SourceFilename, DestName, InstallFontName, StrongAssemblyName: String;
Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
MinVersion, OnlyBelowVersion: TSetupVersionData;
LocationEntry: Integer;
Attribs: Integer;
ExternalSize: Integer64;
PermissionsEntry: Smallint;
Options: set of (foConfirmOverwrite, foUninsNeverUninstall, foRestartReplace,
foDeleteAfterInstall, foRegisterServer, foRegisterTypeLib, foSharedFile,
foCompareTimeStamp, foFontIsntTrueType,
foSkipIfSourceDoesntExist, foOverwriteReadOnly, foOverwriteSameVersion,
foCustomDestName, foOnlyIfDestFileExists, foNoRegError,
foUninsRestartDelete, foOnlyIfDoesntExist, foIgnoreVersion,
foPromptIfOlder, foDontCopy, foUninsRemoveReadOnly,
foRecurseSubDirsExternal, foReplaceSameVersionIfContentsDiffer,
foDontVerifyChecksum, foUninsNoSharedFilePrompt, foCreateAllSubDirs,
fo32Bit, fo64Bit, foExternalSizePreset, foSetNTFSCompression,
foUnsetNTFSCompression, foGacInstall);
FileType: (ftUserFile, ftUninstExe);
end;
const
SetupFileLocationEntryStrings = 0;
SetupFileLocationEntryAnsiStrings = 0;
type
TSetupFileLocationSign = (fsNoSetting, fsYes, fsOnce, fsCheck);
PSetupFileLocationEntry = ^TSetupFileLocationEntry;
TSetupFileLocationEntry = packed record
FirstSlice, LastSlice: Integer;
StartOffset: Longint;
ChunkSuboffset: Integer64;
OriginalSize: Integer64;
ChunkCompressedSize: Integer64;
SHA1Sum: TSHA1Digest;
SourceTimeStamp: TFileTime;
FileVersionMS, FileVersionLS: DWORD;
Flags: set of (foVersionInfoValid, foVersionInfoNotValid, foTimeStampInUTC,
foIsUninstExe, foCallInstructionOptimized, foApplyTouchDateTime,
foChunkEncrypted, foChunkCompressed, foSolidBreak);
Sign: TSetupFileLocationSign;
end;
const
SetupIconEntryStrings = 13;
SetupIconEntryAnsiStrings = 0;
type
TSetupIconCloseOnExit = (icNoSetting, icYes, icNo);
PSetupIconEntry = ^TSetupIconEntry;
TSetupIconEntry = packed record
IconName, Filename, Parameters, WorkingDir, IconFilename, Comment: String;
Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
AppUserModelID: String;
AppUserModelToastActivatorCLSID: TGUID;
MinVersion, OnlyBelowVersion: TSetupVersionData;
IconIndex, ShowCmd: Integer;
CloseOnExit: TSetupIconCloseOnExit;
HotKey: Word;
Options: set of (ioUninsNeverUninstall, ioCreateOnlyIfFileExists,
ioUseAppPaths, ioExcludeFromShowInNewInstall,
ioPreventPinning, ioHasAppUserModelToastActivatorCLSID);
end;
const
SetupIniEntryStrings = 10;
SetupIniEntryAnsiStrings = 0;
type
PSetupIniEntry = ^TSetupIniEntry;
TSetupIniEntry = packed record
Filename, Section, Entry, Value: String;
Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
MinVersion, OnlyBelowVersion: TSetupVersionData;
Options: set of (ioCreateKeyIfDoesntExist, ioUninsDeleteEntry,
ioUninsDeleteEntireSection, ioUninsDeleteSectionIfEmpty,
{ internally used: }
ioHasValue);
end;
const
SetupRegistryEntryStrings = 9;
SetupRegistryEntryAnsiStrings = 0;
type
PSetupRegistryEntry = ^TSetupRegistryEntry;
TSetupRegistryEntry = packed record
Subkey, ValueName, ValueData: String;
Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
MinVersion, OnlyBelowVersion: TSetupVersionData;
RootKey: HKEY;
PermissionsEntry: Smallint;
Typ: (rtNone, rtString, rtExpandString, rtDWord, rtBinary, rtMultiString, rtQWord);
Options: set of (roCreateValueIfDoesntExist, roUninsDeleteValue,
roUninsClearValue, roUninsDeleteEntireKey, roUninsDeleteEntireKeyIfEmpty,
roPreserveStringType, roDeleteKey, roDeleteValue, roNoError,
roDontCreateKey, ro32Bit, ro64Bit);
end;
const
SetupDeleteEntryStrings = 7;
SetupDeleteEntryAnsiStrings = 0;
type
TSetupDeleteType = (dfFiles, dfFilesAndOrSubdirs, dfDirIfEmpty);
PSetupDeleteEntry = ^TSetupDeleteEntry;
TSetupDeleteEntry = packed record
Name: String;
Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
MinVersion, OnlyBelowVersion: TSetupVersionData;
DeleteType: TSetupDeleteType;
end;
const
SetupRunEntryStrings = 13;
SetupRunEntryAnsiStrings = 0;
type
PSetupRunEntry = ^TSetupRunEntry;
TSetupRunEntry = packed record
Name, Parameters, WorkingDir, RunOnceId, StatusMsg, Verb: String;
Description, Components, Tasks, Languages, Check, AfterInstall, BeforeInstall: String;
MinVersion, OnlyBelowVersion: TSetupVersionData;
ShowCmd: Integer;
Wait: (rwWaitUntilTerminated, rwNoWait, rwWaitUntilIdle);
Options: set of (roShellExec, roSkipIfDoesntExist,
roPostInstall, roUnchecked, roSkipIfSilent, roSkipIfNotSilent,
roHideWizard, roRun32Bit, roRun64Bit, roRunAsOriginalUser,
roDontLogParameters, roLogOutput);
end;
const
MaxGrantPermissionEntries = 32; { must keep in synch with Helper.c }
type
{ TGrantPermissionEntry is stored inside string fields named 'Permissions' }
TGrantPermissionSid = record { must keep in synch with Helper.c }
Authority: TSIDIdentifierAuthority;
SubAuthCount: Byte;
SubAuth: array[0..1] of DWORD;
end;
TGrantPermissionEntry = record { must keep in synch with Helper.c }
Sid: TGrantPermissionSid;
AccessMask: DWORD;
end;
{ A TDiskSliceHeader record follows DiskSliceID in a SETUP-*.BIN file }
TDiskSliceHeader = packed record
TotalSize: Cardinal;
end;
{ A TMessageHeader record follows MessagesHdrID in a SETUP.MSG file }
TMessagesHeader = packed record
NumMessages: Cardinal;
TotalSize: Cardinal;
NotTotalSize: Cardinal;
CRCMessages: Longint;
end;
{ TSetupLdrOffsetTable is stored inside SetupLdr's SetupLdrOffsetTableResID
RCDATA resource }
PSetupLdrOffsetTable = ^TSetupLdrOffsetTable;
TSetupLdrOffsetTable = packed record
ID: array[1..12] of AnsiChar; { = SetupLdrOffsetTableID }
Version: LongWord; { = SetupLdrOffsetTableVersion }
TotalSize: LongWord; { Minimum expected size of setup.exe }
OffsetEXE: LongWord; { Offset of compressed setup.e32 }
UncompressedSizeEXE: LongWord; { Size of setup.e32 before compression }
CRCEXE: Longint; { CRC of setup.e32 before compression }
Offset0: LongWord; { Offset of embedded setup-0.bin data }
Offset1: LongWord; { Offset of embedded setup-1.bin data,
or 0 when DiskSpanning=yes }
TableCRC: Longint; { CRC of all prior fields in this record }
end;
{ TMessagesLangOptions is a simplified version of TSetupLanguageEntry that
is used by the uninstaller and RegSvr }
TMessagesLangOptions = packed record
ID: TMessagesLangOptionsID;
DialogFontName: array[0..31] of Char;
DialogFontSize: Integer;
Flags: set of (lfRightToLeft);
end;
TUninstallerMsgTail = packed record
ID: Longint;
Offset: Longint;
end;
const
SetupLdrOffsetTableResID = 11111;
SetupLdrOffsetTableID = 'rDlPtS'#$CD#$E6#$D7#$7B#$0B#$2A;
SetupLdrOffsetTableVersion = 1;
SetupExeModeOffset = $30;
SetupExeModeUninstaller = $6E556E49;
SetupExeModeRegSvr = $53526E49;
UninstallerMsgTailID = $67734D49;
implementation
end.