forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScriptFunc.pas
562 lines (513 loc) · 29.7 KB
/
ScriptFunc.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
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
unit ScriptFunc;
{
Inno Setup
Copyright (C) 1997-2024 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Script support functions (listings - used by Compil32, ISCmplr, and Setup)
Script constants, types, etc (listings - used by Compil32)
}
interface
type
TScriptFuncTableID = (sftScriptDlg, sftNewDisk, sftBrowseFunc, sftCmnFunc,
sftCmnFunc2, sftInstall, sftInstFunc, sftInstFnc2, sftMain, sftMsgs,
sftSystem, sftSysUtils, sftVerInfo, sftWindows, sftOle2, sftLogging,
sftOther);
TScriptTable = array of AnsiString;
var
ScriptFuncTables: array [TScriptFuncTableID] of TScriptTable; { Initialized below }
DelphiScriptFuncTable: TScriptTable =
[
'function FmtMessage(const S: String; const Args: array of String): String;',
'function FindFirst(const FileName: String; var FindRec: TFindRec): Boolean;',
'function FindNext(var FindRec: TFindRec): Boolean;',
'procedure FindClose(var FindRec: TFindRec);',
'function Format(const Format: String; const Args: array of const): String;',
'procedure GetWindowsVersionEx(var Version: TWindowsVersion);'
];
{$IFDEF COMPIL32PROJ}
{ These are just for Compil32 and should not be used by ISCmplr or Setup because
they're already registered by TPSPascalCompiler.DefineStandardProcedures and
TPSExec.RegisterStandardProc }
ROPSScriptFuncTable: TScriptTable =
[
'function StrToIntDef(S: String; Def: LongInt): LongInt;',
'function StrToInt(S: String): LongInt;',
'function StrToInt64Def(S: String; Def: Int64): Int64;',
'function StrToInt64(S: String): Int64;',
'function StrToFloat(S: String): Extended;',
'function IntToStr(I: Int64): String;',
'function FloatToStr(E: Extended): String;',
'function Copy(S: AnyString; Index, Count: Integer): String;',
'function Length(S: AnyString): LongInt;',
'procedure SetLength(var S: AnyString; L: LongInt);',
'function Lowercase(S: AnyString): String;',
'function Uppercase(S: AnyString): String;',
'function AnsiLowercase(S: AnyString): String;',
'function AnsiUppercase(S: AnyString): String;',
'function StringOfChar(C: Char; I : LongInt): String;',
'procedure Delete(var S: AnyString; Index, Count: Integer);',
'procedure Insert(Source: AnyString; var Dest: AnyString; Index: Integer);',
'function Pos(SubStr, S: AnyString): Integer;',
'function GetArrayLength(var Arr: Array): LongInt;',
'procedure SetArrayLength(var Arr: Array; I: LongInt);',
'function Trim(const S: AnyString): AnyString;',
'function Null: Variant;',
'function Unassigned: Variant;',
'function VarIsEmpty(const V: Variant): Boolean;',
'function VarIsClear(const V: Variant): Boolean;',
'function VarIsNull(const V: Variant): Boolean;',
'function VarType(const V: Variant): TVarType;',
'function VarArrayGet(var S: Variant; I: Integer): Variant;',
'procedure VarArraySet(C: Variant; I: Integer; var S: Variant);',
'function IDispatchInvoke(Self: IDispatch; PropertySet: Boolean; const Name: String; Par: array of Variant): Variant;',
{ Special functions: undocumented but listing anyway }
'function Low(var X): Int64;',
'function High(var X): Int64;',
'procedure Dec(var X: Ordinal);',
'procedure Inc(var X: Ordinal);',
'procedure Include(var S: Set; I: Ordinal);',
'procedure Exclude(var S: Set; I: Ordinal);',
'function SizeOf(var X): LongInt;'
];
{ ROPSUndocumentedScriptFuncTable: TScriptTable =
[
'function StrGet(var S: String; I: Integer): Char;',
'function StrGet2(S: String; I: Integer): Char;',
'procedure StrSet(C: Char; I: Integer; var S: String);',
'function WStrGet(var S: AnyString; I: Integer): WideChar;',
'procedure WStrSet(C: AnyString; I: Integer; var S: AnyString);',
'function Sin(E: Extended): Extended;',
'function Cos(E: Extended): Extended;',
'function Sqrt(E: Extended): Extended;',
'function Round(E: Extended): LongInt;',
'function Trunc(E: Extended): LongInt;',
'function Int(E: Extended): Extended;',
'function Pi: Extended;',
'function Abs(E: Extended): Extended;',
'function PadL(S: AnyString; I: LongInt): AnyString;',
'function PadR(S: AnyString; I: LongInt): AnyString;',
'function PadZ(S: AnyString; I: LongInt): AnyString;',
'function Replicate(C: Char; I: LongInt): String;',
'procedure RaiseLastException;',
'procedure RaiseException(Ex: TIFException; Param: String);',
'function ExceptionType: TIFException;',
'function ExceptionParam: String;',
'function ExceptionProc: Cardinal;',
'function ExceptionPos: Cardinal;',
'function ExceptionToString(er: TIFException; Param: String): String;',
'function Int64ToStr(I: Int64): String;'
]; }
{$ENDIF}
function ScriptFuncHasParameters(const ScriptFunc: AnsiString): Boolean;
function RemoveScriptFuncHeader(const ScriptFunc: AnsiString): AnsiString; overload;
function RemoveScriptFuncHeader(const ScriptFunc: AnsiString; out WasFunction: Boolean): AnsiString; overload;
function ExtractScriptFuncWithoutHeaderName(const ScriptFuncWithoutHeader: AnsiString): AnsiString;
function ExtractScriptFuncName(const ScriptFunc: AnsiString): AnsiString;
implementation
uses
SysUtils, AnsiStrings;
function ScriptFuncHasParameters(const ScriptFunc: AnsiString): Boolean;
begin
const C: AnsiString = '(';
Result := Pos(C, ScriptFunc) <> 0;
end;
function RemoveScriptFuncHeader(const ScriptFunc: AnsiString): AnsiString;
begin
var Dummy: Boolean;
Result := RemoveScriptFuncHeader(ScriptFunc, Dummy);
end;
function RemoveScriptFuncHeader(const ScriptFunc: AnsiString; out WasFunction: Boolean): AnsiString;
begin
Result := ScriptFunc;
const H1: AnsiString = 'function ';
const H2: AnsiString = 'procedure ';
WasFunction := CompareText(Copy(Result, 1, Length(H1)), H1) = 0;
if WasFunction then
Delete(Result, 1, Length(H1))
else if CompareText(Copy(Result, 1, Length(H2)), H2) = 0 then
Delete(Result, 1, Length(H2))
else
raise Exception.CreateFmt('Invalid FunctionDefinition: %s', [Result]);
end;
function ExtractScriptFuncWithoutHeaderName(const ScriptFuncWithoutHeader: AnsiString): AnsiString;
begin
Result := ScriptFuncWithoutHeader;
const C1: AnsiString = '(';
const C2: AnsiString = ':';
const C3: AnsiString = ';';
var P := Pos(C1, Result);
if P = 0 then
P := Pos(C2, Result);
if P = 0 then
P := Pos(C3, Result);
if P = 0 then
raise Exception.CreateFmt('Invalid FunctionDefinitionWithoutHeader: %s', [Result]);
Delete(Result, P, Maxint);
end;
function ExtractScriptFuncName(const ScriptFunc: AnsiString): AnsiString;
begin
Result := ExtractScriptFuncWithoutHeaderName(RemoveScriptFuncHeader(ScriptFunc));
end;
{$IFDEF COMPIL32PROJ}
{$IFDEF DEBUG}
function IsCleanScriptFunc(const ScriptFunc: AnsiString): Boolean;
begin
const GoodTerminator: AnsiString = ';';
const BadType1: AnsiString = 'string';
const BadType2: AnsiString = 'Longint';
Result := (Pos(GoodTerminator, ScriptFunc) <> 0) and
(Pos(BadType1, ScriptFunc) = 0) and (Pos(BadType2, ScriptFunc) = 0) and
(ScriptFunc[Length(ScriptFunc)] = ';');
end;
procedure CheckIsCleanScriptFuncTable(const ScriptFuncTable: TScriptTable);
begin
if Length(ScriptFuncTable) = 0 then
raise Exception.Create('Length(ScriptFuncTable) = 0');
for var AScriptFunc in ScriptFuncTable do
if not IsCleanScriptFunc(AScriptFunc) then
raise Exception.CreateFmt('not IsCleanScriptFunc: %s', [AScriptFunc]);
end;
{$ENDIF}
{$ENDIF}
initialization
{ ScriptDlg }
ScriptFuncTables[sftScriptDlg] :=
[
'function PageFromID(const ID: Integer): TWizardPage;',
'function PageIndexFromID(const ID: Integer): Integer;',
'function CreateCustomPage(const AfterID: Integer; const ACaption, ADescription: String): TWizardPage;',
'function CreateInputQueryPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputQueryWizardPage;',
'function CreateInputOptionPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; Exclusive, ListBox: Boolean): TInputOptionWizardPage;',
'function CreateInputDirPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; AAppendDir: Boolean; ANewFolderName: String): TInputDirWizardPage;',
'function CreateInputFilePage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputFileWizardPage;',
'function CreateOutputMsgPage(const AfterID: Integer; const ACaption, ADescription, AMsg: String): TOutputMsgWizardPage;',
'function CreateOutputMsgMemoPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; const AMsg: AnsiString): TOutputMsgMemoWizardPage;',
'function CreateOutputProgressPage(const ACaption, ADescription: String): TOutputProgressWizardPage;',
'function CreateOutputMarqueeProgressPage(const ACaption, ADescription: String): TOutputMarqueeProgressWizardPage;',
'function CreateDownloadPage(const ACaption, ADescription: String; const OnDownloadProgress: TOnDownloadProgress): TDownloadWizardPage;',
'function ScaleX(X: Integer): Integer;',
'function ScaleY(Y: Integer): Integer;',
'function CreateCustomForm: TSetupForm;'
];
{ NewDisk }
ScriptFuncTables[sftNewDisk] :=
[
'function SelectDisk(const DiskNumber: Integer; const AFilename: String; var Path: String): Boolean;'
];
{ BrowseFunc }
ScriptFuncTables[sftBrowseFunc] :=
[
'function BrowseForFolder(const Prompt: String; var Directory: String; const NewFolderButton: Boolean): Boolean;',
'function GetOpenFileName(const Prompt: String; var FileName: String; const InitialDirectory, Filter, DefaultExtension: String): Boolean;',
'function GetOpenFileNameMulti(const Prompt: String; const FileNameList: TStrings; const InitialDirectory, Filter, DefaultExtension: String): Boolean;',
'function GetSaveFileName(const Prompt: String; var FileName: String; const InitialDirectory, Filter, DefaultExtension: String): Boolean;'
];
{ CmnFunc }
ScriptFuncTables[sftCmnFunc] :=
[
'function MinimizePathName(const Filename: String; const Font: TFont; MaxLen: Integer): String;'
];
{ CmnFunc2 }
ScriptFuncTables[sftCmnFunc2] :=
[
'function FileExists(const Name: String): Boolean;',
'function DirExists(const Name: String): Boolean;',
'function FileOrDirExists(const Name: String): Boolean;',
'function GetIniString(const Section, Key, Default, Filename: String): String;',
'function GetIniInt(const Section, Key: String; const Default, Min, Max: LongInt; const Filename: String): LongInt;',
'function GetIniBool(const Section, Key: String; const Default: Boolean; const Filename: String): Boolean;',
'function IniKeyExists(const Section, Key, Filename: String): Boolean;',
'function IsIniSectionEmpty(const Section, Filename: String): Boolean;',
'function SetIniString(const Section, Key, Value, Filename: String): Boolean;',
'function SetIniInt(const Section, Key: String; const Value: LongInt; const Filename: String): Boolean;',
'function SetIniBool(const Section, Key: String; const Value: Boolean; const Filename: String): Boolean;',
'procedure DeleteIniEntry(const Section, Key, Filename: String);',
'procedure DeleteIniSection(const Section, Filename: String);',
'function GetEnv(const EnvVar: String): String;',
'function GetCmdTail: String;',
'function ParamCount: Integer;',
'function ParamStr(Index: Integer): String;',
'function AddBackslash(const S: String): String;',
'function RemoveBackslash(const S: String): String;',
'function RemoveBackslashUnlessRoot(const S: String): String;',
'function AddQuotes(const S: String): String;',
'function RemoveQuotes(const S: String): String;',
'function GetShortName(const LongName: String): String;',
'function GetWinDir: String;',
'function GetSystemDir: String;',
'function GetSysWow64Dir: String;',
'function GetSysNativeDir: String;',
'function GetTempDir: String;',
'function StringChange(var S: String; const FromStr, ToStr: String): Integer;',
'function StringChangeEx(var S: String; const FromStr, ToStr: String; const SupportDBCS: Boolean): Integer;',
'function UsingWinNT: Boolean;',
'function FileCopy(const ExistingFile, NewFile: String; const FailIfExists: Boolean): Boolean;',
'function ConvertPercentStr(var S: String): Boolean;',
'function RegValueExists(const RootKey: Integer; const SubKeyName, ValueName: String): Boolean;',
'function RegQueryStringValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;',
'function RegQueryMultiStringValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;',
'function RegDeleteKeyIncludingSubkeys(const RootKey: Integer; const SubkeyName: String): Boolean;',
'function RegDeleteKeyIfEmpty(const RootKey: Integer; const SubkeyName: String): Boolean;',
//not really in CmnFunc2
'function RegKeyExists(const RootKey: Integer; const SubKeyName: String): Boolean;',
'function RegDeleteValue(const RootKey: Integer; const SubKeyName, ValueName: String): Boolean;',
'function RegGetSubkeyNames(const RootKey: Integer; const SubKeyName: String; var Names: TArrayOfString): Boolean;',
'function RegGetValueNames(const RootKey: Integer; const SubKeyName: String; var Names: TArrayOfString): Boolean;',
'function RegQueryDWordValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultDWord: Cardinal): Boolean;',
'function RegQueryBinaryValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: AnsiString): Boolean;',
'function RegWriteStringValue(const RootKey: Integer; const SubKeyName, ValueName, Data: String): Boolean;',
'function RegWriteExpandStringValue(const RootKey: Integer; const SubKeyName, ValueName, Data: String): Boolean;',
'function RegWriteMultiStringValue(const RootKey: Integer; const SubKeyName, ValueName, Data: String): Boolean;',
'function RegWriteDWordValue(const RootKey: Integer; const SubKeyName, ValueName: String; const Data: Cardinal): Boolean;',
'function RegWriteBinaryValue(const RootKey: Integer; const SubKeyName, ValueName: String; const Data: AnsiString): Boolean;',
//
'function IsAdmin: Boolean;',
'function IsAdminLoggedOn: Boolean;', { old name of IsAdmin }
'function IsPowerUserLoggedOn: Boolean;',
'function IsAdminInstallMode: Boolean;',
'function FontExists(const FaceName: String): Boolean;',
'function GetUILanguage: Integer;',
'function AddPeriod(const S: String): String;',
'function CharLength(const S: String; const Index: Integer): Integer;',
'function SetNTFSCompression(const FileOrDir: String; Compress: Boolean): Boolean;',
'function IsWildcard(const Pattern: String): Boolean;',
'function WildcardMatch(const Text, Pattern: String): Boolean;'
];
{ Install }
ScriptFuncTables[sftInstall] :=
[
'procedure ExtractTemporaryFile(const FileName: String);',
'function ExtractTemporaryFiles(const Pattern: String): Integer;',
'function DownloadTemporaryFile(const Url, FileName, RequiredSHA256OfFile: String; const OnDownloadProgress: TOnDownloadProgress): Int64;',
'function DownloadTemporaryFileSize(const Url: String): Int64;',
'function DownloadTemporaryFileDate(const Url: String): String;',
'procedure SetDownloadCredentials(const User, Pass: String);'
];
{ InstFunc }
ScriptFuncTables[sftInstFunc] :=
[
'function CheckForMutexes(Mutexes: String): Boolean;',
'function DecrementSharedCount(const Is64Bit: Boolean; const Filename: String): Boolean;',
'procedure DelayDeleteFile(const Filename: String; const Tries: Integer);',
'function DelTree(const Path: String; const IsDir, DeleteFiles, DeleteSubdirsAlso: Boolean): Boolean;',
'function GenerateUniqueName(Path: String; const Extension: String): String;',
'function GetComputerNameString: String;',
//function GetFileDateTime(const Filename: String; var DateTime: TFileTime): Boolean;
'function GetMD5OfFile(const Filename: String): String;',
'function GetMD5OfString(const S: AnsiString): String;',
'function GetMD5OfUnicodeString(const S: String): String;',
'function GetSHA1OfFile(const Filename: String): String;',
'function GetSHA1OfString(const S: AnsiString): String;',
'function GetSHA1OfUnicodeString(const S: String): String;',
'function GetSHA256OfFile(const Filename: String): String;',
'function GetSHA256OfString(const S: AnsiString): String;',
'function GetSHA256OfUnicodeString(const S: String): String;',
'function GetSpaceOnDisk(const DriveRoot: String; const InMegabytes: Boolean; var Free, Total: Cardinal): Boolean;',
'function GetSpaceOnDisk64(const DriveRoot: String; var Free, Total: Int64): Boolean;',
'function GetUserNameString: String;',
//function GrantPermissionOnFile(const Filename: String; const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
//function GrantPermissionOnKey(const RootKey: HKEY; const Subkey: String; const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
'procedure IncrementSharedCount(const Is64Bit: Boolean; const Filename: String; const AlreadyExisted: Boolean);',
'function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;',
'function ExecAndCaptureOutput(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; var Output: TExecOutput): Boolean;',
'function ExecAndLogOutput(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; const OnLog: TOnLog): Boolean;',
'function ExecAsOriginalUser(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;',
'function ShellExec(const Verb, Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ErrorCode: Integer): Boolean;',
'function ShellExecAsOriginalUser(const Verb, Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ErrorCode: Integer): Boolean;',
'function IsProtectedSystemFile(const Filename: String): Boolean;',
'function MakePendingFileRenameOperationsChecksum: String;',
'function ModifyPifFile(const Filename: String; const CloseOnExit: Boolean): Boolean;',
'procedure RegisterServer(const Is64Bit: Boolean; const Filename: String; const FailCriticalErrors: Boolean);',
'function UnregisterServer(const Is64Bit: Boolean; const Filename: String; const FailCriticalErrors: Boolean): Boolean;',
'procedure UnregisterFont(const FontName, FontFilename: String; const PerUserFont: Boolean);',
//procedure RestartComputer;
'procedure RestartReplace(const TempFile, DestFile: String);',
//procedure Win32ErrorMsg(const FunctionName: String);
'function ForceDirectories(Dir: String): Boolean;'
];
{ InstFnc2 }
ScriptFuncTables[sftInstFnc2] :=
[
'function CreateShellLink(const Filename, Description, ShortcutTo, Parameters, WorkingDir, IconFilename: String; const IconIndex, ShowCmd: Integer): String;',
'procedure RegisterTypeLibrary(const Is64Bit: Boolean; const Filename: String);',
'function UnregisterTypeLibrary(const Is64Bit: Boolean; const Filename: String): Boolean;',
'function UnpinShellLink(const Filename: String): Boolean;'
];
{ Main }
ScriptFuncTables[sftMain] :=
[
'function GetWizardForm: TWizardForm;',
'function GetMainForm: TMainForm;',
'function ActiveLanguage: String;',
'function WizardIsComponentSelected(const Components: String): Boolean;',
'function IsComponentSelected(const Components: String): Boolean;', { old name of WizardIsComponentSelected }
'function WizardIsTaskSelected(const Tasks: String): Boolean;',
'function IsTaskSelected(const Tasks: String): Boolean;', { old name of WizardIsTaskSelected }
'function ExpandConstant(const S: String): String;',
'function ExpandConstantEx(const S: String; const CustomConst, CustomValue: String): String;',
'function ExitSetupMsgBox: Boolean;',
'function GetShellFolderByCSIDL(const Folder: Integer; const Create: Boolean): String;',
'function InstallOnThisVersion(const MinVersion, OnlyBelowVersion: String): Boolean;',
'function GetWindowsVersion: Cardinal;',
'function GetWindowsVersionString: String;',
'function MsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons: Integer): Integer;',
'function SuppressibleMsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons, Default: Integer): Integer;',
'function TaskDialogMsgBox(const Instruction, Text: String; const Typ: TMsgBoxType; const Buttons: Cardinal; const ButtonLabels: TArrayOfString; const ShieldButton: Integer): Integer;',
'function SuppressibleTaskDialogMsgBox(const Instruction, Text: String; const Typ: TMsgBoxType; const Buttons: Cardinal; const ButtonLabels: TArrayOfString; const ShieldButton: Integer;'+' const Default: Integer): Integer;',
'function IsWin64: Boolean;',
'function Is64BitInstallMode: Boolean;',
'function ProcessorArchitecture: TSetupProcessorArchitecture;',
'function IsArm32Compatible: Boolean;',
'function IsArm64: Boolean;',
'function IsX64: Boolean;',
'function IsX64OS: Boolean;',
'function IsX64Compatible: Boolean;',
'function IsX86: Boolean;',
'function IsX86OS: Boolean;',
'function IsX86Compatible: Boolean;',
'function CustomMessage(const MsgName: String): String;',
'function RmSessionStarted: Boolean;',
'function RegisterExtraCloseApplicationsResource(const DisableFsRedir: Boolean; const AFilename: String): Boolean;'
];
{ Msgs }
ScriptFuncTables[sftMsgs] :=
[
'function SetupMessage(const ID: TSetupMessageID): String;'
];
{ System }
ScriptFuncTables[sftSystem] :=
[
'function Random(const Range: Integer): Integer;',
'function FileSize(const Name: String; var Size: Integer): Boolean;',
'function FileSize64(const Name: String; var Size: Int64): Boolean;',
'procedure Set8087CW(NewCW: Word);',
'function Get8087CW: Word;',
'function UTF8Encode(const S: String): AnsiString;',
'function UTF8Decode(const S: AnsiString): String;'
];
{ SysUtils }
ScriptFuncTables[sftSysUtils] :=
[
'procedure Beep;',
'function TrimLeft(const S: String): String;',
'function TrimRight(const S: String): String;',
'function GetCurrentDir: String;',
'function SetCurrentDir(const Dir: String): Boolean;',
'function ExpandFileName(const FileName: String): String;',
'function ExpandUNCFileName(const FileName: String): String;',
'function ExtractRelativePath(const BaseName, DestName: String): String;',
'function ExtractFileDir(const FileName: String): String;',
'function ExtractFileDrive(const FileName: String): String;',
'function ExtractFileExt(const FileName: String): String;',
'function ExtractFileName(const FileName: String): String;',
'function ExtractFilePath(const FileName: String): String;',
'function ChangeFileExt(const FileName, Extension: String): String;',
'function FileSearch(const Name, DirList: String): String;',
'function RenameFile(const OldName, NewName: String): Boolean;',
'function DeleteFile(const FileName: String): Boolean;',
'function CreateDir(const Dir: String): Boolean;',
'function RemoveDir(const Dir: String): Boolean;',
'function CompareStr(const S1, S2: String): Integer;',
'function CompareText(const S1, S2: String): Integer;',
'function SameStr(const S1, S2: String): Boolean;',
'function SameText(const S1, S2: String): Boolean;',
'function GetDateTimeString(const DateTimeFormat: String; const DateSeparator, TimeSeparator: Char): String;',
'function SysErrorMessage(ErrorCode: Integer): String;'
];
{ VerInfo }
ScriptFuncTables[sftVerInfo] :=
[
'function GetVersionNumbers(const Filename: String; var VersionMS, VersionLS: Cardinal): Boolean;',
'function GetVersionComponents(const Filename: String; var Major, Minor, Revision, Build: Word): Boolean;',
'function GetVersionNumbersString(const Filename: String; var Version: String): Boolean;',
'function GetPackedVersion(const Filename: String; var Version: Int64): Boolean;',
'function PackVersionNumbers(const VersionMS, VersionLS: Cardinal): Int64;',
'function PackVersionComponents(const Major, Minor, Revision, Build: Word): Int64;',
'function ComparePackedVersion(const Version1, Version2: Int64): Integer;',
'function SamePackedVersion(const Version1, Version2: Int64): Boolean;',
'procedure UnpackVersionNumbers(const Version: Int64; var VersionMS, VersionLS: Cardinal);',
'procedure UnpackVersionComponents(const Version: Int64; var Major, Minor, Revision, Build: Word);',
'function VersionToStr(const Version: Int64): String;',
'function StrToVersion(const VersionString: String; var Version: Int64): Boolean;'
];
{ Windows }
ScriptFuncTables[sftWindows] :=
[
'procedure Sleep(const Milliseconds: LongInt);',
'function FindWindowByClassName(const ClassName: String): HWND;',
'function FindWindowByWindowName(const WindowName: String): HWND;',
'function SendMessage(const Wnd: HWND; const Msg, WParam, LParam: LongInt): LongInt;',
'function PostMessage(const Wnd: HWND; const Msg, WParam, LParam: LongInt): Boolean;',
'function SendNotifyMessage(const Wnd: HWND; const Msg, WParam, LParam: LongInt): Boolean;',
'function RegisterWindowMessage(const Name: String): LongInt;',
'function SendBroadcastMessage(const Msg, WParam, LParam: LongInt): LongInt;',
'function PostBroadcastMessage(const Msg, WParam, LParam: LongInt): Boolean;',
'function SendBroadcastNotifyMessage(const Msg, WParam, LParam: LongInt): Boolean;',
'function LoadDLL(const DLLName: String; var ErrorCode: Integer): LongInt;',
'function CallDLLProc(const DLLHandle: LongInt; const ProcName: String; const Param1, Param2: LongInt; var Result: LongInt): Boolean;',
'function FreeDLL(const DLLHandle: LongInt): Boolean;',
'procedure CreateMutex(const Name: String);',
'procedure OemToCharBuff(var S: AnsiString);',
'procedure CharToOemBuff(var S: AnsiString);'
];
{ Ole2 }
ScriptFuncTables[sftOle2] :=
[
'procedure CoFreeUnusedLibraries;'
];
{ Logging }
ScriptFuncTables[sftLogging] :=
[
'procedure Log(const S: String);'
];
{ Other }
ScriptFuncTables[sftOther] :=
[
'procedure BringToFrontAndRestore;',
'function WizardDirValue: String;',
'function WizardGroupValue: String;',
'function WizardNoIcons: Boolean;',
'function WizardSetupType(const Description: Boolean): String;',
'function WizardSelectedComponents(const Descriptions: Boolean): String;',
'function WizardSelectedTasks(const Descriptions: Boolean): String;',
'procedure WizardSelectComponents(const Components: String);',
'procedure WizardSelectTasks(const Tasks: String);',
'function WizardSilent: Boolean;',
'function IsUninstaller: Boolean;',
'function UninstallSilent: Boolean;',
'function CurrentFilename: String;',
'function CurrentSourceFilename: String;',
'function CastStringToInteger(var S: String): LongInt;',
'function CastIntegerToString(const L: LongInt): String;',
'procedure Abort;',
'function GetExceptionMessage: String;',
'procedure RaiseException(const Msg: String);',
'procedure ShowExceptionMessage;',
'function Terminated: Boolean;',
'function GetPreviousData(const ValueName, DefaultValueData: String): String;',
'function SetPreviousData(const PreviousDataKey: Integer; const ValueName, ValueData: String): Boolean;',
'function LoadStringFromFile(const FileName: String; var S: AnsiString): Boolean;',
'function LoadStringFromLockedFile(const FileName: String; var S: AnsiString): Boolean;',
'function LoadStringsFromFile(const FileName: String; var S: TArrayOfString): Boolean;',
'function LoadStringsFromLockedFile(const FileName: String; var S: TArrayOfString): Boolean;',
'function SaveStringToFile(const FileName: String; const S: AnsiString; const Append: Boolean): Boolean;',
'function SaveStringsToFile(const FileName: String; const S: TArrayOfString; const Append: Boolean): Boolean;',
'function SaveStringsToUTF8File(const FileName: String; const S: TArrayOfString; const Append: Boolean): Boolean;',
'function SaveStringsToUTF8FileWithoutBOM(const FileName: String; const S: TArrayOfString; const Append: Boolean): Boolean;',
'function EnableFsRedirection(const Enable: Boolean): Boolean;',
'function GetUninstallProgressForm: TUninstallProgressForm;',
'function CreateCallback(Method: AnyMethod): Longword;',
'function IsDotNetInstalled(const MinVersion: TDotNetVersion; const MinServicePack: Cardinal): Boolean;',
'function IsMsiProductInstalled(const UpgradeCode: String; const PackedMinVersion: Int64): Boolean;',
'function InitializeBitmapImageFromIcon(const BitmapImage: TBitmapImage; const IconFilename: String; const BkColor: TColor; const AscendingTrySizes: TArrayOfInteger): Boolean;'
];
{$IFDEF COMPIL32PROJ}
{$IFDEF DEBUG}
for var ScriptFuncTable in ScriptFuncTables do
CheckIsCleanScriptFuncTable(ScriptFuncTable);
CheckIsCleanScriptFuncTable(DelphiScriptFuncTable);
CheckIsCleanScriptFuncTable(ROPSScriptFuncTable);
{$ENDIF}
{$ENDIF}
end.