forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisxfunc.xml
2621 lines (2561 loc) · 155 KB
/
isxfunc.xml
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
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" standalone="yes" ?>
<isxhelp version="1.0">
<copyright>
Inno Setup
Copyright (C) 1997-2012 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
</copyright>
<isxfunc>
<category>
<description>Setup or Uninstall Info</description>
<subcategory>
<function>
<name>GetCmdTail</name>
<prototype>function GetCmdTail: String;</prototype>
<description><p>Returns all command line parameters passed to Setup or Uninstall as a single string.</p></description>
</function>
<function>
<name>ParamCount</name>
<prototype>function ParamCount: Integer;</prototype>
<description><p>Returns the number of command line parameters passed to Setup or Uninstall.</p></description>
</function>
<function>
<name>ParamStr</name>
<prototype>function ParamStr(Index: Integer): String;</prototype>
<description><p>Returns the Index-th command line parameter passed to Setup or Uninstall.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>ActiveLanguage</name>
<prototype>function ActiveLanguage: String;</prototype>
<description><p>Returns the name of the active language.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>CustomMessage</name>
<prototype>function CustomMessage(const MsgName: String): String;</prototype>
<description><p>Returns the value of the [CustomMessages] entry with the specified name. If an entry with the specified name does not exist, an exception will be raised.</p></description>
<example><pre>var
S: String;
begin
S := CustomMessage('CreateDesktopIcon');
// S = 'Create a &desktop icon'
S := FmtMessage(CustomMessage('NameAndVersion'), ['My Program', '1.0']);
// S = 'My Program version 1.0'
end;</pre></example>
</function>
<function>
<name>FmtMessage</name>
<prototype>function FmtMessage(const S: String; const Args: array of String): String;</prototype>
<description><p>Formats the string S using the specified string arguments. A <tt>%1</tt> in the format string will be replaced with the first value in the Args array; a <tt>%2</tt> will be replaced with the second value; and so on. <tt>%%</tt> will be replaced with <tt>%</tt>.</p></description>
<remarks><p>If a <tt>%</tt>-specifier references a non-existing argument, it will be returned untouched. No exception will be raised.</p></remarks>
<example><pre>var
S: String;
begin
S := FmtMessage('%1 version %2 will be installed.', ['My Program', '1.0']);
// S = 'My Program version 1.0 will be installed.'
S := FmtMessage(SetupMessage(msgNotOnThisPlatform), ['Windows 2000']);
// S = 'This program will not run on Windows 2000.'
end;</pre></example>
</function>
<function>
<name>SetupMessage</name>
<prototype>function SetupMessage(const ID: TSetupMessageID): String;</prototype>
<description><p>Returns the value of the specified message.</p></description>
<example><pre>var
S: String;
begin
S := SetupMessage(msgButtonNext);
// S now equals '&Next >'
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>WizardDirValue</name>
<prototype>function WizardDirValue: String;</prototype>
<description><p>Returns the current contents of the edit control on the <i>Select Destination Location</i> page of the wizard.</p>
<p>Unlike <tt>ExpandConstant('{app}')</tt>, this function will not fail if called after the wizard is shown but prior to the user selecting a directory. Rather, it will return the default directory name.</p></description>
</function>
<function>
<name>WizardGroupValue</name>
<prototype>function WizardGroupValue: String;</prototype>
<description><p>Returns the current contents of the edit control on the <i>Select Start Menu Folder</i> page of the wizard.</p>
<p>Unlike <tt>ExpandConstant('{group}')</tt>, this function will not fail if called after the wizard is shown but prior to the user selecting a folder. Rather, it will return the default folder name.</p></description>
</function>
<function>
<name>WizardNoIcons</name>
<prototype>function WizardNoIcons: Boolean;</prototype>
<description><p>Returns the current setting of the <i>Don't create a Start Menu folder</i> check box on the <i>Select Start Menu Folder</i> page of the wizard.</p></description>
</function>
<function>
<name>WizardSetupType</name>
<prototype>function WizardSetupType(const Description: Boolean): String;</prototype>
<description><p>Returns the name or description of the setup type selected by the user.</p></description>
</function>
<function>
<name>WizardSelectedComponents</name>
<prototype>function WizardSelectedComponents(const Descriptions: Boolean): String;</prototype>
<description><p>Returns a comma-separated list of names or descriptions of the components selected by the user.</p></description>
</function>
<function>
<name>WizardSelectedTasks</name>
<prototype>function WizardSelectedTasks(const Descriptions: Boolean): String;</prototype>
<description><p>Returns a comma-separated list of names or descriptions of the tasks selected by the user.</p></description>
</function>
<function>
<name>WizardSilent</name>
<prototype>function WizardSilent: Boolean;</prototype>
<description><p>Returns True if Setup is running silently, False otherwise.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>IsUninstaller</name>
<prototype>function IsUninstaller: Boolean;</prototype>
<description><p>Returns True if Uninstall is running as opposed to Setup, False otherwise.</p></description>
</function>
<function>
<name>UninstallSilent</name>
<prototype>function UninstallSilent: Boolean;</prototype>
<description><p>Returns True if Uninstall is running silently, False otherwise.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>CurrentFilename</name>
<prototype>function CurrentFilename: String;</prototype>
<description><p>Returns the destination file name of the [Files] entry that is currently being processed. The returned name may include constants.</p>
<p>Do not attempt to call this function from outside a Check, BeforeInstall or AfterInstall event function belonging to a [Files] entry.</p></description>
</function>
<function>
<name>CurrentSourceFilename</name>
<prototype>function CurrentSourceFilename: String;</prototype>
<description><p>Returns the source file name of the [Files] entry that is currently being processed. The returned name may include constants.</p>
<p>Do not attempt to call this function from outside a Check, BeforeInstall or AfterInstall event function belonging to a [Files] entry with the "external" flag.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>ExpandConstant</name>
<prototype>function ExpandConstant(const S: String): String;</prototype>
<description><p>Changes all constants in S to their values. For example, ExpandConstant('{srcexe}') is changed to the filename of Setup.</p>
<p>An exception will be raised if there was an error expanding the constants.</p></description>
</function>
<function>
<name>ExpandConstantEx</name>
<prototype>function ExpandConstantEx(const S: String; const CustomConst, CustomValue: String): String;</prototype>
<description><p>Changes all constants in S to their values. Additionally, any constant equal to CustomConst will be changed to CustomValue.</p>
<p>An exception will be raised if there was an error expanding the constants.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>IsComponentSelected</name>
<prototype>function IsComponentSelected(const Components: String): Boolean;</prototype>
<description><p>Returns True if the specified component is selected. Multiple components may be specified in the same manner as in a <link topic="componentstasksparams" window="main">Components parameter</link>.</p></description>
<example><pre>begin
if IsComponentSelected('helpfiles') then
// the 'helpfiles' component is selected
end;</pre></example>
</function>
<function>
<name>IsTaskSelected</name>
<prototype>function IsTaskSelected(const Tasks: String): Boolean;</prototype>
<description><p>Returns True if the specified task is selected. Multiple tasks may be specified in the same manner as in a <link topic="componentstasksparams" window="main">Tasks parameter</link>.</p></description>
<example><pre>begin
if IsTaskSelected('desktopicon') then
// the 'desktopicon' task is selected
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>ExtractTemporaryFile</name>
<prototype>procedure ExtractTemporaryFile(const FileName: String);</prototype>
<description><p>Extracts the specified file from the [Files] section to a temporary directory. To find the location of the temporary directory, use <tt>ExpandConstant('{tmp}')</tt>.</p>
<p>The extracted files are automatically deleted when Setup exits.</p>
<p>An exception will be raised if the file wasn't extracted successfully, if the file wasn't found, or if the file was found but couldn't be processed because of its MinVersion and/or OnlyBelowVersion parameters.</p></description>
<remarks><p>Use <tt>Flags: dontcopy</tt> in the [Files] section to tell Setup to skip the file during the normal file copying stage.</p>
<p>Use <tt>Flags: noencryption</tt> in the [Files] section if encryption is enabled and you call the ExtractTemporaryFile function prior to the user entering the correct password.</p>
<p>When solid compression is enabled, be sure to list your temporary files at (or near) the top of the [Files] section. In order to extract an arbitrary file in a solid-compressed installation, Setup must first decompress all prior files (to a temporary buffer in memory). This can result in a substantial delay if a number of other files are listed above the specified file in the [Files] section.</p></remarks>
<seealso><p><link topic="isxfunc_ExtractTemporaryFiles">ExtractTemporaryFiles</link></p></seealso>
<example><pre>[Files]
Source: "Readme.txt"; Flags: dontcopy noencryption
[Code]
function InitializeSetup: Boolean;
var
S: AnsiString;
begin
// Show the contents of Readme.txt (non Unicode) in a message box
ExtractTemporaryFile('Readme.txt');
if LoadStringFromFile(ExpandConstant('{tmp}\Readme.txt'), S) then
begin
MsgBox(S, mbInformation, MB_OK);
end;
Result := True;
end;</pre></example>
</function>
<function>
<name>ExtractTemporaryFiles</name>
<prototype>function ExtractTemporaryFiles(const Pattern: String): Integer;</prototype>
<description><p>Extracts the files matching the wildcard specified by Pattern from the [Files] section to a temporary directory. Returns the number of extracted files. To find the location of the temporary directory, use <tt>ExpandConstant('{tmp}')</tt>.</p>
<p>The extracted files are automatically deleted when Setup exits.</p>
<p>An exception will be raised if no files were extracted successfully, no files were found, or if files were found but none could be processed because of their MinVersion and/or OnlyBelowVersion parameters.</p></description>
<remarks><p>Use <tt>Flags: dontcopy</tt> in the [Files] section to tell Setup to skip the file during the normal file copying stage.</p>
<p>When solid compression is enabled, be sure to list your temporary files at (or near) the top of the [Files] section. In order to extract an arbitrary file in a solid-compressed installation, Setup must first decompress all prior files (to a temporary buffer in memory). This can result in a substantial delay if a number of other files are listed above the specified file in the [Files] section.</p></remarks>
<seealso><p><link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link></p></seealso>
<example><pre>[Files]
Source: "Readme.txt"; Flags: dontcopy
Source: "MyProg.exe"; DestDir: "{app}"
Source: "MyProg.chm"; DestDir: "{app}"
[Code]
function InitializeSetup: Boolean;
var
S: AnsiString;
ResultCode: Integer;
begin
// Show the contents of Readme.txt (non Unicode) in a message box
ExtractTemporaryFiles('{tmp}\Readme.txt');
if LoadStringFromFile(ExpandConstant('{tmp}\Readme.txt'), S) then
begin
MsgBox(S, mbInformation, MB_OK);
end;
// Extract all MyProg files and launch it. Note how {app} is left unexpanded.
ExtractTemporaryFiles('{app}\MyProg.*');
ExecAsOriginalUser(ExpandConstant('{tmp}\')+'{app}\MyProg.exe', '', '',
SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
Result := True;
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>GetPreviousData</name>
<prototype>function GetPreviousData(const ValueName, DefaultValueData: String): String;</prototype>
<description><p>Gets a value that was previously stored using SetPreviousData.</p></description>
</function>
<function>
<name>SetPreviousData</name>
<prototype>function SetPreviousData(const PreviousDataKey: Integer; const ValueName, ValueData: String): Boolean;</prototype>
<description><p>Sets a value that can be restored later using GetPreviousData. Call SetPreviousData inside a RegisterPreviousData event function, once per setting.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>Terminated</name>
<prototype>function Terminated: Boolean;</prototype>
<description><p>Returns True if Setup or Uninstall is terminating, False otherwise.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>RegisterExtraCloseApplicationsResource</name>
<prototype>function RegisterExtraCloseApplicationsResource(const DisableFsRedir: Boolean; const AFilename: String): Boolean;</prototype>
<description><p>Register an extra file which Setup should check for being in-use. Call RegisterExtraCloseApplicationsResource inside a RegisterExtraCloseApplicationsResources event function, once per file. Returns True if successful.</p></description>
</function>
<function>
<name>RmSessionStarted</name>
<prototype>function RmSessionStarted: Boolean;</prototype>
<description><p>Returns True if a Restart Manager session was started, False otherwise.</p></description>
<seealso><p><link topic="setup_closeapplications">CloseApplications</link></p></seealso>
</function>
</subcategory>
</category>
<category>
<description>Exception</description>
<subcategory>
<function>
<name>Abort</name>
<prototype>procedure Abort;</prototype>
<description><p>Escapes from the current execution path without reporting an error.</p>
<p>Abort raises a special "silent exception" which operates like any other exception, but does not display an error message to the end user.</p></description>
<remarks><p>Abort does not cause Setup or Uninstall to exit unless it's called from one of these event functions (or another function invoked by them):</p>
<p><tt>InitializeSetup<br />
InitializeWizard<br />
CurStepChanged(ssInstall)</tt></p>
<p><tt>InitializeUninstall<br />
CurUninstallStepChanged(usAppMutexCheck)<br />
CurUninstallStepChanged(usUninstall)</tt></p></remarks>
<seealso><p><link topic="scriptevents" anchor="PrepareToInstall">PrepareToInstall</link></p></seealso>
</function>
<function>
<name>RaiseException</name>
<prototype>procedure RaiseException(const Msg: String);</prototype>
<description><p>Raises an exception with the specified message.</p></description>
<example><pre>begin
RaiseException('Your message goes here');
// The following line will not be executed because of the exception
MsgBox('You will not see this.', mbInformation, MB_OK);
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>GetExceptionMessage</name>
<prototype>function GetExceptionMessage: String;</prototype>
<description><p>Returns the message associated with the current exception. This function should only be called from within an <tt>except</tt> section, or a function called from an <tt>except</tt> section.</p></description>
<remarks><p>Exception messages generally do not end in a period. Pass the result of this function to AddPeriod to add one.</p></remarks>
<example><pre>var
I: Integer;
begin
I := 1;
try
// The following line will raise a "Division by zero" exception
I := I div 0;
except
// Catch the exception, deal with it, and continue
MsgBox('We caught this exception: ' + AddPeriod(GetExceptionMessage),
mbError, MB_OK);
end;
end;</pre></example>
</function>
<function>
<name>ShowExceptionMessage</name>
<prototype>procedure ShowExceptionMessage;</prototype>
<description><p>Shows the message associated with the current exception in a message box. This function should only be called from within an <tt>except</tt> section, or a function called from an <tt>except</tt> section.</p></description>
<remarks><p>If logging is enabled (via the <link topic="setupcmdline">/LOG</link> command line parameter or the <link topic="setup_setuplogging">SetupLogging</link> [Setup] section directive) the message will recorded in the log in addition to being shown.</p></remarks>
<example><pre>var
I: Integer;
begin
I := 1;
try
// The following line will raise a "Division by zero" exception
I := I div 0;
except
// Catch the exception, show it, and continue
ShowExceptionMessage;
end;
end;</pre></example>
</function>
</subcategory>
</category>
<category>
<description><p>System</p></description>
<subcategory>
<function>
<name>IsAdminLoggedOn</name>
<prototype>function IsAdminLoggedOn: Boolean;</prototype>
<description><p>Returns True if the user account that Setup/Uninstall is running under is a member of the local Administrators group.</p></description>
</function>
<function>
<name>GetWindowsVersion</name>
<prototype>function GetWindowsVersion: Cardinal;</prototype>
<description><p>Returns the version number of Windows packed into a single integer. The upper 8 bits specify the major version; the following 8 bits specify the minor version; the lower 16 bits specify the build number. For example, this function will return $05000893 on Windows 2000, which is version 5.0.2195.</p>
<p>To retrieve just the major version number, use: "GetWindowsVersion shr 24". To retrieve just the minor version number, use: "(GetWindowsVersion shr 16) and $FF". To retrieve just the build number, use: "GetWindowsVersion and $FFFF".</p></description>
<example><pre>function IsWindowsXPOrLater: Boolean;
begin
Result := (GetWindowsVersion >= $05010000);
end;</pre></example>
<seealso><p><link topic="isxfunc_GetWindowsVersionEx">GetWindowsVersionEx</link></p></seealso>
</function>
<function>
<name>GetWindowsVersionEx</name>
<prototype>procedure GetWindowsVersionEx(var Version: TWindowsVersion);</prototype>
<description><p>Returns extended information about the version of Windows in a record.</p>
<p>TWindowsVersion is defined as:</p>
<pre>
TWindowsVersion = record
Major: Cardinal; // Major version number
Minor: Cardinal; // Minor version number
Build: Cardinal; // Build number
ServicePackMajor: Cardinal; // Major version number of service pack
ServicePackMinor: Cardinal; // Minor version number of service pack
NTPlatform: Boolean; // True if an NT-based platform
ProductType: Byte; // Product type (see below)
SuiteMask: Word; // Product suites installed (see below)
end;
</pre>
<p>The ProductType field can be one of the following values:</p>
<pre>
VER_NT_WORKSTATION
VER_NT_DOMAIN_CONTROLLER
VER_NT_SERVER
</pre>
<p>It can also be zero if the product type could not be determined (unlikely). VER_NT_WORKSTATION indicates a non-server edition of Windows (e.g. Workstation, Professional, or Home).</p>
<p>The SuiteMask field can be a combination of the following values:</p>
<pre>
VER_SUITE_BACKOFFICE
VER_SUITE_BLADE
VER_SUITE_DATACENTER
VER_SUITE_ENTERPRISE
VER_SUITE_EMBEDDEDNT
VER_SUITE_PERSONAL
VER_SUITE_SINGLEUSERTS
VER_SUITE_SMALLBUSINESS
VER_SUITE_SMALLBUSINESS_RESTRICTED
VER_SUITE_TERMINAL
</pre>
<p>VER_SUITE_PERSONAL, for example, is set on Home edition of Windows XP, and VER_SUITE_BLADE is set on the Web edition of Windows Server 2003.</p></description>
<example><p>The following example demonstrates how you can disallow installation on certain editions of Windows, and check service pack levels on multiple operating system versions. (Neither of these things are possible with the <tt>MinVersion</tt> [Setup] section directive.)</p>
<pre>function InitializeSetup: Boolean;
var
Version: TWindowsVersion;
S: String;
begin
GetWindowsVersionEx(Version);
// Disallow installation on Home edition of Windows
if Version.SuiteMask and VER_SUITE_PERSONAL <> 0 then
begin
SuppressibleMsgBox('This program cannot be installed on a Home edition of Windows.',
mbCriticalError, MB_OK, IDOK);
Result := False;
Exit;
end;
// Disallow installation on domain controllers
if Version.ProductType = VER_NT_DOMAIN_CONTROLLER then
begin
SuppressibleMsgBox('This program cannot be installed on domain controllers.',
mbCriticalError, MB_OK, IDOK);
Result := False;
Exit;
end;
// On Windows 2000, check for SP4
if Version.NTPlatform and
(Version.Major = 5) and
(Version.Minor = 0) and
(Version.ServicePackMajor < 4) then
begin
SuppressibleMsgBox('When running on Windows 2000, Service Pack 4 is required.',
mbCriticalError, MB_OK, IDOK);
Result := False;
Exit;
end;
// On Windows XP, check for SP2
if Version.NTPlatform and
(Version.Major = 5) and
(Version.Minor = 1) and
(Version.ServicePackMajor < 2) then
begin
SuppressibleMsgBox('When running on Windows XP, Service Pack 2 is required.',
mbCriticalError, MB_OK, IDOK);
Result := False;
Exit;
end;
Result := True;
end;</pre></example>
</function>
<function>
<name>GetWindowsVersionString</name>
<prototype>function GetWindowsVersionString: String;</prototype>
<description><p>Returns the version number of Windows in string form. On Windows 2000, for example, this function will return "5.00.2195".</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>IsWin64</name>
<prototype>function IsWin64: Boolean;</prototype>
<description><p>Returns True if the system is running a 64-bit version of Windows that provides the API support Inno Setup requires to perform 64-bit installation tasks. If False is returned, you cannot utilize any of Inno Setup's 64-bit-only features.</p>
<p>Do not use this function to detect <link topic="32vs64bitinstalls">64-bit install mode</link>, use <link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link> instead.</p></description>
<remarks><p>This function will always return True on an x64 edition of Windows.</p>
<p>For this function to return True on an Itanium edition of Windows, the system must be running Windows Server 2003 SP1 or later. Older versions lack APIs that Inno Setup requires (e.g. RegDeleteKeyEx).</p></remarks>
<example><pre>begin
// Check IsWin64 before using a 64-bit-only feature to
// avoid an exception when running on 32-bit Windows.
if IsWin64 then
begin
MsgBox('64-bit program files reside in: ' +
ExpandConstant('{pf64}'), mbInformation, MB_OK);
end;
end;</pre></example>
<seealso><p><link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link><br />
<link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
</function>
<function>
<name>Is64BitInstallMode</name>
<prototype>function Is64BitInstallMode: Boolean;</prototype>
<description><p>Returns True if Setup or Uninstall is running in <link topic="32vs64bitinstalls">64-bit install mode</link>, or False if it is running in <link topic="32vs64bitinstalls">32-bit install mode</link>.</p></description>
<remarks><p>When True is returned, it is safe to assume that <link topic="isxfunc_IsWin64">IsWin64</link> will also return True.</p></remarks>
<example><pre>begin
if Is64BitInstallMode then
MsgBox('Installing in 64-bit mode', mbInformation, MB_OK)
else
MsgBox('Installing in 32-bit mode', mbInformation, MB_OK);
end;</pre></example>
<seealso><p><link topic="isxfunc_IsWin64">IsWin64</link><br />
<link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
</function>
<function>
<name>ProcessorArchitecture</name>
<prototype>function ProcessorArchitecture: TSetupProcessorArchitecture;</prototype>
<description><p>Returns the native processor architecture of the current system.</p>
<p>TSetupProcessorArchitecture is defined as:</p>
<p><tt>TSetupProcessorArchitecture = (paUnknown, paX86, paX64, paIA64, paARM64);</tt></p></description>
<remarks><p>A 64-bit processor architecture will never be returned on 32-bit versions of Windows. Hence, you cannot use this function to detect a 64-bit AMD CPU on a 32-bit version of Windows; you'll just get back <tt>paX86</tt> if you try.</p>
<p><tt>paUnknown</tt> is returned if Setup/Uninstall does not recognize the processor architecture. It can be assumed that an "unknown" architecture is at least capable of executing 32-bit code, or Setup/Uninstall wouldn't be running at all.</p>
<p>If <tt>paIA64</tt> is returned, and <tt>ia64</tt> is <i>not</i> included in the value of the <link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link> [Setup] section directive, you should not assume that Inno Setup's 64-bit-only features are available -- for example, the <tt>{pf64}</tt> constant. Those features only work when <link topic="isxfunc_IsWin64">IsWin64</link> returns True, and as documented, it may not return True on older Itanium versions of Windows that lack certain APIs Inno Setup requires.</p>
<p>Therefore, instead of:</p>
<pre>
if ProcessorArchitecture = paIA64 then
// perform some Itanium-specific install task that
// involves expanding {pf64}
</pre>
<p>you should additionally check that IsWin64 returns True:</p>
<pre>
if ProcessorArchitecture = paIA64 then
begin
if IsWin64 then
// perform some Itanium-specific install task that
// involves expanding {pf64}
else
// cannot use 64-bit features; display an error message,
// fail silently, try something else, etc.
end;
</pre>
<p>If <tt>ia64</tt> <i>is</i> included in the value of the <link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link> [Setup] section directive, then it is not necessary to check IsWin64 because Setup will do so itself at startup, and fail with an error message (<tt>MissingWOW64APIs</tt>) if it is False.</p></remarks>
<example><pre>var
S: String;
begin
case ProcessorArchitecture of
paX86: S := 'x86';
paX64: S := 'x64';
paIA64: S := 'Itanium';
paARM64: S := 'ARM64';
else
S := 'Unrecognized';
end;
MsgBox('Your processor architecture: ' + S, mbInformation, MB_OK);
end;</pre></example>
<seealso><p><link topic="isxfunc_IsX86">IsX86</link><br />
<link topic="isxfunc_IsX64">IsX64</link><br />
<link topic="isxfunc_IsIA64">IsIA64</link><br />
<link topic="isxfunc_IsARM64">IsARM64</link><br />
<link topic="isxfunc_IsWin64">IsWin64</link><br />
<link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link></p></seealso>
</function>
<function>
<name>IsX86</name>
<prototype>function IsX86: Boolean;</prototype>
<description><p>Returns True if the native processor architecture is x86.</p>
<p>This function is a shorthand for <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link>. Be sure to read the <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link> topic before using this function.</p></description>
<seealso><p><link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link><br />
<link topic="isxfunc_IsX64">IsX64</link><br />
<link topic="isxfunc_IsIA64">IsIA64</link><br />
<link topic="isxfunc_IsARM64">IsARM64</link></p></seealso>
</function>
<function>
<name>IsX64</name>
<prototype>function IsX64: Boolean;</prototype>
<description><p>Returns True if the native processor architecture is x64.</p>
<p>This function is a shorthand for <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link>. Be sure to read the <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link> topic before using this function.</p></description>
<seealso><p><link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link><br />
<link topic="isxfunc_IsX86">IsX86</link><br />
<link topic="isxfunc_IsIA64">IsIA64</link><br />
<link topic="isxfunc_IsARM64">IsARM64</link></p></seealso>
</function>
<function>
<name>IsIA64</name>
<prototype>function IsIA64: Boolean;</prototype>
<description><p>Returns True if the native processor architecture is ia64.</p>
<p>This function is a shorthand for <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link>. Be sure to read the <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link> topic before using this function.</p></description>
<seealso><p><link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link><br />
<link topic="isxfunc_IsX86">IsX86</link><br />
<link topic="isxfunc_IsX64">IsX64</link><br />
<link topic="isxfunc_IsARM64">IsARM64</link></p></seealso>
</function>
<function>
<name>IsARM64</name>
<prototype>function IsARM64: Boolean;</prototype>
<description><p>Returns True if the native processor architecture is arm64.</p>
<p>This function is a shorthand for <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link>. Be sure to read the <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link> topic before using this function.</p></description>
<seealso><p><link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link><br />
<link topic="isxfunc_IsX86">IsX86</link><br />
<link topic="isxfunc_IsX64">IsX64</link><br />
<link topic="isxfunc_IsIA64">IsIA64</link></p></seealso>
</function>
</subcategory>
<subcategory>
<function>
<name>InstallOnThisVersion</name>
<prototype>function InstallOnThisVersion(const MinVersion, OnlyBelowVersion: String): Boolean;</prototype>
<description><p>This function is deprecated. Returns True if an entry with the specified MinVersion and OnlyBelowVersion parameters should be installed. If an invalid version string is passed, an exception will be raised.</p>
<p>This function is provided for backward compatibility only, and may be removed in a future release. New scripts should use <link topic="isxfunc_GetWindowsVersion">GetWindowsVersion</link> or <link topic="isxfunc_GetWindowsVersionEx">GetWindowsVersionEx</link> instead.</p></description>
<remarks><p>Prior to Inno Setup 5.5.0, this function returned <tt>irInstall</tt> rather than a Boolean True value. <tt>irInstall</tt> is now defined as an alias for True.</p></remarks>
<example><pre>// Old method, deprecated
function IsWindowsXPOrLater: Boolean;
begin
Result := InstallOnThisVersion('0,5.1', '0,0');
end;
// New method
function IsWindowsXPOrLater: Boolean;
begin
Result := (GetWindowsVersion >= $05010000);
end;</pre></example>
<seealso><p><link topic="isxfunc_GetWindowsVersion">GetWindowsVersion</link><br />
<link topic="isxfunc_GetWindowsVersionEx">GetWindowsVersionEx</link></p></seealso>
</function>
</subcategory>
<subcategory>
<function>
<name>GetEnv</name>
<prototype>function GetEnv(const EnvVar: String): String;</prototype>
<description><p>Gets the value of the specified environment variable.</p></description>
</function>
<function>
<name>GetUserNameString</name>
<prototype>function GetUserNameString: String;</prototype>
<description><p>Retrieves the name of the user currently logged onto the system.</p></description>
</function>
<function>
<name>GetComputerNameString</name>
<prototype>function GetComputerNameString: String;</prototype>
<description><p>Retrieves the name of the computer the Setup or Uninstall program is running on (as returned by the Windows <i>GetComputerName</i> function).</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>GetUILanguage</name>
<prototype>function GetUILanguage: Integer;</prototype>
<description><p>Returns the language identifier (LANGID) of the current user's UI language, which is either the language of Windows itself, or in the case of a MUI edition of Windows, the user interface language chosen in Control Panel's Regional Options. Returns 0 if the function fails (unlikely).</p></description>
<remarks><p>Refer to the <a href="http://msdn.microsoft.com/en-us/library/dd318693.aspx">list of valid language identifiers on MSDN</a>.</p></remarks>
<example><pre>begin
if GetUILanguage = $0409 then
begin
// UI language is English (United States)
end;
// You can use "and $3FF" to extract the primary language identifier
if GetUILanguage and $3FF = $09 then
begin
// Matches any variant of English
end;
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>FontExists</name>
<prototype>function FontExists(const FaceName: String): Boolean;</prototype>
<description><p>Returns True if a font with the specified face name is installed on the system.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>FindWindowByClassName</name>
<prototype>function FindWindowByClassName(const ClassName: String): HWND;</prototype>
<description><p>Retrieves a handle to the top-level window whose class name matches the specified string. This function does not search child windows, and does not perform a case-sensitive search. Returns 0 if no window is found.</p></description>
</function>
<function>
<name>FindWindowByWindowName</name>
<prototype>function FindWindowByWindowName(const WindowName: String): HWND;</prototype>
<description><p>Retrieves a handle to the top-level window whose window name matches the specified string. This function does not search child windows, and does not perform a case-sensitive search. Returns 0 if no window is found.</p></description>
</function>
<function>
<name>SendMessage</name>
<prototype>function SendMessage(const Wnd: HWND; const Msg, WParam, LParam: Longint): Longint;</prototype>
<description><p>Sends the specified message to the specified window. Does not return until the window procedure has processed the message.</p></description>
</function>
<function>
<name>PostMessage</name>
<prototype>function PostMessage(const Wnd: HWND; const Msg, WParam, LParam: Longint): Boolean;</prototype>
<description><p>Posts the specified message to the specified window, returning immediately. Returns True if successful.</p></description>
</function>
<function>
<name>SendNotifyMessage</name>
<prototype>function SendNotifyMessage(const Wnd: HWND; const Msg, WParam, LParam: Longint): Boolean;</prototype>
<description><p>Sends the specified message to the specified window without waiting for the message to be processed by the destination window procedure. Returns True if successful.</p></description>
</function>
<function>
<name>RegisterWindowMessage</name>
<prototype>function RegisterWindowMessage(const Name: String): Longint;</prototype>
<description><p>The RegisterWindowMessage function defines a new window message that is guaranteed to be unique throughout the system. The returned message value can be used when calling the SendBroadcastMessage or PostBroadcastMessage function.</p></description>
</function>
<function>
<name>SendBroadcastMessage</name>
<prototype>function SendBroadcastMessage(const Msg, WParam, LParam: Longint): Longint;</prototype>
<description><p>Sends the specified message to top-level windows in the system. Does not return until all window procedure have processed the message.<br />The specified message must be unique. Use RegisterWindowMessage to get such a message.</p></description>
</function>
<function>
<name>PostBroadcastMessage</name>
<prototype>function PostBroadcastMessage(const Msg, WParam, LParam: Longint): Boolean;</prototype>
<description><p>Posts the specified message to top-level windows in the system, returning immediately.<br />The specified message must be unique. Use RegisterWindowMessage to get such a message.</p></description>
</function>
<function>
<name>SendBroadcastNotifyMessage</name>
<prototype>function SendBroadcastNotifyMessage(const Msg, WParam, LParam: Longint): Boolean;</prototype>
</function>
</subcategory>
<subcategory>
<function>
<name>CreateMutex</name>
<prototype>procedure CreateMutex(const Name: String);</prototype>
<description><p>Creates a mutex with the specified name.</p></description>
</function>
<function>
<name>CheckForMutexes</name>
<prototype>function CheckForMutexes(Mutexes: String): Boolean;</prototype>
<description><p>Returns True if any of the mutexes in the comma-separated Mutexes string exist.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>MakePendingFileRenameOperationsChecksum</name>
<prototype>procedure MakePendingFileRenameOperationsChecksum: String;</prototype>
<description><p>Calculates a checksum of the current PendingFileRenameOperations registry value. The caller can use this checksum to determine if PendingFileRenameOperations or WININIT.INI was changed (perhaps by another program).</p></description>
<example><pre>var
ChecksumBefore, ChecksumAfter: String;
begin
ChecksumBefore := MakePendingFileRenameOperationsChecksum;
// ...run a program...
ChecksumAfter := MakePendingFileRenameOperationsChecksum;
if ChecksumAfter <> ChecksumBefore then
// PendingFileRenameOperations or WININIT.INI changed
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>UnloadDLL</name>
<prototype>procedure UnloadDLL(Filename: String);</prototype>
<description><p>Unloads the specified DLL that was loaded by the [Code] section using an "external" keyword. This can be useful if you need to delete the DLL.</p>
<p>The case of the filename and any path name must exactly match that of the function import. You will need to expand any constants in the filename yourself before passing it to UnloadDLL.</p>
<p>If the function import used a "files:" prefix, prepend the value of the <tt>{tmp}</tt> constant to the filename (e.g. <tt>ExpandConstant('{tmp}\filename.dll')</tt>).</p></description>
<remarks><p>It's not recommended that you try this, but if you attempt to call a function in a DLL that has been unloaded, the DLL will be re-loaded.</p></remarks>
<example><pre>procedure DllFunc; external 'DllFunc@{app}\MyDll.dll stdcall uninstallonly';
...
begin
// Call DllFunc
DllFunc;
// Unload the DLL
UnloadDLL(ExpandConstant('{app}\MyDll.dll'));
// Now we can delete the DLL
DeleteFile(ExpandConstant('{app}\MyDll.dll'));
end;</pre></example>
</function>
<function>
<name>DLLGetLastError</name>
<prototype>function DLLGetLastError(): Longint;</prototype>
<description><p>Returns value the last error code had right after the most recent DLL function call you made. Useful after calling Windows API functions (if the function sets the last error code).</p></description>
<remarks><p>It's recommended to use this function instead of directly calling the GetLastError Windows API function since Setup or Uninstall makes API calls of its own, so the last error code could be overwritten at any time.</p>
<p>Refer to the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms681381.aspx">system error codes on MSDN</a>.</p></remarks>
<example><pre>function MessageBox(hWnd: Integer; lpText, lpCaption: AnsiString; uType: Cardinal): Integer; external '[email protected] stdcall';
...
begin
if MessageBox(-1, '', '', -1) = 0 then
MsgBox(SysErrorMessage(DLLGetLastError), mbError, mb_Ok);</pre></example>
</function>
</subcategory>
</category>
<category>
<description><p>String</p></description>
<subcategory>
<function>
<name>Chr</name>
<prototype>function Chr(B: Byte): Char;</prototype>
<description><p>Returns the character with the specified ordinal value.</p></description>
</function>
<function>
<name>Ord</name>
<prototype>function Ord(C: Char): Byte;</prototype>
<description><p>Returns the ordinal value of the specified character.</p></description>
</function>
<function>
<name>Copy</name>
<prototype>function Copy(S: String; Index, Count: Integer): String;</prototype>
<description><p>Returns a string containing Count characters starting at S[Index].<br />If Index is larger than the length of S, Copy returns an empty string.<br />If Count specifies more characters than are available, only the characters from S[Index] to the end of S are returned.</p></description>
</function>
<function>
<name>Length</name>
<prototype>function Length(s: String): Longint;</prototype>
<description><p>Returns the length of the specified string.</p></description>
</function>
<function>
<name>Lowercase</name>
<prototype>function Lowercase(S: String): String;</prototype>
<description><p>Returns a copy of the string S, but with all 7-bit ASCII characters between 'A' and 'Z' converted to lowercase. To convert 8-bit international characters, use AnsiLowercase instead.</p></description>
</function>
<function>
<name>Uppercase</name>
<prototype>function Uppercase(S: String): String;</prototype>
<description><p>Returns a copy of the string S, but with all 7-bit ASCII characters between 'a' and 'z' converted to uppercase. To convert 8-bit international characters, use AnsiUppercase instead.</p></description>
</function>
<function>
<name>AnsiLowercase</name>
<prototype>function AnsiLowercase(S: String): String;</prototype>
<description><p>Returns a string that is a copy of the given string converted to lowercase. The conversion uses the current Windows locale. This function supports multi-byte character sets (MBCS).</p></description>
</function>
<function>
<name>AnsiUppercase</name>
<prototype>function AnsiUppercase(S: String): String;</prototype>
<description><p>Returns a string that is a copy of the given string converted to uppercase. The conversion uses the current Windows locale. This function supports multi-byte character sets (MBCS).</p></description>
</function>
<function>
<name>StringOfChar</name>
<prototype>function StringOfChar(c: Char; I : Longint): String;</prototype>
<description><p>Returns a string of length I with all characters set to character C.</p></description>
</function>
<function>
<name>Delete</name>
<prototype>procedure Delete(var S: String; Index, Count: Integer);</prototype>
<description><p>Removes a substring of Count characters from string S starting at S[Index].<br />If Index is larger than the length of S, no characters are deleted. If Count specifies more characters than remain starting at the S[Index], Delete removes the rest of the string.</p></description>
</function>
<function>
<name>Insert</name>
<prototype>procedure Insert(Source: String; var Dest: String; Index: Integer);</prototype>
<description><p>Merges Source into Dest at the position Dest[Index].</p></description>
</function>
<function>
<name>StringChange</name>
<prototype>function StringChange(var S: String; const FromStr, ToStr: String): Integer;</prototype>
<description><p>This function is deprecated. It is equivalent to calling <link topic="isxfunc_StringChangeEx">StringChangeEx</link> with the SupportMBCS parameter set to False.</p></description>
</function>
<function>
<name>StringChangeEx</name>
<prototype>function StringChangeEx(var S: String; const FromStr, ToStr: String; const SupportDBCS: Boolean): Integer;</prototype>
<description><p>Changes all occurrences in S of FromStr to ToStr. If SupportDBCS is True (recommended unless you require binary safety), double-byte character sequences in S are recognized and handled properly. Otherwise, the function behaves in a binary-safe manner. Returns the number of times FromStr was matched and changed.</p></description>
<remarks><p>When working with strings containing paths or filenames, be sure to pass True in the SupportDBCS parameter. Otherwise, paths with Chinese, Japanese, or Korean characters may be corrupted.</p></remarks>
<example><pre>var
S: String;
begin
S := ExpandConstant('{commonappdata}');
// S = 'C:\Documents and Settings\All Users\Application Data'
StringChangeEx(S, '\', '/', True);
// S = 'C:/Documents and Settings/All Users/Application Data'
end;</pre></example>
</function>
<function>
<name>Pos</name>
<prototype>function Pos(SubStr, S: String): Integer;</prototype>
<description><p>Searches for Substr within S and returns an integer value that is the index of the first character of Substr within S.<br />If Substr is not found, Pos returns zero. The Pos function is case-sensitive.</p></description>
</function>
<function>
<name>AddQuotes</name>
<prototype>function AddQuotes(const S: String): String;</prototype>
<description><p>Adds a quote (") character to the left and right sides of the string if the string contains a space and it didn't have quotes already. This is primarily used when spawning another process with a long filename as one of the parameters.</p></description>
</function>
<function>
<name>RemoveQuotes</name>
<prototype>function RemoveQuotes(const S: String): String;</prototype>
<description><p>Opposite of AddQuotes; removes any quotes around the string.</p></description>
</function>
<function>
<name>ConvertPercentStr</name>
<prototype>function ConvertPercentStr(var S: String): Boolean;</prototype>
<description><p>Expands all %-encoded characters in the string (see <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>). Returns True if all were successfully expanded.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>CompareText</name>
<prototype>function CompareText(const S1, S2: string): Integer;</prototype>
<description><p>Compares the strings S1 and S2 and returns 0 if they are equal. If S1 is greater than S2, CompareText returns an integer greater than 0. If S1 is less than S2, CompareText returns an integer less than 0. The CompareText function is not case-sensitive.</p></description>
</function>
<function>
<name>CompareStr</name>
<prototype>function CompareStr(const S1, S2: string): Integer;</prototype>
<description><p>Compares S1 to S2, with case-sensitivity. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.</p></description>
</function>
<function>
<name>SameText</name>
<prototype>function SameText(const S1, S2: string): Boolean;</prototype>
<description><p>Compares the strings S1 and S2 and returns True if they are equal. The SameText function is not case-sensitive.</p></description>
</function>
<function>
<name>SameStr</name>
<prototype>function SameStr(const S1, S2: string): Boolan;</prototype>
<description><p>Compares S1 to S2, with case-sensitivity. The return value is True if they are equal.</p></description>
</function>
<function>
<name>IsWildcard</name>
<prototype>function IsWildcard(const Pattern: String): Boolean;</prototype>
<description><p>Returns True if the specified pattern contains a wildcard.</p></description>
</function>
<function>
<name>WildcardMatch</name>
<prototype>function WildcardMatch(const Text, Pattern: String): Boolean;</prototype>
<description><p>Returns True if the specified text matches the specified pattern.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>Format</name>
<prototype>function Format(const Format: string; const Args: array of const): string;</prototype>
<description><p>Formats the series of arguments in the open array Args. Formatting is controlled by the format string Format; the results are returned as a string.</p>
<p>An exception will be raised if an invalid format string is specified, too few arguments are passed, or if any arguments are of the wrong type.</p></description>
<example><pre>var
S: String;
I: Integer;
begin
S := Format('%d files found', [10]);
// S = '10 files found'
S := Format('Filename: %s', ['file.txt']);
// S = 'Filename: file.txt'
I := 64;
S := Format('%d in hex, padded to 8 digits: %.8x', [I, I]);
// S = '64 in hex, padded to 8 digits: 00000040'
end;</pre></example>
</function>
</subcategory>
<subcategory>
<function>
<name>Trim</name>
<prototype>function Trim(const S: string): String;</prototype>
<description><p>Trims leading and trailing spaces and control characters from the given string S.</p></description>
</function>
<function>
<name>TrimLeft</name>
<prototype>function TrimLeft(const S: string): String;</prototype>
<description><p>Trims leading spaces and control characters from the given string S.</p></description>
</function>
<function>
<name>TrimRight</name>
<prototype>function TrimRight(const S: string): String;</prototype>
<description><p>Trims trailing spaces and control characters from the given string S.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>StrToIntDef</name>
<prototype>function StrToIntDef(s: string; def: Longint): Longint;</prototype>
<description><p>The StrToInt function converts the string passed in S into a number. If S does not represent a valid number, StrToInt returns the number passed in Def.</p></description>
</function>
<function>
<name>StrToInt</name>
<prototype>function StrToInt(s: string): Longint;</prototype>
<description><p>The StrToInt function converts the string passed in S into a number.</p></description>
<remarks><p>Use of <link topic="isxfunc_StrToIntDef">StrToIntDef</link> instead of StrToInt is recommended.</p></remarks>
</function>
<function>
<name>StrToInt64Def</name>
<prototype>function StrToInt64Def(s: string; def: Int64): Int64;</prototype>
<description><p>The StrToInt64Def function converts the string passed in S into a 64-bit number. If S does not represent a valid 64-bit number, StrToInt returns the 64-bit number passed in Def.</p><p>Requires Unicode Inno Setup.</p></description>
</function>
<function>
<name>StrToInt64</name>
<prototype>function StrToInt64(s: string): Int64;</prototype>
<description><p>The StrToInt64 function converts the string passed in S into a 64-bit number.</p><p>Requires Unicode Inno Setup.</p></description>
<remarks><p>Use of <link topic="isxfunc_StrToInt64Def">StrToInt64Def</link> instead of StrToInt64 is recommended.</p></remarks>
</function>
<function>
<name>StrToFloat</name>
<prototype>function StrToFloat(s: string): Extended;</prototype>
<description><p>The StrToFloat function converts the string passed in S into a floating point number. The character used for the decimal point should always be a dot.</p></description>
</function>
<function>
<name>IntToStr</name>
<prototype>function IntToStr(i: Int64): String;</prototype>
<description><p>The IntToStr function converts an 32-bit or 64-bit number into a string.</p><p>64-bit numbers require Unicode Inno Setup.</p></description>
</function>
<function>
<name>FloatToStr</name>
<prototype>function FloatToStr(e: extended): String;</prototype>
<description><p>The FloatToStr function converts a floating point number into a string.</p><p>Unicode Inno Setup: the character used for the decimal point will always be a dot. Non-Unicode Inno Setup: the character used for the decimal point is locale-dependant.</p></description>
</function>
</subcategory>
<subcategory>
<function>
<name>CharLength</name>
<prototype>function CharLength(const S: String; const Index: Integer): Integer;</prototype>
<description><p>Returns the length in bytes (1 or 2) of the character in the specified string at the specified index.</p></description>
<remarks><p>In double-byte character sets (Chinese, Japanese, Korean), most non-ASCII characters occupy two bytes. Note that the second byte of a double-byte character -- known as the "trail byte" -- can be in the same range used by ASCII characters (below 128). Thus, when stepping through a string that may contain double-byte characters, such as a path or filename, care must be taken to not mistake trail bytes for single-byte ASCII characters.</p></remarks>
<example><pre>function BackslashToSlash(const S: String): String;
var
I: Integer;
begin
Result := S;
I := 1;
while I <= Length(Result) do
begin
if Result[I] = '\' then
Result[I] := '/';
// Go to the next character. But do not simply increment I by 1.
// Increment by CharLength() in case Result[I] is a double-byte character.
I := I + CharLength(Result, I);
end;
end;
...
begin
// Show path of Common Files with backslashes changed to forward slashes
MsgBox(BackslashToSlash(ExpandConstant('{cf}')), mbInformation, MB_OK);
end;</pre></example>
</function>
</subcategory>