isxfunc.xml 226 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546
  1. <?xml version="1.0" standalone="yes" ?>
  2. <isxhelp version="1.0">
  3. <copyright>
  4. Inno Setup
  5. Copyright (C) 1997-2026 Jordan Russell
  6. Portions by Martijn Laan
  7. For conditions of distribution and use, see LICENSE.TXT.
  8. </copyright>
  9. <isxfunc>
  10. <category>
  11. <description>Setup or Uninstall Info</description>
  12. <subcategory>
  13. <function>
  14. <name>GetCmdTail</name>
  15. <prototype>function GetCmdTail: String;</prototype>
  16. <description><p>Returns all command line parameters passed to Setup or Uninstall as a single string, including undocumented internal parameters used by Setup and Uninstall.</p></description>
  17. <seealso><p><link topic="isxfunc_ParamStr">ParamStr</link></p></seealso>
  18. </function>
  19. <function>
  20. <name>ParamCount</name>
  21. <prototype>function ParamCount: Integer;</prototype>
  22. <description><p>Returns the number of command line parameters passed to Setup or Uninstall, excluding undocumented internal parameters used by Setup and Uninstall.</p></description>
  23. <seealso><p><link topic="isxfunc_ParamStr">ParamStr</link><br />
  24. <link topic="isxfunc_GetCmdTail">GetCmdTail</link></p></seealso>
  25. </function>
  26. <function>
  27. <name>ParamStr</name>
  28. <prototype>function ParamStr(Index: Integer): String;</prototype>
  29. <description><p>Returns the Index-th command line parameter passed to Setup or Uninstall, excluding undocumented internal parameters used by Setup and Uninstall.</p>
  30. <p>Parameter number zero is the full file name with which Setup or Uninstall was started.</p>
  31. <p>If Index is invalid, ParamStr returns an empty string.</p></description>
  32. <seealso><p><link topic="isxfunc_ParamCount">ParamCount</link><br />
  33. <link topic="isxfunc_GetCmdTail">GetCmdTail</link></p></seealso>
  34. </function>
  35. </subcategory>
  36. <subcategory>
  37. <function>
  38. <name>ActiveLanguage</name>
  39. <prototype>function ActiveLanguage: String;</prototype>
  40. <description><p>Returns the name of the active language.</p></description>
  41. </function>
  42. </subcategory>
  43. <subcategory>
  44. <function>
  45. <name>CustomMessage</name>
  46. <prototype>function CustomMessage(const MsgName: String): String;</prototype>
  47. <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>
  48. <example><pre>var
  49. S: String;
  50. begin
  51. S := CustomMessage('CreateDesktopIcon');
  52. // S = 'Create a &amp;desktop icon'
  53. S := FmtMessage(CustomMessage('NameAndVersion'), ['My Program', '1.0']);
  54. // S = 'My Program version 1.0'
  55. end;</pre></example>
  56. </function>
  57. <function>
  58. <name>FmtMessage</name>
  59. <prototype>function FmtMessage(const S: String; const Args: array of String): String;</prototype>
  60. <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>
  61. <remarks><p>If a <tt>%</tt>-specifier references a non-existing argument, it will be returned untouched. No exception will be raised.</p></remarks>
  62. <example><pre>var
  63. S: String;
  64. begin
  65. S := FmtMessage('%1 version %2 will be installed.', ['My Program', '1.0']);
  66. // S = 'My Program version 1.0 will be installed.'
  67. S := FmtMessage(SetupMessage(msgNotOnThisPlatform), ['Windows 2000']);
  68. // S = 'This program will not run on Windows 2000.'
  69. end;</pre></example>
  70. </function>
  71. <function>
  72. <name>SetupMessage</name>
  73. <prototype>function SetupMessage(const ID: TSetupMessageID): String;</prototype>
  74. <description><p>Returns the value of the specified message.</p>
  75. <p>TSetupMessageID is defined as:</p>
  76. <p>'msg' + the message name. Example: <i>SetupMessage(msgSetupAppTitle)</i></p></description>
  77. <example><pre>var
  78. S: String;
  79. begin
  80. S := SetupMessage(msgButtonNext);
  81. // S now equals '&amp;Next &gt;'
  82. end;</pre></example>
  83. </function>
  84. </subcategory>
  85. <subcategory>
  86. <function>
  87. <name>WizardDirValue</name>
  88. <prototype>function WizardDirValue: String;</prototype>
  89. <description><p>Returns the current contents of the edit control on the <i>Select Destination Location</i> page of the wizard.</p>
  90. <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>
  91. </function>
  92. <function>
  93. <name>WizardGroupValue</name>
  94. <prototype>function WizardGroupValue: String;</prototype>
  95. <description><p>Returns the current contents of the edit control on the <i>Select Start Menu Folder</i> page of the wizard.</p>
  96. <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>
  97. </function>
  98. <function>
  99. <name>WizardNoIcons</name>
  100. <prototype>function WizardNoIcons: Boolean;</prototype>
  101. <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>
  102. </function>
  103. <function>
  104. <name>WizardSetupType</name>
  105. <prototype>function WizardSetupType(const Description: Boolean): String;</prototype>
  106. <description><p>Returns the name or description of the setup type selected by the user.</p></description>
  107. </function>
  108. <function>
  109. <name>WizardSelectedComponents</name>
  110. <prototype>function WizardSelectedComponents(const Descriptions: Boolean): String;</prototype>
  111. <description><p>Returns a comma-separated list of names or descriptions of the components selected by the user.</p></description>
  112. <seealso><p><link topic="isxfunc_WizardIsComponentSelected">WizardIsComponentSelected</link><br />
  113. <link topic="isxfunc_WizardSelectComponents">WizardSelectComponents</link></p></seealso>
  114. </function>
  115. <function>
  116. <name>WizardIsComponentSelected</name>
  117. <prototype>function WizardIsComponentSelected(const Components: String): Boolean;</prototype>
  118. <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>
  119. <seealso><p><link topic="isxfunc_WizardSelectedComponents">WizardSelectedComponents</link><br />
  120. <link topic="isxfunc_WizardSelectComponents">WizardSelectComponents</link></p></seealso>
  121. <example><pre>begin
  122. if WizardIsComponentSelected('helpfiles') then
  123. // the 'helpfiles' component is selected
  124. end;</pre></example>
  125. </function>
  126. <function>
  127. <name>WizardSelectedTasks</name>
  128. <prototype>function WizardSelectedTasks(const Descriptions: Boolean): String;</prototype>
  129. <description><p>Returns a comma-separated list of names or descriptions of the tasks selected by the user.</p></description>
  130. <seealso><p><link topic="isxfunc_WizardIsTaskSelected">WizardIsTaskSelected</link><br />
  131. <link topic="isxfunc_WizardSelectTasks">WizardSelectTasks</link></p></seealso>
  132. </function>
  133. <function>
  134. <name>WizardIsTaskSelected</name>
  135. <prototype>function WizardIsTaskSelected(const Tasks: String): Boolean;</prototype>
  136. <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>
  137. <seealso><p><link topic="isxfunc_WizardSelectedTasks">WizardSelectedTasks</link><br />
  138. <link topic="isxfunc_WizardSelectTasks">WizardSelectTasks</link></p></seealso>
  139. <example><pre>begin
  140. if WizardIsTaskSelected('desktopicon') then
  141. // the 'desktopicon' task is selected
  142. end;</pre></example>
  143. </function>
  144. <function>
  145. <name>WizardSilent</name>
  146. <prototype>function WizardSilent: Boolean;</prototype>
  147. <description><p>Returns True if Setup is running silently, False otherwise.</p></description>
  148. </function>
  149. </subcategory>
  150. <subcategory>
  151. <function>
  152. <name>IsUninstaller</name>
  153. <prototype>function IsUninstaller: Boolean;</prototype>
  154. <description><p>Returns True if Uninstall is running as opposed to Setup, False otherwise.</p></description>
  155. </function>
  156. <function>
  157. <name>UninstallSilent</name>
  158. <prototype>function UninstallSilent: Boolean;</prototype>
  159. <description><p>Returns True if Uninstall is running silently, False otherwise.</p></description>
  160. </function>
  161. </subcategory>
  162. <subcategory>
  163. <function>
  164. <name>CurrentFilename</name>
  165. <prototype>function CurrentFilename: String;</prototype>
  166. <description><p>Returns the destination file name of the [Files] entry that is currently being processed. The returned name may include constants.</p>
  167. <p>Do not attempt to call this function from outside a Check, BeforeInstall or AfterInstall event function belonging to a [Files] entry.</p></description>
  168. </function>
  169. <function>
  170. <name>CurrentSourceFilename</name>
  171. <prototype>function CurrentSourceFilename: String;</prototype>
  172. <description><p>Returns the source file name of the [Files] entry that is currently being processed. The returned name may include constants.</p>
  173. <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>
  174. </function>
  175. </subcategory>
  176. <subcategory>
  177. <function>
  178. <name>ExpandConstant</name>
  179. <prototype>function ExpandConstant(const S: String): String;</prototype>
  180. <description><p>Changes all constants in S to their values. For example, ExpandConstant('{srcexe}') is changed to the filename of Setup.</p>
  181. <p>An exception will be raised if there was an error expanding the constants.</p></description>
  182. </function>
  183. <function>
  184. <name>ExpandConstantEx</name>
  185. <prototype>function ExpandConstantEx(const S: String; const CustomConst, CustomValue: String): String;</prototype>
  186. <description><p>Changes all constants in S to their values. Additionally, any constant equal to CustomConst will be changed to CustomValue.</p>
  187. <p>An exception will be raised if there was an error expanding the constants.</p></description>
  188. </function>
  189. </subcategory>
  190. <subcategory>
  191. <function>
  192. <name>GetPreviousData</name>
  193. <prototype>function GetPreviousData(const ValueName, DefaultValueData: String): String;</prototype>
  194. <description><p>Gets a value that was previously stored using SetPreviousData.</p></description>
  195. </function>
  196. <function>
  197. <name>SetPreviousData</name>
  198. <prototype>function SetPreviousData(const PreviousDataKey: Integer; const ValueName, ValueData: String): Boolean;</prototype>
  199. <description><p>Sets a value that can be restored later using GetPreviousData. Call SetPreviousData inside a RegisterPreviousData event function, once per setting.</p></description>
  200. </function>
  201. </subcategory>
  202. <subcategory>
  203. <function>
  204. <name>Terminated</name>
  205. <prototype>function Terminated: Boolean;</prototype>
  206. <description><p>Returns True if Setup or Uninstall is terminating, False otherwise.</p></description>
  207. </function>
  208. <function>
  209. <name>Debugging</name>
  210. <prototype>function Debugging: Boolean;</prototype>
  211. <description><p>Returns True if Setup or Uninstall is being debugged by the Compiler IDE or another application, False otherwise.</p></description>
  212. <seealso><p><link topic="scriptdebug">Run-time debugger</link></p></seealso>
  213. </function>
  214. </subcategory>
  215. <subcategory>
  216. <function>
  217. <name>RegisterExtraCloseApplicationsResource</name>
  218. <prototype>function RegisterExtraCloseApplicationsResource(const AFilename: String): Boolean;</prototype>
  219. <description><p>Registers an extra file which Setup should check for being in-use. Call <tt>RegisterExtraCloseApplicationsResource</tt> inside a <tt>RegisterExtraCloseApplicationsResources</tt> event function, once per file. Ignores <link topic="setup_closeapplicationsfilter">CloseApplicationsFilter</link>. Returns True if successful.</p></description>
  220. <remarks><p>This function used to have a <tt>DisableFsRedir</tt> parameter, which was removed in 7.0. Use <link topic="isxfunc_ApplyPathRedirRulesForCurrentProcess">ApplyPathRedirRulesForCurrentProcess</link> instead to register a 64-bit file from a <link topic="64bit">32-bit installer</link>, or vice versa.</p></remarks>
  221. </function>
  222. <function>
  223. <name>RmSessionStarted</name>
  224. <prototype>function RmSessionStarted: Boolean;</prototype>
  225. <description><p>Returns True if a Restart Manager session was started, False otherwise.</p></description>
  226. <seealso><p><link topic="setup_closeapplications">CloseApplications</link></p></seealso>
  227. </function>
  228. </subcategory>
  229. <subcategory>
  230. <function>
  231. <name>GetWizardForm</name>
  232. <prototype>function GetWizardForm: TWizardForm;</prototype>
  233. <description><p>Returns the <tt>WizardForm</tt> support object, or raises an internal error if the object has not yet been created.</p></description>
  234. <seealso><p><link topic="scriptclasses" anchor="WizardForm">WizardForm</link></p></seealso>
  235. </function>
  236. <function>
  237. <name>GetUninstallProgressForm</name>
  238. <prototype>function GetUninstallProgressForm: TUninstallProgressForm;</prototype>
  239. <description><p>Returns the <tt>UninstallProgressForm</tt> support object, or raises an internal error if the object has not yet been created.</p></description>
  240. <seealso><p><link topic="scriptclasses" anchor="UninstallProgressForm">UninstallProgressForm</link></p></seealso>
  241. </function>
  242. </subcategory>
  243. </category>
  244. <category>
  245. <description>Wizard Update</description>
  246. <subcategory>
  247. <function>
  248. <name>WizardSelectComponents</name>
  249. <prototype>procedure WizardSelectComponents(const Components: String);</prototype>
  250. <description><p>Selects the specified comma separated list of component names.</p>
  251. <p>If a component name is prefixed with a "*" character, any child components will be selected as well (except for those that include the <tt>dontinheritcheck</tt> flag). If a component name is prefixed with a "!" character, the component will be deselected.</p>
  252. <p>This function does not change the state of unspecified components. This function can change the state of specified components that include the <tt>fixed</tt> flag.</p>
  253. </description>
  254. <seealso><p><link topic="isxfunc_WizardSelectedComponents">WizardSelectedComponents</link><br />
  255. <link topic="isxfunc_WizardIsComponentSelected">WizardIsComponentSelected</link></p></seealso>
  256. <example><pre>begin
  257. WizardSelectComponents('!helpfiles');
  258. // the 'helpfiles' component is deselected
  259. end;</pre></example>
  260. </function>
  261. <function>
  262. <name>WizardSelectTasks</name>
  263. <prototype>procedure WizardSelectTasks(const Tasks: String);</prototype>
  264. <description><p>Selects the specified comma separated list of task names.</p>
  265. <p>If a task name is prefixed with a "!" character, the task will be deselected.</p>
  266. <p>This function does not change the state of unspecified tasks.</p>
  267. </description>
  268. <seealso><p><link topic="isxfunc_WizardSelectedTasks">WizardSelectedTasks</link><br />
  269. <link topic="isxfunc_WizardIsTaskSelected">WizardIsTaskSelected</link></p></seealso>
  270. <example><pre>begin
  271. WizardSelectTasks('!desktopicon');
  272. // the 'desktopicon' task is deselected
  273. end;</pre></example>
  274. </function>
  275. <function>
  276. <name>WizardSetBackImage</name>
  277. <prototype>procedure WizardSetBackImage(const BackImages: TArrayOfGraphic; const Stretch, Center: Boolean; const Opacity: Byte);</prototype>
  278. <description><p>Sets a wizard background image. If multiple images are specified, the best-fitting one will be selected. If no images are specified, any existing background image is cleared and the other function parameters are ignored.</p>
  279. <p>If <tt>Stretch</tt> is <tt>True</tt>, the image will be stretched or shrunk if the image is larger or smaller than required. If <tt>Stretch</tt> is <tt>False</tt> and <tt>Center</tt> is <tt>True</tt>, the image will be centered in the wizard window if it is smaller than required, and clipped if it is larger than required. Otherwise, the image will be positioned in the upper-left corner in its original size.</p>
  280. <p>See <link topic="setup_wizardbackimagefile">WizardBackImageFile</link> for information about the recommended image size(s).</p>
  281. <p></p><p><tt>Opacity</tt> specifies the opacity of the image, from <tt>0</tt> (fully transparent) to <tt>255</tt> (fully opaque, so non-transparent).</p>
  282. <p>Raises an exception if a custom wizard background is not already active. Custom wizard backgrounds can be activated by using <link topic="setup_wizardbackcolor">WizardBackColor</link>, <link topic="setup_wizardbackcolordynamicdark">WizardBackColorDynamicDark</link>, <link topic="setup_wizardbackimagefile">WizardBackImageFile</link>, or <link topic="setup_wizardbackimagefiledynamicdark">WizardBackImageFileDynamicDark</link>.</p>
  283. <p>To display a single image for the entire duration of Setup, do not use this function. Instead, set <link topic="setup_wizardbackimagefile">WizardBackImageFile</link> and optionally <link topic="setup_wizardbackimagefiledynamicdark">WizardBackImageFileDynamicDark</link>.</p>
  284. </description>
  285. <example><pre>[Setup]
  286. WizardStyle=modern dynamic
  287. WizardBackColor=#f3f3f3
  288. WizardBackColorDynamicDark=#202020
  289. [Files]
  290. ; Replace the DestDir parameters with the following if you do not need the
  291. ; images available during uninstall:
  292. ; Flags: dontcopy noencryption
  293. Source: "MyImageNormal.png"; DestDir: "{app}"
  294. Source: "MyImageLarge.png"; DestDir: "{app}"
  295. [Code]
  296. ; Show an image on the install page only
  297. &lt;event('CurStepChanged')&gt;
  298. procedure CurStepChanged_UpdateBackImage(CurStep: TSetupStep);
  299. var
  300. PngImages: TArrayOfGraphic;
  301. begin
  302. if CurStep = ssInstall then begin
  303. SetLength(PngImages, 2);
  304. PngImages[0] := TPngImage.Create;
  305. PngImages[1] := TPngImage.Create;
  306. try
  307. ExtractTemporaryFile('MyImageNormal.png');
  308. PngImages[0].LoadFromFile(ExpandConstant('{tmp}\MyImageNormal.png'));
  309. ExtractTemporaryFile('MyImageLarge.png');
  310. PngImages[1].LoadFromFile(ExpandConstant('{tmp}\MyImageLarge.png'));
  311. WizardSetBackImage(PngImages, True, True, 150);
  312. finally
  313. PngImages[1].Free;
  314. PngImages[0].Free;
  315. end;
  316. end else if CurStep = ssPostInstall then
  317. WizardSetBackImage([], True, True, 150);
  318. end;
  319. ; Show an image during uninstall
  320. &lt;event('InitializeUninstallProgressForm')&gt;
  321. procedure InitializeUninstallProgressForm_UpdateBackImage;
  322. var
  323. PngImages: TArrayOfGraphic;
  324. begin
  325. try
  326. SetLength(PngImages, 2);
  327. PngImages[0] := TPngImage.Create;
  328. PngImages[1] := TPngImage.Create;
  329. try
  330. PngImages[0].LoadFromFile(ExpandConstant('{app}\MyImageNormal.png'));
  331. PngImages[1].LoadFromFile(ExpandConstant('{app}\MyImageLarge.png'));
  332. WizardSetBackImage(PngImages, True, False, 150);
  333. finally
  334. PngImages[1].Free;
  335. PngImages[0].Free;
  336. end;
  337. except
  338. LogFmt('Could not enable background image: %s', [GetExceptionMessage]);
  339. end;
  340. end;
  341. ; See CodeClasses.iss for another example.</pre></example>
  342. </function>
  343. </subcategory>
  344. </category>
  345. <category>
  346. <description>Exception</description>
  347. <subcategory>
  348. <function>
  349. <name>Abort</name>
  350. <prototype>procedure Abort;</prototype>
  351. <description><p>Escapes from the current execution path without reporting an error.</p>
  352. <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>
  353. <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>
  354. <p><tt>InitializeSetup<br />
  355. InitializeWizard<br />
  356. CurStepChanged(ssInstall)</tt></p>
  357. <p><tt>InitializeUninstall<br />
  358. CurUninstallStepChanged(usAppMutexCheck)<br />
  359. CurUninstallStepChanged(usUninstall)</tt></p></remarks>
  360. <seealso><p><link topic="scriptevents" anchor="PrepareToInstall">PrepareToInstall</link></p></seealso>
  361. </function>
  362. <function>
  363. <name>RaiseException</name>
  364. <prototype>procedure RaiseException(const Msg: String);</prototype>
  365. <description><p>Raises an exception with the specified message.</p></description>
  366. <example><pre>begin
  367. RaiseException('Your message goes here');
  368. // The following line will not be executed because of the exception
  369. MsgBox('You will not see this.', mbInformation, MB_OK);
  370. end;</pre></example>
  371. </function>
  372. </subcategory>
  373. <subcategory>
  374. <function>
  375. <name>GetExceptionMessage</name>
  376. <prototype>function GetExceptionMessage: String;</prototype>
  377. <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>
  378. <remarks><p>Exception messages generally do not end in a period. Pass the result of this function to AddPeriod to add one.</p></remarks>
  379. <example><pre>var
  380. I: Integer;
  381. begin
  382. I := 1;
  383. try
  384. // The following line will raise a "Division by zero" exception
  385. I := I div 0;
  386. except
  387. // Catch the exception, deal with it, and continue
  388. MsgBox('We caught this exception: ' + AddPeriod(GetExceptionMessage),
  389. mbError, MB_OK);
  390. end;
  391. end;</pre></example>
  392. </function>
  393. <function>
  394. <name>ShowExceptionMessage</name>
  395. <prototype>procedure ShowExceptionMessage;</prototype>
  396. <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>
  397. <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 or the <link topic="setup_uninstalllogging">UninstallLogging</link> [Setup] section directive or debugging from the Compiler IDE) the message will be recorded in the log file and/or in the Compiler IDE's "Debug Output" view in addition to being shown.</p></remarks>
  398. <example><pre>var
  399. I: Integer;
  400. begin
  401. I := 1;
  402. try
  403. // The following line will raise a "Division by zero" exception
  404. I := I div 0;
  405. except
  406. // Catch the exception, show it, and continue
  407. ShowExceptionMessage;
  408. end;
  409. end;</pre></example>
  410. </function>
  411. </subcategory>
  412. </category>
  413. <category>
  414. <description>System</description>
  415. <subcategory>
  416. <function>
  417. <name>IsAdmin</name>
  418. <prototype>function IsAdmin: Boolean;</prototype>
  419. <description><p>Returns True if Setup/Uninstall is running with administrative privileges.</p></description>
  420. </function>
  421. <function>
  422. <name>IsAdminInstallMode</name>
  423. <prototype>function IsAdminInstallMode: Boolean;</prototype>
  424. <description><p>Returns True if Setup is running in <link topic="admininstallmode">administrative install mode</link> or if Uninstall is running with administrative privileges.</p></description>
  425. </function>
  426. </subcategory>
  427. <subcategory>
  428. <function>
  429. <name>IsWinDark</name>
  430. <prototype>function IsWinDark: Boolean;</prototype>
  431. <description><p>Returns True if the system is running in dark mode.</p></description>
  432. <remarks><p>The system's light or dark mode setting is checked only once, at startup.</p></remarks>
  433. <seealso><p><link topic="isxfunc_IsDarkInstallMode">IsDarkInstallMode</link></p></seealso>
  434. </function>
  435. <function>
  436. <name>IsDarkInstallMode</name>
  437. <prototype>function IsDarkInstallMode: Boolean;</prototype>
  438. <description><p>Returns True if Setup or Uninstall runs with a <link topic="setup_wizardstyle">dark style</link>.</p></description>
  439. <remarks><p>Can return True even if <link topic="isxfunc_IsWinDark">IsWinDark</link> returns False.</p>
  440. <p>Cannot return True if <link topic="isxfunc_HighContrastActive">HighContrastActive</link> returns True.</p></remarks>
  441. <seealso><p><link topic="isxfunc_IsWinDark">IsWinDark</link><br/>
  442. <link topic="isxfunc_HighContrastActive">HighContrastActive</link></p></seealso>
  443. </function>
  444. <function>
  445. <name>HighContrastActive</name>
  446. <prototype>function HighContrastActive: Boolean;</prototype>
  447. <description><p>Returns True if the user's system is set to a high-contrast theme.</p></description>
  448. <seealso><p><link topic="isxfunc_IsDarkInstallMode">IsDarkInstallMode</link></p></seealso>
  449. </function>
  450. </subcategory>
  451. <subcategory>
  452. <function>
  453. <name>GetWindowsVersion</name>
  454. <prototype>function GetWindowsVersion: Cardinal;</prototype>
  455. <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 $0A002800 on Windows 10 Version 1507, which is version 10.0.10240.</p>
  456. <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>
  457. <example><pre>function IsWindows8OrLater: Boolean;
  458. begin
  459. Result := (GetWindowsVersion &gt;= $06020000);
  460. end;</pre></example>
  461. <seealso><p><link topic="isxfunc_GetWindowsVersionEx">GetWindowsVersionEx</link></p></seealso>
  462. </function>
  463. <function>
  464. <name>GetWindowsVersionEx</name>
  465. <prototype>procedure GetWindowsVersionEx(var Version: TWindowsVersion);</prototype>
  466. <description><p>Returns extended information about the version of Windows in a record.</p>
  467. <p>TWindowsVersion is defined as:</p>
  468. <pre>
  469. TWindowsVersion = record
  470. Major: Cardinal; // Major version number
  471. Minor: Cardinal; // Minor version number
  472. Build: Cardinal; // Build number
  473. ServicePackMajor: Cardinal; // Major version number of service pack
  474. ServicePackMinor: Cardinal; // Minor version number of service pack
  475. NTPlatform: Boolean; // True if an NT-based platform
  476. ProductType: Byte; // Product type (see below)
  477. SuiteMask: Word; // Product suites installed (see below)
  478. end;
  479. </pre>
  480. <p>The ProductType field can be one of the following values:</p>
  481. <pre>
  482. VER_NT_WORKSTATION
  483. VER_NT_DOMAIN_CONTROLLER
  484. VER_NT_SERVER
  485. </pre>
  486. <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>
  487. <p>The SuiteMask field can be a combination of the following values:</p>
  488. <pre>
  489. VER_SUITE_BACKOFFICE
  490. VER_SUITE_BLADE
  491. VER_SUITE_DATACENTER
  492. VER_SUITE_ENTERPRISE
  493. VER_SUITE_EMBEDDEDNT
  494. VER_SUITE_PERSONAL
  495. VER_SUITE_SINGLEUSERTS
  496. VER_SUITE_SMALLBUSINESS
  497. VER_SUITE_SMALLBUSINESS_RESTRICTED
  498. VER_SUITE_TERMINAL
  499. </pre>
  500. <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>
  501. <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>
  502. <pre>function InitializeSetup: Boolean;
  503. var
  504. Version: TWindowsVersion;
  505. S: String;
  506. begin
  507. GetWindowsVersionEx(Version);
  508. // Disallow installation on Home edition of Windows
  509. if Version.SuiteMask and VER_SUITE_PERSONAL &lt;&gt; 0 then
  510. begin
  511. SuppressibleMsgBox('This program cannot be installed on a Home edition of Windows.',
  512. mbCriticalError, MB_OK, IDOK);
  513. Result := False;
  514. Exit;
  515. end;
  516. // Disallow installation on domain controllers
  517. if Version.ProductType = VER_NT_DOMAIN_CONTROLLER then
  518. begin
  519. SuppressibleMsgBox('This program cannot be installed on domain controllers.',
  520. mbCriticalError, MB_OK, IDOK);
  521. Result := False;
  522. Exit;
  523. end;
  524. Result := True;
  525. end;</pre></example>
  526. </function>
  527. <function>
  528. <name>GetWindowsVersionString</name>
  529. <prototype>function GetWindowsVersionString: String;</prototype>
  530. <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>
  531. </function>
  532. </subcategory>
  533. <subcategory>
  534. <function>
  535. <name>IsWin64</name>
  536. <prototype>function IsWin64: Boolean;</prototype>
  537. <description><p>Returns True if the system is running a 64-bit version of Windows. If False is returned, you cannot utilize any of Inno Setup's 64-bit-only features.</p>
  538. <p>Another way to describe this function is: Returns True if the system matches architecture identifier <link topic="archidentifiers">win64</link>.</p>
  539. <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>
  540. <example><pre>begin
  541. // Check IsWin64 before using a 64-bit-only feature to
  542. // avoid an exception when running on 32-bit Windows.
  543. if IsWin64 then
  544. begin
  545. MsgBox('64-bit program files reside in: ' +
  546. ExpandConstant('{autopf64}'), mbInformation, MB_OK);
  547. end;
  548. end;</pre></example>
  549. <seealso><p><link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link><br />
  550. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  551. </function>
  552. <function>
  553. <name>Is64BitInstallMode</name>
  554. <prototype>function Is64BitInstallMode: Boolean;</prototype>
  555. <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>
  556. <remarks><p>When True is returned, it is safe to assume that <link topic="isxfunc_IsWin64">IsWin64</link> will also return True.</p></remarks>
  557. <example><pre>begin
  558. if Is64BitInstallMode then
  559. MsgBox('Installing in 64-bit mode', mbInformation, MB_OK)
  560. else
  561. MsgBox('Installing in 32-bit mode', mbInformation, MB_OK);
  562. end;</pre></example>
  563. <seealso><p><link topic="isxfunc_IsWin64">IsWin64</link><br />
  564. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  565. </function>
  566. <function>
  567. <name>ProcessorArchitecture</name>
  568. <prototype>function ProcessorArchitecture: TSetupProcessorArchitecture;</prototype>
  569. <description><p>Returns the architecture of the system's Windows installation.</p>
  570. <p><tt>TSetupProcessorArchitecture</tt> is an enumerated type, defined as:</p>
  571. <p><tt>TSetupProcessorArchitecture = (paUnknown, paX86, paX64, paArm32, paArm64);</tt></p></description>
  572. <remarks><p><tt>paUnknown</tt> is returned if Setup/Uninstall does not recognize the architecture of the Windows installation. It can be assumed that an "unknown" architecture is at least capable of executing the architecture of Setup/Uninstall itself (see <link topic="setup_setuparchitecture">SetupArchitecture</link>), or Setup/Uninstall wouldn't be running at all.</p>
  573. <p><tt>paArm32</tt> is not a possible return value for this function because no version of Windows for 32-bit Arm processors had the ability to run x86 binaries. (An x86 emulator was first introduced in Arm64 Windows.)</p></remarks>
  574. <example><pre>var
  575. S: String;
  576. begin
  577. case ProcessorArchitecture of
  578. paX86: S := 'x86';
  579. paX64: S := 'x64';
  580. paArm64: S := 'Arm64';
  581. else
  582. S := 'Unrecognized';
  583. end;
  584. MsgBox('Windows architecture: ' + S, mbInformation, MB_OK);
  585. end;</pre></example>
  586. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  587. <link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link></p></seealso>
  588. </function>
  589. <function>
  590. <name>IsArm32Compatible</name>
  591. <prototype>function IsArm32Compatible: Boolean;</prototype>
  592. <description><p>Returns True if the system matches architecture identifier <link topic="archidentifiers">arm32compatible</link>.</p></description>
  593. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  594. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  595. </function>
  596. <function>
  597. <name>IsArm64</name>
  598. <prototype>function IsArm64: Boolean;</prototype>
  599. <description><p>Returns True if the system matches architecture identifier <link topic="archidentifiers">arm64</link>.</p></description>
  600. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  601. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  602. </function>
  603. <function>
  604. <name>IsX64Compatible</name>
  605. <prototype>function IsX64Compatible: Boolean;</prototype>
  606. <description><p>Returns True if the system matches architecture identifier <link topic="archidentifiers">x64compatible</link>.</p></description>
  607. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  608. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  609. </function>
  610. <function>
  611. <name>IsX64OS</name>
  612. <prototype>function IsX64OS: Boolean;</prototype>
  613. <description><p>Returns True if the system matches architecture identifier <link topic="archidentifiers">x64os</link>.</p>
  614. <p>Before Inno Setup 6.3, <tt>IsX64OS</tt> was named <tt>IsX64</tt>. The compiler still accepts <tt>IsX64</tt> as an alias for <tt>IsX64OS</tt>, but will emit a deprecation warning when used.</p></description>
  615. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  616. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  617. </function>
  618. <function>
  619. <name>IsX86Compatible</name>
  620. <prototype>function IsX86Compatible: Boolean;</prototype>
  621. <description><p>Returns True if the system matches architecture identifier <link topic="archidentifiers">x86compatible</link>.</p></description>
  622. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  623. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  624. </function>
  625. <function>
  626. <name>IsX86OS</name>
  627. <prototype>function IsX86OS: Boolean;</prototype>
  628. <description><p>Returns True if the system matches architecture identifier <link topic="archidentifiers">x86os</link>.</p>
  629. <p>Before Inno Setup 6.3, <tt>IsX86OS</tt> was named <tt>IsX86</tt>. The compiler still accepts <tt>IsX86</tt> as an alias for <tt>IsX86OS</tt>.</p></description>
  630. <seealso><p><link topic="isarchidentifier">Architecture Identifier Matchers like IsX64Compatible</link><br />
  631. <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
  632. </function>
  633. <function>
  634. <name>IsCurrentProcess64Bit</name>
  635. <prototype>function IsCurrentProcess64Bit: Boolean;</prototype>
  636. <description><p>Returns True if Setup is built as a 64-bit x64 application, as specified by <link topic="setup_setuparchitecture">SetupArchitecture</link>.</p></description>
  637. </function>
  638. </subcategory>
  639. <subcategory>
  640. <function>
  641. <name>InstallOnThisVersion</name>
  642. <prototype>function InstallOnThisVersion(const MinVersion, OnlyBelowVersion: String): Boolean;</prototype>
  643. <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>
  644. <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>
  645. <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>
  646. <example><pre>// Old method, deprecated
  647. function IsWindows8OrLater: Boolean;
  648. begin
  649. Result := InstallOnThisVersion('0,6.2', '0,0');
  650. end;
  651. // New method
  652. function IsWindows8OrLater: Boolean;
  653. begin
  654. Result := (GetWindowsVersion &gt;= $06020000);
  655. end;</pre></example>
  656. <seealso><p><link topic="isxfunc_GetWindowsVersion">GetWindowsVersion</link><br />
  657. <link topic="isxfunc_GetWindowsVersionEx">GetWindowsVersionEx</link></p></seealso>
  658. </function>
  659. <function>
  660. <name>IsDotNetInstalled</name>
  661. <prototype>function IsDotNetInstalled(const MinVersion: TDotNetVersion; const MinServicePack: Cardinal): Boolean;</prototype>
  662. <description><p>Returns True if the .NET Framework with the specified MinVersion and MinServicePack parameters is installed.</p>
  663. <p>TDotNetVersion is defined as:</p>
  664. <p><tt>TDotNetVersion = (net11, net20, net30, net35, net4Client, net4Full, net45, net451, net452, net46, net461, net462, net47, net471, net472, net48, net481);</tt></p></description>
  665. <example><pre>function InitializeSetup: Boolean;
  666. begin
  667. Result := IsDotNetInstalled(net462, 0); //Returns True if .NET Framework version 4.6.2 is installed, or a compatible version such as 4.8.1
  668. if not Result then
  669. SuppressibleMsgBox(FmtMessage(SetupMessage(msgWinVersionTooLowError), ['.NET Framework', '4.6.2']), mbCriticalError, MB_OK, IDOK);
  670. end;</pre></example>
  671. </function>
  672. <function>
  673. <name>IsMsiProductInstalled</name>
  674. <prototype>function IsMsiProductInstalled(const UpgradeCode: String; const PackedMinVersion: Int64): Boolean;</prototype>
  675. <description><p>Returns True if a MSI product with the specified UpgradeCode and PackedMinVersion is installed.</p>
  676. <p>If there are multiple products installed with the specified UpgradeCode only the version of the first product returned by the system is checked.</p>
  677. <p>An exception will be raised if an error occurs.</p></description>
  678. <example><pre>function InitializeSetup: Boolean;
  679. begin
  680. Result := IsMsiProductInstalled('{20400CF0-DE7C-327E-9AE4-F0F38D9085F8}', PackVersionComponents(12, 0, 0, 0)); //Returns True if Visual C++ 2013 Redistributable (x64) is installed
  681. if not Result then
  682. SuppressibleMsgBox(FmtMessage(SetupMessage(msgWinVersionTooLowError), ['Visual C++ 2013 Redistributable (x64)', '12.0']), mbCriticalError, MB_OK, IDOK);
  683. end;</pre></example>
  684. </function>
  685. </subcategory>
  686. <subcategory>
  687. <function>
  688. <name>GetEnv</name>
  689. <prototype>function GetEnv(const EnvVar: String): String;</prototype>
  690. <description><p>Gets the value of the specified environment variable.</p></description>
  691. </function>
  692. <function>
  693. <name>GetUserNameString</name>
  694. <prototype>function GetUserNameString: String;</prototype>
  695. <description><p>Retrieves the name of the user currently logged onto the system.</p></description>
  696. </function>
  697. <function>
  698. <name>GetComputerNameString</name>
  699. <prototype>function GetComputerNameString: String;</prototype>
  700. <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>
  701. </function>
  702. </subcategory>
  703. <subcategory>
  704. <function>
  705. <name>GetUILanguage</name>
  706. <prototype>function GetUILanguage: Integer;</prototype>
  707. <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>
  708. <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>
  709. <example><pre>begin
  710. if GetUILanguage = $0409 then
  711. begin
  712. // UI language is English (United States)
  713. end;
  714. // You can use "and $3FF" to extract the primary language identifier
  715. if GetUILanguage and $3FF = $09 then
  716. begin
  717. // Matches any variant of English
  718. end;
  719. end;</pre></example>
  720. </function>
  721. </subcategory>
  722. <subcategory>
  723. <function>
  724. <name>FontExists</name>
  725. <prototype>function FontExists(const FaceName: String): Boolean;</prototype>
  726. <description><p>Returns True if a font with the specified face name is installed on the system.</p></description>
  727. </function>
  728. </subcategory>
  729. <subcategory>
  730. <function>
  731. <name>FindWindowByClassName</name>
  732. <prototype>function FindWindowByClassName(const ClassName: String): HWND;</prototype>
  733. <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>
  734. </function>
  735. <function>
  736. <name>FindWindowByWindowName</name>
  737. <prototype>function FindWindowByWindowName(const WindowName: String): HWND;</prototype>
  738. <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>
  739. </function>
  740. <function>
  741. <name>SendMessage</name>
  742. <prototype>function SendMessage(const Wnd: HWND; const Msg: Cardinal; const WParam: WPARAM; const LParam: LPARAM): LRESULT;</prototype>
  743. <description><p>Sends the specified message to the specified window. Does not return until the window procedure has processed the message.</p></description>
  744. </function>
  745. <function>
  746. <name>PostMessage</name>
  747. <prototype>function PostMessage(const Wnd: HWND; const Msg: Cardinal; const WParam: WPARAM; const LParam: LPARAM): Boolean;</prototype>
  748. <description><p>Posts the specified message to the specified window, returning immediately. Returns True if successful.</p></description>
  749. </function>
  750. <function>
  751. <name>SendNotifyMessage</name>
  752. <prototype>function SendNotifyMessage(const Wnd: HWND; const Msg: Cardinal; const WParam: WPARAM; const LParam: LPARAM): Boolean;</prototype>
  753. <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>
  754. </function>
  755. <function>
  756. <name>RegisterWindowMessage</name>
  757. <prototype>function RegisterWindowMessage(const Name: String): Cardinal;</prototype>
  758. <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>
  759. </function>
  760. <function>
  761. <name>SendBroadcastMessage</name>
  762. <prototype>function SendBroadcastMessage(const Msg: Cardinal; const WParam: WPARAM; const LParam: LPARAM): LRESULT;</prototype>
  763. <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>
  764. </function>
  765. <function>
  766. <name>PostBroadcastMessage</name>
  767. <prototype>function PostBroadcastMessage(const Msg: Cardinal; const WParam: WPARAM; const LParam: LPARAM): Boolean;</prototype>
  768. <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>
  769. </function>
  770. <function>
  771. <name>SendBroadcastNotifyMessage</name>
  772. <prototype>function SendBroadcastNotifyMessage(const Msg: Cardinal; const WParam: WPARAM; const LParam: LPARAM): Boolean;</prototype>
  773. </function>
  774. </subcategory>
  775. <subcategory>
  776. <function>
  777. <name>CreateMutex</name>
  778. <prototype>procedure CreateMutex(const Name: String);</prototype>
  779. <description><p>Creates a mutex with the specified name.</p></description>
  780. </function>
  781. <function>
  782. <name>CheckForMutexes</name>
  783. <prototype>function CheckForMutexes(Mutexes: String): Boolean;</prototype>
  784. <description><p>Returns True if any of the mutexes in the comma-separated Mutexes string exist.</p></description>
  785. </function>
  786. </subcategory>
  787. <subcategory>
  788. <function>
  789. <name>MakePendingFileRenameOperationsChecksum</name>
  790. <prototype>procedure MakePendingFileRenameOperationsChecksum: String;</prototype>
  791. <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>
  792. <example><pre>var
  793. ChecksumBefore, ChecksumAfter: String;
  794. begin
  795. ChecksumBefore := MakePendingFileRenameOperationsChecksum;
  796. // ...run a program...
  797. ChecksumAfter := MakePendingFileRenameOperationsChecksum;
  798. if ChecksumAfter &lt;&gt; ChecksumBefore then
  799. // PendingFileRenameOperations or WININIT.INI changed
  800. end;</pre></example>
  801. </function>
  802. </subcategory>
  803. <subcategory>
  804. <function>
  805. <name>CreateCallback</name>
  806. <prototype>function CreateCallback(Method: AnyMethod): NativeInt;</prototype>
  807. <description><p>Allows you to perform direct callbacks from DLL functions (like Windows API functions) to functions in your script.</p></description>
  808. <example><pre>function SetTimer(hWnd: HWND; nIDEvent: UINT_PTR; uElapse: UINT; lpTimerFunc: NativeInt): UINT_PTR;
  809. external '[email protected] stdcall';
  810. var
  811. TimerCount: Integer;
  812. procedure MyTimerProc(Arg1: HWND; Arg2: UINT; Arg3: UINT_PTR; Arg4: DWORD);
  813. begin
  814. Inc(TimerCount);
  815. WizardForm.BeveledLabel.Caption := ' Timer! ' + IntToStr(TimerCount);
  816. WizardForm.BeveledLabel.Visible := True;
  817. end;
  818. procedure InitializeWizard;
  819. begin
  820. SetTimer(0, 0, 1000, CreateCallback(@MyTimerProc));
  821. end;</pre></example>
  822. </function>
  823. <function>
  824. <name>UnloadDLL</name>
  825. <prototype>procedure UnloadDLL(Filename: String);</prototype>
  826. <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>
  827. <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>
  828. <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>
  829. <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>
  830. <example><pre>procedure DllFunc; external 'DllFunc@{app}\MyDll.dll stdcall uninstallonly';
  831. ...
  832. begin
  833. // Call DllFunc
  834. DllFunc;
  835. // Unload the DLL
  836. UnloadDLL(ExpandConstant('{app}\MyDll.dll'));
  837. // Now we can delete the DLL
  838. DeleteFile(ExpandConstant('{app}\MyDll.dll'));
  839. end;</pre></example>
  840. </function>
  841. <function>
  842. <name>DLLGetLastError</name>
  843. <prototype>function DLLGetLastError(): LongInt;</prototype>
  844. <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>
  845. <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>
  846. <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>
  847. <example><pre>function MessageBox(hWnd: Integer; lpText, lpCaption: AnsiString; uType: Cardinal): Integer; external '[email protected] stdcall';
  848. ...
  849. begin
  850. if MessageBox(-1, '', '', -1) = 0 then
  851. MsgBox(SysErrorMessage(DLLGetLastError), mbError, mb_Ok);</pre></example>
  852. </function>
  853. </subcategory>
  854. </category>
  855. <category>
  856. <description>String</description>
  857. <subcategory>
  858. <function>
  859. <name>Chr</name>
  860. <prototype>function Chr(X: Word): Char;</prototype>
  861. <description><p>Returns the character with the specified ordinal value.</p></description>
  862. </function>
  863. <function>
  864. <name>Ord</name>
  865. <prototype>function Ord(X: Ordinal): UInt64;</prototype>
  866. <description><p>Returns the ordinal value of the specified character, integer or enumeration value.</p></description>
  867. </function>
  868. <function>
  869. <name>Copy</name>
  870. <prototype>function Copy(S: AnyString; Index, Count: Integer): String;</prototype>
  871. <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>
  872. </function>
  873. <function>
  874. <name>Length</name>
  875. <prototype>function Length(S: AnyString): LongInt;</prototype>
  876. <description><p>Returns the length of the specified string.</p></description>
  877. </function>
  878. <function>
  879. <name>LowerCase</name>
  880. <prototype>function LowerCase(S: AnyString): String;</prototype>
  881. <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>
  882. </function>
  883. <function>
  884. <name>UpperCase</name>
  885. <prototype>function UpperCase(S: AnyString): String;</prototype>
  886. <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>
  887. </function>
  888. <function>
  889. <name>AnsiLowerCase</name>
  890. <prototype>function AnsiLowerCase(S: AnyString): String;</prototype>
  891. <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>
  892. </function>
  893. <function>
  894. <name>AnsiUpperCase</name>
  895. <prototype>function AnsiUpperCase(S: AnyString): String;</prototype>
  896. <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>
  897. </function>
  898. <function>
  899. <name>StringOfChar</name>
  900. <prototype>function StringOfChar(C: Char; I : LongInt): String;</prototype>
  901. <description><p>Returns a string of length I with all characters set to character C.</p></description>
  902. </function>
  903. <function>
  904. <name>Delete</name>
  905. <prototype>procedure Delete(var S: AnyString; Index, Count: Integer);</prototype>
  906. <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>
  907. </function>
  908. <function>
  909. <name>Insert</name>
  910. <prototype>procedure Insert(Source: AnyString; var Dest: AnyString; Index: Integer);</prototype>
  911. <description><p>Merges Source into Dest at the position Dest[Index].</p></description>
  912. </function>
  913. <function>
  914. <name>StringChange</name>
  915. <prototype>function StringChange(var S: String; const FromStr, ToStr: String): Integer;</prototype>
  916. <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>
  917. </function>
  918. <function>
  919. <name>StringChangeEx</name>
  920. <prototype>function StringChangeEx(var S: String; const FromStr, ToStr: String; const SupportDBCS: Boolean): Integer;</prototype>
  921. <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>
  922. <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>
  923. <example><pre>var
  924. S: String;
  925. begin
  926. S := ExpandConstant('{commonappdata}');
  927. // S = 'C:\Documents and Settings\All Users\Application Data'
  928. StringChangeEx(S, '\', '/', True);
  929. // S = 'C:/Documents and Settings/All Users/Application Data'
  930. end;</pre></example>
  931. </function>
  932. <function>
  933. <name>Pos</name>
  934. <prototype>function Pos(SubStr, S: AnyString): Integer;</prototype>
  935. <description><p>Searches for SubStr within S and returns the first index of SubStr within S, 1-based. If SubStr is not found, Pos returns zero. The Pos function is case-sensitive.</p></description>
  936. <seealso><p><link topic="isxfunc_RPos">RPos</link></p></seealso>
  937. </function>
  938. <function>
  939. <name>RPos</name>
  940. <prototype>function RPos(SubStr, S: String): Integer;</prototype>
  941. <description><p>Searches for SubStr within S and returns the last index of SubStr within S, 1-based. If SubStr is not found, RPos returns zero. The RPos function is case-sensitive.</p></description>
  942. <seealso><p><link topic="isxfunc_Pos">Pos</link></p></seealso>
  943. </function>
  944. <function>
  945. <name>AddQuotes</name>
  946. <prototype>function AddQuotes(const S: String): String;</prototype>
  947. <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>
  948. </function>
  949. <function>
  950. <name>RemoveQuotes</name>
  951. <prototype>function RemoveQuotes(const S: String): String;</prototype>
  952. <description><p>Opposite of AddQuotes; removes any quotes around the string.</p></description>
  953. </function>
  954. <function>
  955. <name>ConvertPercentStr</name>
  956. <prototype>function ConvertPercentStr(var S: String): Boolean;</prototype>
  957. <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>
  958. </function>
  959. </subcategory>
  960. <subcategory>
  961. <function>
  962. <name>CompareText</name>
  963. <prototype>function CompareText(const S1, S2: String): Integer;</prototype>
  964. <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>
  965. </function>
  966. <function>
  967. <name>CompareStr</name>
  968. <prototype>function CompareStr(const S1, S2: String): Integer;</prototype>
  969. <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>
  970. </function>
  971. <function>
  972. <name>SameText</name>
  973. <prototype>function SameText(const S1, S2: String): Boolean;</prototype>
  974. <description><p>Compares the strings S1 and S2 and returns True if they are equal. The SameText function is not case-sensitive.</p></description>
  975. </function>
  976. <function>
  977. <name>SameStr</name>
  978. <prototype>function SameStr(const S1, S2: String): Boolean;</prototype>
  979. <description><p>Compares S1 to S2, with case-sensitivity. The return value is True if they are equal.</p></description>
  980. </function>
  981. <function>
  982. <name>IsWildcard</name>
  983. <prototype>function IsWildcard(const Pattern: String): Boolean;</prototype>
  984. <description><p>Returns True if the specified pattern contains a wildcard.</p></description>
  985. </function>
  986. <function>
  987. <name>WildcardMatch</name>
  988. <prototype>function WildcardMatch(const Text, Pattern: String): Boolean;</prototype>
  989. <description><p>Returns True if the specified text matches the specified pattern.</p></description>
  990. </function>
  991. </subcategory>
  992. <subcategory>
  993. <function>
  994. <name>Format</name>
  995. <prototype>function Format(const Format: String; const Args: array of const): String;</prototype>
  996. <description><p>Formats the string Format using 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>
  997. <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>
  998. <example><pre>var
  999. S: String;
  1000. I: Integer;
  1001. begin
  1002. S := Format('%d files found', [10]);
  1003. // S = '10 files found'
  1004. S := Format('Filename: %s', ['file.txt']);
  1005. // S = 'Filename: file.txt'
  1006. I := 64;
  1007. S := Format('%d in hex, padded to 8 digits: %.8x', [I, I]);
  1008. // S = '64 in hex, padded to 8 digits: 00000040'
  1009. end;</pre></example>
  1010. </function>
  1011. </subcategory>
  1012. <subcategory>
  1013. <function>
  1014. <name>Trim</name>
  1015. <prototype>function Trim(const S: AnyString): AnyString;</prototype>
  1016. <description><p>Trims leading and trailing spaces and control characters from the given string S.</p></description>
  1017. </function>
  1018. <function>
  1019. <name>TrimLeft</name>
  1020. <prototype>function TrimLeft(const S: String): String;</prototype>
  1021. <description><p>Trims leading spaces and control characters from the given string S.</p></description>
  1022. </function>
  1023. <function>
  1024. <name>TrimRight</name>
  1025. <prototype>function TrimRight(const S: String): String;</prototype>
  1026. <description><p>Trims trailing spaces and control characters from the given string S.</p></description>
  1027. </function>
  1028. <function>
  1029. <name>StringJoin</name>
  1030. <prototype>function StringJoin(const Separator: String; const Values: TArrayOfString): String;</prototype>
  1031. <description><p>Joins two or more strings together separated by the given separator.</p></description>
  1032. <example><pre>var
  1033. S: String;
  1034. begin
  1035. S := StringJoin(',', ['1', '2']);
  1036. // S = '1,2'
  1037. end;
  1038. </pre></example>
  1039. <seealso><p><link topic="isxfunc_StringSplit">StringSplit</link></p></seealso>
  1040. </function>
  1041. <function>
  1042. <name>StringSplit</name>
  1043. <prototype>function StringSplit(const S: String; const Separators: TArrayOfString; const Typ: TSplitType): TArrayOfString;</prototype>
  1044. <description><p>Splits the given string into substrings, using the given characters or strings to be used as separator. Empty substrings can be ignored.</p>
  1045. <p>TSplitType is defined as:</p>
  1046. <p><tt>TSplitType = (stAll, stExcludeEmpty, stExcludeLastEmpty);</tt></p></description>
  1047. <example><pre>var
  1048. A: array of String;
  1049. begin
  1050. A := StringSplit('1,,2', [','], stExcludeEmpty);
  1051. // A = ['1','2']
  1052. end;
  1053. </pre></example>
  1054. <seealso><p><link topic="isxfunc_StringJoin">StringJoin</link><br />
  1055. <link topic="isxfunc_StringSplitEx">StringSplitEx</link></p></seealso>
  1056. </function>
  1057. <function>
  1058. <name>StringSplitEx</name>
  1059. <prototype>function StringSplitEx(const S: String; const Separators: TArrayOfString; const Quote: Char; const Typ: TSplitType): TArrayOfString;</prototype>
  1060. <description><p>Splits the given string into substrings, using the given characters or strings to be used as separator. Empty substrings can be ignored. Use the Quote parameter to specify the start and end character of a quoted part of the string where separators are ignored.</p>
  1061. <p>TSplitType is defined as:</p>
  1062. <p><tt>TSplitType = (stAll, stExcludeEmpty, stExcludeLastEmpty);</tt></p></description>
  1063. <example><pre>var
  1064. A: array of String;
  1065. begin
  1066. A := StringSplitEx('1,",",2', [','], '"', stAll);
  1067. // A = ['1','","','2']
  1068. end;
  1069. </pre></example>
  1070. <seealso><p><link topic="isxfunc_StringSplit">StringSplit</link></p></seealso>
  1071. </function>
  1072. </subcategory>
  1073. <subcategory>
  1074. <function>
  1075. <name>StrToIntDef</name>
  1076. <prototype>function StrToIntDef(S: String; Def: LongInt): LongInt;</prototype>
  1077. <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>
  1078. </function>
  1079. <function>
  1080. <name>StrToInt</name>
  1081. <prototype>function StrToInt(S: String): LongInt;</prototype>
  1082. <description><p>The StrToInt function converts the string passed in S into a number. Returns -1 if not successful.</p></description>
  1083. <remarks><p>Use of <link topic="isxfunc_StrToIntDef">StrToIntDef</link> instead of StrToInt is recommended.</p></remarks>
  1084. </function>
  1085. <function>
  1086. <name>StrToInt64Def</name>
  1087. <prototype>function StrToInt64Def(S: String; Def: Int64): Int64;</prototype>
  1088. <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></description>
  1089. </function>
  1090. <function>
  1091. <name>StrToInt64</name>
  1092. <prototype>function StrToInt64(S: String): Int64;</prototype>
  1093. <description><p>The StrToInt64 function converts the string passed in S into a 64-bit number. Raises an exception if not successful.</p></description>
  1094. <remarks><p>Use of <link topic="isxfunc_StrToInt64Def">StrToInt64Def</link> instead of StrToInt64 is recommended.</p></remarks>
  1095. </function>
  1096. <function>
  1097. <name>StrToFloat</name>
  1098. <prototype>function StrToFloat(S: String): Extended;</prototype>
  1099. <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. Raises an exception if not successful.</p></description>
  1100. </function>
  1101. <function>
  1102. <name>StrToColor</name>
  1103. <prototype>function StrToColor(S: String): TColor;</prototype>
  1104. <description><p>The StrToColor function converts the string passed in S, formatted as <tt>'#rrggbb'</tt>, into a color. Raises an exception if not successful.</p></description>
  1105. </function>
  1106. <function>
  1107. <name>IntToStr</name>
  1108. <prototype>function IntToStr(I: Int64): String;</prototype>
  1109. <description><p>The IntToStr function converts a 64-bit number into a string.</p></description>
  1110. </function>
  1111. <function>
  1112. <name>FloatToStr</name>
  1113. <prototype>function FloatToStr(E: Extended): String;</prototype>
  1114. <description><p>The FloatToStr function converts a floating point number into a string. The character used for the decimal point will always be a dot.</p></description>
  1115. </function>
  1116. </subcategory>
  1117. <subcategory>
  1118. <function>
  1119. <name>CharLength</name>
  1120. <prototype>function CharLength(const S: String; const Index: Integer): Integer;</prototype>
  1121. <description><p>Returns the length in characters of the character in the specified string at the specified index, which is currently always 1.</p></description>
  1122. </function>
  1123. </subcategory>
  1124. <subcategory>
  1125. <function>
  1126. <name>AddBackslash</name>
  1127. <prototype>function AddBackslash(const S: String): String;</prototype>
  1128. <description><p>Returns the specified string with a trailing backslash added, unless the string is empty or already ends in a slash or backslash.</p></description>
  1129. </function>
  1130. <function>
  1131. <name>RemoveBackslashUnlessRoot</name>
  1132. <prototype>function RemoveBackslashUnlessRoot(const S: String): String;</prototype>
  1133. <description><p>Returns the specified string with any trailing slashes/backslashes removed, unless the string specifies the root directory of a drive (e.g. "C:\" or "\"), in which case it leaves 1 slash.</p></description>
  1134. </function>
  1135. <function>
  1136. <name>RemoveBackslash</name>
  1137. <prototype>function RemoveBackslash(const S: String): String;</prototype>
  1138. <description><p>Returns the specified string with any trailing slashes/backslashes removed.</p></description>
  1139. <remarks><p>Use of this function is discouraged; use <link topic="isxfunc_RemoveBackslashUnlessRoot">RemoveBackslashUnlessRoot</link> instead when working with file system paths.</p></remarks>
  1140. </function>
  1141. <function>
  1142. <name>PathCombine</name>
  1143. <prototype>function PathCombine(const Dir, Filename: String): String;</prototype>
  1144. <description><p>Combines a directory and file name into a single path. If Filename is empty the result is an empty string. If Filename already starts with a drive letter or slash it is returned unchanged. Otherwise a single backslash is inserted between Dir and Filename when needed.</p></description>
  1145. </function>
  1146. <function>
  1147. <name>PathHasInvalidCharacters</name>
  1148. <prototype>function PathHasInvalidCharacters(const S: String; const AllowDriveLetterColon: Boolean): Boolean;</prototype>
  1149. <description><p>Returns True if the specified string contains characters that are never allowed in paths, or characters and path components that are accepted by the system but might present a security problem (such as '..' and sometimes ':'). Set AllowDriveLetterColon to True when the first character may be a drive letter followed by a colon.</p></description>
  1150. <remarks><p>Extended-length paths that start with a "\\?\" prefix are rejected because the '?' is treated as an invalid character.</p></remarks>
  1151. </function>
  1152. <function>
  1153. <name>PathIsRooted</name>
  1154. <prototype>function PathIsRooted(const Filename: String): Boolean;</prototype>
  1155. <description><p>Returns True if the specified path begins with a drive letter and colon, or a slash.</p></description>
  1156. </function>
  1157. <function>
  1158. <name>PathNormalizeSlashes</name>
  1159. <prototype>function PathNormalizeSlashes(const S: String): String;</prototype>
  1160. <description><p>Returns specified string minus any superfluous slashes, and with any forward slashes
  1161. converted to backslashes. Does not remove a double backslash at the beginning of the string, since that signifies a UNC path.</p></description>
  1162. </function>
  1163. <function>
  1164. <name>PathSame</name>
  1165. <prototype>function PathSame(const S1, S2: String): Boolean;</prototype>
  1166. <description><p>Returns True if the specified strings (typically filenames) are equal. Uses a locale-independent "ordinal" comparison, which is important when comparing filenames/paths. Ignores case.</p></description>
  1167. <remarks><p>Does not consider an extended-length path and its normal version to be the same.</p></remarks>
  1168. </function>
  1169. <function>
  1170. <name>PathStartsWith</name>
  1171. <prototype>function PathStartsWith(const S, AStartsWith: String; const IgnoreCase: Boolean): Boolean;</prototype>
  1172. <description><p>Returns True if S starts with (or is equal to) AStartsWith. Uses a locale-independent "ordinal" comparison, which is important when comparing filenames/paths. Optionally ignores case.</p></description>
  1173. <seealso><p><link topic="isxfunc_PathEndsWith">PathEndsWith</link></p></seealso>
  1174. </function>
  1175. <function>
  1176. <name>PathEndsWith</name>
  1177. <prototype>function PathEndsWith(const S, AEndsWith: String; const IgnoreCase: Boolean): Boolean;</prototype>
  1178. <description><p>Returns True if S ends with (or is equal to) AEndsWith. Uses a locale-independent "ordinal" comparison, which is important when comparing filenames/paths. Optionally ignores case.</p></description>
  1179. <seealso><p><link topic="isxfunc_PathStartsWith">PathStartsWith</link></p></seealso>
  1180. </function>
  1181. <function>
  1182. <name>AddPeriod</name>
  1183. <prototype>function AddPeriod(const S: String): String;</prototype>
  1184. <description><p>Returns the specified string with a trailing period added, unless the string is empty or already ends in a period or other punctuation mark.</p></description>
  1185. </function>
  1186. <function>
  1187. <name>ChangeFileExt</name>
  1188. <prototype>function ChangeFileExt(const FileName, Extension: String): String;</prototype>
  1189. <description><p>Takes the file name passed in FileName and changes the extension of the file name to the extension passed in Extension.</p></description>
  1190. </function>
  1191. <function>
  1192. <name>ExtractFileExt</name>
  1193. <prototype>function ExtractFileExt(const FileName: String): String;</prototype>
  1194. <description><p>Extracts the extension part of the given file name. The resulting string includes the period character that separates the name and extension parts. The resulting string is empty if the given filename has no extension.</p></description>
  1195. </function>
  1196. <function>
  1197. <name>ExtractFileDir</name>
  1198. <prototype>function ExtractFileDir(const FileName: String): String;</prototype>
  1199. <description><p>Extracts the drive and directory parts of the given file name, excluding a trailing backslash (unless it is a root directory). The resulting string is empty if FileName contains no drive and directory parts.</p></description>
  1200. <seealso><p><link topic="isxfunc_ExtractFilePath">ExtractFilePath</link></p></seealso>
  1201. </function>
  1202. <function>
  1203. <name>ExtractFilePath</name>
  1204. <prototype>function ExtractFilePath(const FileName: String): String;</prototype>
  1205. <description><p>Extracts the drive and directory parts of the given file name, including a trailing backslash. The resulting string is the leftmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts.</p></description>
  1206. <seealso><p><link topic="isxfunc_ExtractFileDir">ExtractFileDir</link></p></seealso>
  1207. </function>
  1208. <function>
  1209. <name>ExtractFileName</name>
  1210. <prototype>function ExtractFileName(const FileName: String): String;</prototype>
  1211. <description><p>Extracts the name and extension parts of the given file name. The resulting string is the rightmost characters of FileName, starting with the first character after the colon or backslash that separates the path information from the name and extension. The resulting string is equal to FileName if FileName contains no drive and directory parts.</p></description>
  1212. </function>
  1213. <function>
  1214. <name>ExtractFileDrive</name>
  1215. <prototype>function ExtractFileDrive(const FileName: String): String;</prototype>
  1216. <description><p>Returns a string containing the 'drive' portion of a fully qualified path name for the file passed in FileName. For file names with drive letters, the resulting string is in the form '&lt;drive&gt;:'. For file names with a UNC path the resulting string is in the form '\\&lt;servername&gt;\&lt;sharename&gt;'. If the given path contains neither style of path prefix, the result is an empty string.</p></description>
  1217. </function>
  1218. <function>
  1219. <name>ExtractRelativePath</name>
  1220. <prototype>function ExtractRelativePath(const BaseName, DestName: String): String;</prototype>
  1221. <description><p>Converts a fully qualified path name into a relative path name. The DestName parameter specifies the file name (including path) to be converted. BaseName is the fully qualified name of the base directory to which the returned path name should be relative. BaseName may or may not include a file name, but it must include the final path delimiter.</p>
  1222. <p>ExtractRelativePath strips out common path directories and inserts '..\' for each level up from the BaseName.</p></description>
  1223. <example><pre>var
  1224. S: String;
  1225. begin
  1226. S := ExtractRelativePath('c:\windows\system32\', 'c:\autoexec.bat');
  1227. // S = ..\..\autoexec.bat
  1228. end;</pre></example>
  1229. </function>
  1230. <function>
  1231. <name>ExpandFileName</name>
  1232. <prototype>function ExpandFileName(const FileName: String): String;</prototype>
  1233. <description><p>Returns a string containing a fully qualified path name for the file passed in FileName. A fully qualified path name includes the drive letter and any directory and subdirectories in addition to the file name and extension.</p>
  1234. <p>An empty string is returned if the input is an empty string or contains only spaces.</p>
  1235. <p>An exception will be raised upon failure, which is only known to happen when the input or output path exceeds 32K characters.</p></description>
  1236. </function>
  1237. <function>
  1238. <name>ExpandUNCFileName</name>
  1239. <prototype>function ExpandUNCFileName(const FileName: String): String;</prototype>
  1240. <description><p>Returns a string containing a fully qualified path name for the file passed in FileName. A fully qualified path name includes the drive portion of the filename in the UNC format '\\&lt;servername&gt;\&lt;sharename&gt;' if the drive letter is mapped to a network resource instead of a local drive and any directory and subdirectories in addition to the file name and extension.</p></description>
  1241. </function>
  1242. <function>
  1243. <name>PathConvertNormalToSuper</name>
  1244. <prototype>function PathConvertNormalToSuper(const Filename: String; out SuperFilename: String; const Expand: Boolean): Boolean;</prototype>
  1245. <description><p>Converts a normal path to an extended-length path (also known as a super path). Set Expand to True unless you are sure that Filename is already an absolute (non-relative) path. Returns True if successful, False otherwise. Does not fail if the specified path already is an extended-length path.</p></description>
  1246. <seealso><p><link topic="isxfunc_ApplyPathRedirRules">ApplyPathRedirRules</link><br/>
  1247. <link topic="isxfunc_PathConvertSuperToNormal">PathConvertSuperToNormal</link></p></seealso>
  1248. </function>
  1249. <function>
  1250. <name>PathConvertSuperToNormal</name>
  1251. <prototype>function PathConvertSuperToNormal(const FileName: String): String;</prototype>
  1252. <description><p>Converts an extended-length path (also known as a super path) to a normal path.</p></description>
  1253. <remarks><p>Only use this function in cases where an extended-length path is known to not work properly.</p></remarks>
  1254. <seealso><p><link topic="isxfunc_ApplyPathRedirRules">ApplyPathRedirRules</link><br/>
  1255. <link topic="isxfunc_PathConvertNormalToSuper">PathConvertNormalToSuper</link></p></seealso>
  1256. </function>
  1257. </subcategory>
  1258. <subcategory>
  1259. <function>
  1260. <name>GetDateTimeString</name>
  1261. <prototype>function GetDateTimeString(const DateTimeFormat: String; const DateSeparator, TimeSeparator: Char): String;</prototype>
  1262. <description><p>Returns the current date and time as a string using the specified formatting. The following format specifiers are supported:<br />
  1263. <br />
  1264. d Displays the day as a number without a leading zero (1-31).<br />
  1265. dd Displays the day as a number with a leading zero (01-31).<br />
  1266. ddd Displays the day as an abbreviation (Sun-Sat).<br />
  1267. dddd Displays the day as a full name (Sunday-Saturday).<br />
  1268. ddddd Displays the date using the system's short date format.<br />
  1269. dddddd Displays the date using the system's long date format.<br />
  1270. m Displays the month as a number without a leading zero (1-12).<br />
  1271. If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.<br />
  1272. mm Displays the month as a number with a leading zero (01-12).<br />
  1273. If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.<br />
  1274. mmm Displays the month as an abbreviation (Jan-Dec).<br />
  1275. mmmm Displays the month as a full name (January-December).<br />
  1276. yy Displays the year as a two-digit number (00-99).<br />
  1277. yyyy Displays the year as a four-digit number (0000-9999).<br />
  1278. h Displays the hour without a leading zero (0-23).<br />
  1279. hh Displays the hour with a leading zero (00-23).<br />
  1280. n Displays the minute without a leading zero (0-59).<br />
  1281. nn Displays the minute with a leading zero (00-59).<br />
  1282. s Displays the second without a leading zero (0-59).<br />
  1283. ss Displays the second with a leading zero (00-59).<br />
  1284. t Displays the time using the system's short time format.<br />
  1285. tt Displays the time using the system's long time format.<br />
  1286. am/pm Uses the 12-hour clock for the preceding h or hh specifier.<br />
  1287. Displays 'am' for any hour before noon, and 'pm' for any hour after noon.<br />
  1288. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.<br />
  1289. a/p Uses the 12-hour clock for the preceding h or hh specifier.<br />
  1290. Displays 'a' for any hour before noon, and 'p' for any hour after noon.<br />
  1291. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.<br />
  1292. / Displays the date separator character given by the DateSeparator parameter.<br />
  1293. If DateSeparator is set to #0, the system's date separator character will be used instead.<br />
  1294. : Displays the time separator character given by the TimeSeparator parameter.<br />
  1295. If TimeSeparator is set to #0, the system's time separator character will be used instead.<br />
  1296. 'xx'/"xx" Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting.<br />
  1297. <br />
  1298. Format specifiers may be written in upper case as well as in lower case letters--both produce the same result.</p></description>
  1299. <example><pre>
  1300. GetDateTimeString('ddddd', #0, #0);
  1301. GetDateTimeString('ddddd tt', #0, #0);
  1302. GetDateTimeString('dd/mm/yyyy hh:nn:ss', '-', ':');
  1303. </pre></example>
  1304. </function>
  1305. </subcategory>
  1306. <subcategory>
  1307. <function>
  1308. <name>SetLength</name>
  1309. <prototype>procedure SetLength(var S: AnyString; L: LongInt);</prototype>
  1310. <description><p>Sets the length of a string.</p></description>
  1311. </function>
  1312. <function>
  1313. <name>CharToOemBuff</name>
  1314. <prototype>procedure CharToOemBuff(var S: AnsiString);</prototype>
  1315. <description><p>Translates an ANSI string to a string with characters from the OEM-defined character set.</p></description>
  1316. </function>
  1317. <function>
  1318. <name>OemToCharBuff</name>
  1319. <prototype>procedure OemToCharBuff(var S: AnsiString);</prototype>
  1320. <description><p>Translates a string with characters from the OEM-defined character set into an ANSI string.</p></description>
  1321. </function>
  1322. <function>
  1323. <name>Utf8Encode</name>
  1324. <prototype>function Utf8Encode(const S: String): AnsiString;</prototype>
  1325. <description><p>Encodes a Unicode string into a UTF-8 encoded ANSI string.</p></description>
  1326. </function>
  1327. <function>
  1328. <name>Utf8Decode</name>
  1329. <prototype>function Utf8Decode(const S: AnsiString): String;</prototype>
  1330. <description><p>Decodes a UTF-8 encoded ANSI string into a Unicode string.</p></description>
  1331. </function>
  1332. </subcategory>
  1333. <subcategory>
  1334. <function>
  1335. <name>GetMD5OfString</name>
  1336. <prototype>function GetMD5OfString(const S: AnsiString): String;</prototype>
  1337. <description><p>Gets the MD5 sum of the specified string, as a string.</p></description>
  1338. <example><pre>var
  1339. MD5: String;
  1340. begin
  1341. MD5 := GetMD5OfString('Test');
  1342. // MD5 = '0cbc6611f5540bd0809a388dc95a615b'
  1343. end;
  1344. </pre></example>
  1345. </function>
  1346. <function>
  1347. <name>GetMD5OfUnicodeString</name>
  1348. <prototype>function GetMD5OfUnicodeString(const S: String): String;</prototype>
  1349. <description><p>Gets the MD5 sum of the specified string, as a string.</p></description>
  1350. <example><pre>var
  1351. MD5: String;
  1352. begin
  1353. MD5 := GetMD5OfUnicodeString('Test');
  1354. // MD5 = '8e06915d5f5d4f8754f51892d884c477'
  1355. end;
  1356. </pre></example>
  1357. </function>
  1358. <function>
  1359. <name>GetSHA1OfString</name>
  1360. <prototype>function GetSHA1OfString(const S: AnsiString): String;</prototype>
  1361. <description><p>Gets the SHA-1 hash of the specified string, as a string.</p></description>
  1362. <example><pre>var
  1363. SHA1: String;
  1364. begin
  1365. SHA1 := GetSHA1OfString('Test');
  1366. // SHA1 = '640ab2bae07bedc4c163f679a746f7ab7fb5d1fa'
  1367. end;
  1368. </pre></example>
  1369. </function>
  1370. <function>
  1371. <name>GetSHA1OfUnicodeString</name>
  1372. <prototype>function GetSHA1OfUnicodeString(const S: String): String;</prototype>
  1373. <description><p>Gets the SHA-1 hash of the specified string, as a string.</p></description>
  1374. <example><pre>var
  1375. SHA1: String;
  1376. begin
  1377. SHA1 := GetSHA1OfUnicodeString('Test');
  1378. // SHA1 = '9ab696a37604d665dc97134dbee44cfe70451b1a'
  1379. end;
  1380. </pre></example>
  1381. </function>
  1382. <function>
  1383. <name>GetSHA256OfString</name>
  1384. <prototype>function GetSHA256OfString(const S: AnsiString): String;</prototype>
  1385. <description><p>Gets the SHA-256 hash of the specified string, as a string.</p></description>
  1386. <example><pre>var
  1387. SHA256: String;
  1388. begin
  1389. SHA256 := GetSHA256OfString('Test');
  1390. // SHA256 = '532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25'
  1391. end;
  1392. </pre></example>
  1393. </function>
  1394. <function>
  1395. <name>GetSHA256OfUnicodeString</name>
  1396. <prototype>function GetSHA256OfUnicodeString(const S: String): String;</prototype>
  1397. <description><p>Gets the SHA-256 hash of the specified string, as a string.</p></description>
  1398. <example><pre>var
  1399. SHA256: String;
  1400. begin
  1401. SHA256 := GetSHA256OfUnicodeString('Test');
  1402. // SHA256 = 'e6fa3ca87b1b641ab646d3b4933bba8d0970763f030b6578a60abdeae7366247'
  1403. end;
  1404. </pre></example>
  1405. </function>
  1406. </subcategory>
  1407. <subcategory>
  1408. <function>
  1409. <name>SysErrorMessage</name>
  1410. <prototype>function SysErrorMessage(ErrorCode: Cardinal): String;</prototype>
  1411. <description><p>Returns a localized error message string that corresponds to the given operating system error code.</p></description>
  1412. <remarks><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>
  1413. </function>
  1414. </subcategory>
  1415. <subcategory>
  1416. <function>
  1417. <name>MinimizePathName</name>
  1418. <prototype>function MinimizePathName(const Filename: String; const Font: TFont; MaxLen: Integer): String;</prototype>
  1419. <description><p>Returns a minimized filename that will not take more than MaxLen pixels to display with the given font. The minimizing is done by replacing the middle part with '...' as needed.</p></description>
  1420. <example><pre>MyLabel.Caption := MinimizePathName(MyPathName, MyLabel.Font, MyLabel.Width);</pre></example>
  1421. <seealso><p><link topic="scriptclasses" anchor="TFont">TFont</link></p></seealso>
  1422. </function>
  1423. </subcategory>
  1424. </category>
  1425. <category>
  1426. <description>Array</description>
  1427. <subcategory>
  1428. <function>
  1429. <name>GetArrayLength</name>
  1430. <prototype>function GetArrayLength(var Arr: Array): LongInt;</prototype>
  1431. <description><p>Gets the length of an array.</p></description>
  1432. </function>
  1433. <function>
  1434. <name>SetArrayLength</name>
  1435. <prototype>procedure SetArrayLength(var Arr: Array; I: LongInt);</prototype>
  1436. <description><p>Sets the length of an array. Always call SetArrayLength before accessing the elements in an array.</p></description>
  1437. </function>
  1438. </subcategory>
  1439. </category>
  1440. <category>
  1441. <description>Stream</description>
  1442. <subcategory>
  1443. <function>
  1444. <name>GetSHA256OfStream</name>
  1445. <prototype>function GetSHA256OfStream(const Stream: TStream): String;</prototype>
  1446. <description><p>Gets the SHA-256 hash of the specified stream, as a string. An exception will be raised upon failure.</p></description>
  1447. <seealso><p><link topic="isxfunc_GetSHA256OfFile">GetSHA256OfFile</link></p></seealso>
  1448. </function>
  1449. </subcategory>
  1450. </category>
  1451. <category>
  1452. <description>Variant</description>
  1453. <subcategory>
  1454. <function>
  1455. <name>Null</name>
  1456. <prototype>function Null: Variant;</prototype>
  1457. <description><p>Returns a variant with a value of Null.</p></description>
  1458. </function>
  1459. <function>
  1460. <name>Unassigned</name>
  1461. <prototype>function Unassigned: Variant;</prototype>
  1462. <description><p>Returns a variant with no value assigned.</p></description>
  1463. </function>
  1464. </subcategory>
  1465. <subcategory>
  1466. <function>
  1467. <name>VarIsEmpty</name>
  1468. <prototype>function VarIsEmpty(const V: Variant): Boolean;</prototype>
  1469. <description><p>Returns True if the specified variant is unassigned.</p></description>
  1470. <seealso><p><link topic="isxfunc_VarIsClear">VarIsClear</link></p></seealso>
  1471. </function>
  1472. <function>
  1473. <name>VarIsClear</name>
  1474. <prototype>function VarIsClear(const V: Variant): Boolean;</prototype>
  1475. <description><p>Returns True if the specified variant's value is undefined.</p></description>
  1476. <seealso><p><link topic="isxfunc_VarIsEmpty">VarIsEmpty</link></p></seealso>
  1477. </function>
  1478. <function>
  1479. <name>VarIsNull</name>
  1480. <prototype>function VarIsNull(const V: Variant): Boolean;</prototype>
  1481. <description><p>Returns True if the specified variant has a value of Null assigned.</p></description>
  1482. </function>
  1483. <function>
  1484. <name>VarType</name>
  1485. <prototype>function VarType(const V: Variant): TVarType;</prototype>
  1486. <description><p>Returns the type code of the specified variant.</p>
  1487. <p>The lower twelve bits of a variant type code (the bits defined by the varTypeMask bit mask) define the type of the variant. The varArray bit is set if the variant is an array of the given type. The varByRef bit is set if the variant is a reference to a value of the given type as opposed to an actual value.</p>
  1488. <p>The following variant type code constants are defined:</p>
  1489. <pre>
  1490. const
  1491. varEmpty = $0000;
  1492. varNull = $0001;
  1493. varSmallInt = $0002;
  1494. varInteger = $0003;
  1495. varSingle = $0004;
  1496. varDouble = $0005;
  1497. varCurrency = $0006;
  1498. varDate = $0007;
  1499. varOleStr = $0008;
  1500. varDispatch = $0009;
  1501. varError = $000A;
  1502. varBoolean = $000B;
  1503. varVariant = $000C;
  1504. varUnknown = $000D;
  1505. varByte = $0011;
  1506. varWord = $0012;
  1507. varLongWord = $0013;
  1508. varInt64 = $0014;
  1509. varStrArg = $0048;
  1510. varString = $0100;
  1511. varAny = $0101;
  1512. varUString = $0102;
  1513. varTypeMask = $0FFF;
  1514. varArray = $2000;
  1515. varByRef = $4000;
  1516. </pre>
  1517. </description>
  1518. </function>
  1519. <function>
  1520. <name>VarArrayGet</name>
  1521. <prototype>function VarArrayGet(var S: Variant; I: Integer): Variant;</prototype>
  1522. <description><p>Returns the specified element of the specified variant array.</p></description>
  1523. </function>
  1524. <function>
  1525. <name>VarArraySet</name>
  1526. <prototype>procedure VarArraySet(C: Variant; I: Integer; var S: Variant);</prototype>
  1527. <description><p>Sets the specified element of the specified variant array.</p></description>
  1528. </function>
  1529. </subcategory>
  1530. </category>
  1531. <category>
  1532. <description>File System</description>
  1533. <subcategory>
  1534. <function>
  1535. <name>DirExists</name>
  1536. <prototype>function DirExists(const Name: String): Boolean;</prototype>
  1537. <description><p>Returns True if the specified directory name exists. The specified name may include a trailing backslash.</p></description>
  1538. </function>
  1539. <function>
  1540. <name>FileExists</name>
  1541. <prototype>function FileExists(const Name: String): Boolean;</prototype>
  1542. <description><p>Returns True if the specified file exists.</p></description>
  1543. </function>
  1544. <function>
  1545. <name>FileOrDirExists</name>
  1546. <prototype>function FileOrDirExists(const Name: String): Boolean;</prototype>
  1547. <description><p>Returns True if the specified directory or file name exists. The specified name may include a trailing backslash.</p></description>
  1548. </function>
  1549. <function>
  1550. <name>FileSize</name>
  1551. <prototype>function FileSize(const Name: String; var Size: Integer): Boolean;</prototype>
  1552. <description><p>Sets Size to the size of the specified file in bytes. Returns True if the file size was set successfully and False otherwise. Only supports file sizes smaller than 2 GB. To get all 64 bits of the file size, use <link topic="isxfunc_FileSize64">FileSize64</link> instead.</p></description>
  1553. </function>
  1554. <function>
  1555. <name>FileSize64</name>
  1556. <prototype>function FileSize64(const Name: String; var Size: Int64): Boolean;</prototype>
  1557. <description><p>Sets Size to the size of the specified file in bytes. Returns True if the file size was set successfully and False otherwise.</p></description>
  1558. </function>
  1559. <function>
  1560. <name>GetSpaceOnDisk</name>
  1561. <prototype>function GetSpaceOnDisk(const Path: String; const InMegabytes: Boolean; var Free, Total: Cardinal): Boolean;</prototype>
  1562. <description><p>Returns the number of free and total bytes or megabytes on a drive. Path specifies a directory on the drive or UNC share to check; it can be either the root (e.g. <tt>C:\</tt>) or an existing subdirectory. The setting of the InMegabytes parameter determines whether it returns figures in bytes or in megabytes (2^20), rounded down. Returns True if successful, False otherwise.</p></description>
  1563. <remarks><p>The figures returned by this function are capped at 2147483647 (2^31-1). Therefore, if InMegaBytes is False, it will return no more than 2147483647 bytes. If InMegaBytes is True, it will return no more than 2147483647 megabytes.</p></remarks>
  1564. <example><pre>var
  1565. Path: String;
  1566. FreeMB, TotalMB: Cardinal;
  1567. begin
  1568. // Get and display free megabytes on the Program Files drive
  1569. Path := ExpandConstant('{autopf}');
  1570. if GetSpaceOnDisk(Path, True, FreeMB, TotalMB) then
  1571. begin
  1572. MsgBox('There are ' + IntToStr(FreeMB) + ' megabytes free on ' +
  1573. Path, mbInformation, MB_OK);
  1574. end
  1575. else begin
  1576. // the function failed
  1577. end;
  1578. end;</pre></example>
  1579. <seealso><p><link topic="isxfunc_GetSpaceOnDisk64">GetSpaceOnDisk64</link></p></seealso>
  1580. </function>
  1581. <function>
  1582. <name>GetSpaceOnDisk64</name>
  1583. <prototype>function GetSpaceOnDisk64(const Path: String; var Free, Total: Int64): Boolean;</prototype>
  1584. <description><p>Returns the number of free and total bytes on a drive. Path specifies a directory on the drive or UNC share to check; it can be either the root (e.g. <tt>C:\</tt>) or an existing subdirectory. Returns True if successful, False otherwise.</p></description>
  1585. <example><pre>var
  1586. Path: String;
  1587. FreeBytes, TotalBytes: Int64;
  1588. begin
  1589. // Get and display free bytes on the Program Files drive
  1590. Path := ExpandConstant('{autopf}');
  1591. if GetSpaceOnDisk64(Path, FreeBytes, TotalBytes) then
  1592. begin
  1593. MsgBox('There are ' + IntToStr(FreeBytes) + ' bytes free on ' +
  1594. Path, mbInformation, MB_OK);
  1595. end
  1596. else begin
  1597. // the function failed
  1598. end;
  1599. end;</pre></example>
  1600. <seealso><p><link topic="isxfunc_GetSpaceOnDisk">GetSpaceOnDisk</link></p></seealso>
  1601. </function>
  1602. </subcategory>
  1603. <subcategory>
  1604. <function>
  1605. <name>FileSearch</name>
  1606. <prototype>function FileSearch(const Name, DirList: String): String;</prototype>
  1607. <description><p>Searches through the directories passed in DirList for a file named Name. DirList should be directory names separated by semicolons. If FileSearch locates a file matching Name, it returns a string containing a fully-qualified path name for that file. If no matching file exists, FileSearch returns an empty string.</p></description>
  1608. </function>
  1609. <function>
  1610. <name>FindFirst</name>
  1611. <prototype>function FindFirst(const FileName: String; var FindRec: TFindRec): Boolean;</prototype>
  1612. <description><p>Retrieves information about the first file matching the wildcard specified by FileName. Returns True if successful.</p>
  1613. <p>TFindRec is defined as:</p>
  1614. <pre>
  1615. TFindRec = record
  1616. Name: String; // name of the found file (no path)
  1617. Attributes: LongWord; // file attributes
  1618. SizeHigh: LongWord; // size of the file, upper 32 bits
  1619. SizeLow: LongWord; // size of the file, lower 32 bits
  1620. CreationTime: TFileTime; // time file was created
  1621. LastAccessTime: TFileTime; // time file was last accessed
  1622. LastWriteTime: TFileTime; // time file was last modified
  1623. AlternateName: String; // file's short name (empty if none)
  1624. FindHandle: THandle; // used internally
  1625. end;
  1626. </pre>
  1627. <p>TFileTime is defined as:</p>
  1628. <pre>
  1629. TFileTime = record
  1630. dwLowDateTime: DWORD;
  1631. dwHighDateTime: DWORD;
  1632. end;
  1633. </pre>
  1634. <p>Valid file attributes are:</p>
  1635. <pre>
  1636. FILE_ATTRIBUTE_READONLY
  1637. FILE_ATTRIBUTE_HIDDEN
  1638. FILE_ATTRIBUTE_SYSTEM
  1639. FILE_ATTRIBUTE_DIRECTORY
  1640. FILE_ATTRIBUTE_ARCHIVE
  1641. FILE_ATTRIBUTE_DEVICE
  1642. FILE_ATTRIBUTE_NORMAL
  1643. FILE_ATTRIBUTE_TEMPORARY
  1644. FILE_ATTRIBUTE_SPARSE_FILE
  1645. FILE_ATTRIBUTE_REPARSE_POINT
  1646. FILE_ATTRIBUTE_COMPRESSED
  1647. FILE_ATTRIBUTE_OFFLINE
  1648. FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
  1649. FILE_ATTRIBUTE_ENCRYPTED
  1650. </pre></description>
  1651. <remarks><p>If FindFirst returns True, call <link topic="isxfunc_FindNext">FindNext</link> to enumerate the rest of the files, and then <link topic="isxfunc_FindClose">FindClose</link>.</p></remarks>
  1652. <example><p>The following example counts the number of files in the Windows System directory.</p>
  1653. <pre>var
  1654. FilesFound: Integer;
  1655. FindRec: TFindRec;
  1656. begin
  1657. FilesFound := 0;
  1658. if FindFirst(ExpandConstant('{sys}\*'), FindRec) then begin
  1659. try
  1660. repeat
  1661. // Don't count directories
  1662. if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
  1663. FilesFound := FilesFound + 1;
  1664. until not FindNext(FindRec);
  1665. finally
  1666. FindClose(FindRec);
  1667. end;
  1668. end;
  1669. MsgBox(IntToStr(FilesFound) + ' files found in the System directory.',
  1670. mbInformation, MB_OK);
  1671. end;</pre></example>
  1672. <seealso><p><link topic="isxfunc_FindNext">FindNext</link><br />
  1673. <link topic="isxfunc_FindClose">FindClose</link></p></seealso>
  1674. </function>
  1675. <function>
  1676. <name>FindNext</name>
  1677. <prototype>function FindNext(var FindRec: TFindRec): Boolean;</prototype>
  1678. <description><p>Retrieves information about the next matching file after a call to <link topic="isxfunc_FindFirst">FindFirst</link>. Returns True if successful.</p></description>
  1679. <example><p>For an example, see the documentation for <link topic="isxfunc_FindFirst">FindFirst</link>.</p></example>
  1680. <seealso><p><link topic="isxfunc_FindFirst">FindFirst</link><br />
  1681. <link topic="isxfunc_FindClose">FindClose</link></p></seealso>
  1682. </function>
  1683. <function>
  1684. <name>FindClose</name>
  1685. <prototype>procedure FindClose(var FindRec: TFindRec);</prototype>
  1686. <description><p>Ends a find sequence, and frees the resources associated with it. You should always call this when <link topic="isxfunc_FindFirst">FindFirst</link> returns True.</p></description>
  1687. <example><p>For an example, see the documentation for <link topic="isxfunc_FindFirst">FindFirst</link>.</p></example>
  1688. <seealso><p><link topic="isxfunc_FindFirst">FindFirst</link><br />
  1689. <link topic="isxfunc_FindNext">FindNext</link></p></seealso>
  1690. </function>
  1691. </subcategory>
  1692. <subcategory>
  1693. <function>
  1694. <name>GetCurrentDir</name>
  1695. <prototype>function GetCurrentDir: String;</prototype>
  1696. <description><p>Returns a string containing the name of the current directory.</p></description>
  1697. </function>
  1698. <function>
  1699. <name>SetCurrentDir</name>
  1700. <prototype>function SetCurrentDir(const Dir: String): Boolean;</prototype>
  1701. <description><p>Sets the current directory. The return value is True if the current directory was successfully changed, or False if an error occurred.</p></description>
  1702. </function>
  1703. <function>
  1704. <name>GetWinDir</name>
  1705. <prototype>function GetWinDir: String;</prototype>
  1706. <description><p>Returns fully qualified path of the Windows directory. Only includes a trailing backslash if the Windows directory is the root directory.</p></description>
  1707. </function>
  1708. <function>
  1709. <name>GetSystemDir</name>
  1710. <prototype>function GetSystemDir: String;</prototype>
  1711. <description><p>Returns fully qualified path of the Windows System directory. Only includes a trailing backslash if the Windows System directory is the root directory.</p></description>
  1712. </function>
  1713. <function>
  1714. <name>GetSysWow64Dir</name>
  1715. <prototype>function GetSysWow64Dir: String;</prototype>
  1716. <description><p>64-bit Windows only: returns fully qualified path of the SysWOW64 directory. This is the actual directory in which 32-bit system files reside. An empty string is returned if this function is called on 32-bit Windows, or if for some reason it fails to retrieve the path on 64-bit Windows (unlikely).</p></description>
  1717. <example><pre>var
  1718. S: String;
  1719. begin
  1720. S := GetSysWow64Dir;
  1721. // Must check the result -- an empty string is returned
  1722. // if there is no SysWOW64 directory.
  1723. if S &lt;&gt; '' then
  1724. MsgBox('SysWOW64 directory: ' + S, mbInformation, MB_OK)
  1725. else
  1726. MsgBox('There is no SysWOW64 directory.', mbInformation, MB_OK);
  1727. end;</pre></example>
  1728. </function>
  1729. <function>
  1730. <name>GetTempDir</name>
  1731. <prototype>function GetTempDir: String;</prototype>
  1732. <description><p>Returns fully qualified path of the temporary directory, with trailing backslash. Uses the Win32 function GetTempPath2 if available, and GetTempPath otherwise.</p></description>
  1733. </function>
  1734. <function>
  1735. <name>GetShellFolderByCSIDL</name>
  1736. <prototype>function GetShellFolderByCSIDL(const Folder: Integer; const Create: Boolean): String;</prototype>
  1737. <description><p>Gets the path of the specified shell folder. Folder specifies the value of a CSIDL constant (a complete list of which can be found in ShlObj.h). If Create is True, the folder will be created if it does not exist. On failure, an empty string is returned.</p></description>
  1738. <remarks><p>It is recommended that you always specify True in the Create parameter. Otherwise, the function may fail if the CSIDL value is valid but the directory does not currently exist. (This is a Windows issue.)</p></remarks>
  1739. <example><pre>const
  1740. CSIDL_MYPICTURES = $0027;
  1741. ...
  1742. var
  1743. Path: String;
  1744. begin
  1745. Path := GetShellFolderByCSIDL(CSIDL_MYPICTURES, True);
  1746. if Path &lt;&gt; '' then
  1747. begin
  1748. MsgBox('My Pictures path = ' + Path, mbInformation, MB_OK);
  1749. end
  1750. else
  1751. begin
  1752. // handle failure
  1753. end;
  1754. end;</pre></example>
  1755. </function>
  1756. </subcategory>
  1757. <subcategory>
  1758. <function>
  1759. <name>GetShortName</name>
  1760. <prototype>function GetShortName(const LongName: String): String;</prototype>
  1761. <description><p>Returns the short version of the specified long filename. If the short version of the long filename is not found, the long filename is returned.</p></description>
  1762. </function>
  1763. <function>
  1764. <name>GenerateUniqueName</name>
  1765. <prototype>function GenerateUniqueName(Path: String; const Extension: String): String;</prototype>
  1766. <description><p>Generates a unique filename for a file in the specified path with the specified extension.</p></description>
  1767. </function>
  1768. </subcategory>
  1769. <subcategory>
  1770. <function>
  1771. <name>IsProtectedSystemFile</name>
  1772. <prototype>function IsProtectedSystemFile(const Filename: String): Boolean;</prototype>
  1773. <description><p>Returns True if the specified file is protected by Windows File Protection (and therefore can't be replaced).</p></description>
  1774. </function>
  1775. </subcategory>
  1776. <subcategory>
  1777. <function>
  1778. <name>ApplyPathRedirRulesForCurrentProcess</name>
  1779. <prototype>function ApplyPathRedirRulesForCurrentProcess(const A64Bit: Boolean; const APath: String): String;</prototype>
  1780. <description><p>Calls <link topic="isxfunc_ApplyPathRedirRules">ApplyPathRedirRules</link> function with the current process as the target process.</p></description>
  1781. </function>
  1782. <function>
  1783. <name>ApplyPathRedirRules</name>
  1784. <prototype>function ApplyPathRedirRules(const A64Bit: Boolean; const APath: String; const ATargetProcess64Bit: Boolean): String;</prototype>
  1785. <description><p>Rewrites paths containing System32 to achieve the same effect as disabling/enabling WOW64 file system redirection, without actually changing the redirection state. Additionally, rewrites paths containing Sysnative for 64-bit target processes to ensure access to 64-bit System32.</p>
  1786. <p>Before rewriting, the path is expanded using <link topic="isxfunc_ExpandFileName">ExpandFileName</link> and converted to an extended-length path (also known as a super path).</p>
  1787. <p>Does not rewrite paths that do not contain System32 or Sysnative. Also does not rewrite when the system is running a 32-bit version of Windows.</p>
  1788. <p>Path expansion and conversion to extended-length path always occurs.</p></description>
  1789. <remarks><p>Does not rewrite for certain combinations, such as 64-bit System32 for a 64-bit target process, because no rewriting (or redirection) is needed for the target process to access the intended path. The following table lists all combinations for which rewriting has an effect, and the result:</p>
  1790. <table><tr><td>A64Bit</td><td>APath</td><td>ATargetProcess64Bit</td><td>Result</td><td>Explanation</td></tr>
  1791. <tr><td>True</td><td>System32</td><td>False</td><td>Sysnative</td><td>The 32-bit target process needs to use the Sysnative alias to access 64-bit system files.</td></tr>
  1792. <tr><td>False</td><td>System32</td><td>True</td><td>SysWOW64</td><td>The 64-bit target process needs to use SysWOW64 to access 32-bit system files.</td></tr>
  1793. <tr><td>False</td><td>System32</td><td>False</td><td>SysWOW64</td><td>Helps the 32-bit target process avoid some exceptions that apply to System32 but not to SysWOW64.</td></tr>
  1794. <tr><td>Any value</td><td>Sysnative</td><td>True</td><td>System32</td><td>The 64-bit target process needs to use System32 instead of the Sysnative alias to access 64-bit system files, because the Sysnative alias is only accessible to 32-bit processes.</td></tr>
  1795. </table></remarks>
  1796. <seealso><p><link topic="isxfunc_ApplyPathRedirRulesForCurrentProcess">ApplyPathRedirRulesForCurrentProcess</link><br/>
  1797. <link topic="isxfunc_PathConvertSuperToNormal">PathConvertSuperToNormal</link></p></seealso>
  1798. </function>
  1799. <function>
  1800. <name>EnableFsRedirection</name>
  1801. <prototype>function EnableFsRedirection(const Enable: Boolean): Boolean;</prototype>
  1802. <description><p>Function removed in 7.0.</p></description>
  1803. <remarks><p>Use support function <link topic="isxfunc_ApplyPathRedirRulesForCurrentProcess">ApplyPathRedirRulesForCurrentProcess</link> instead, or a <link topic="64bit">64-bit installer</link>.</p>
  1804. <p><link topic="64bit">32-bit installers</link> can also use <tt>{sysnative}</tt> instead.</p>
  1805. <p>Use support functions <link topic="isxfunc_ExecWithNativeSysDir">ExecWithNativeSysDir</link>, <link topic="isxfunc_ExecAndLogOutputWithNativeSysDir">ExecAndLogOutputWithNativeSysDir</link>, or <link topic="isxfunc_ExecAndCaptureOutputWithNativeSysDir">ExecAndCaptureOutputWithNativeSysDir</link> to launch an executable located in the 64-bit System directory from a 32-bit installer.</p></remarks>
  1806. </function>
  1807. </subcategory>
  1808. </category>
  1809. <category>
  1810. <description>File</description>
  1811. <subcategory>
  1812. <function>
  1813. <name>Exec</name>
  1814. <prototype>function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;</prototype>
  1815. <description><p>Executes the specified executable or batch file, using the same credentials as Setup/Uninstall. The Wait parameter specifies whether the function should return immediately or wait until the launched process has terminated or is idle. Returns True if the specified file was executed successfully, False otherwise.</p>
  1816. <p>If True is returned and Wait is ewWaitUntilTerminated then ResultCode returns the exit code of the process.</p>
  1817. <p>If False is returned then ResultCode specifies the error that occurred. Use SysErrorMessage(ResultCode) to get a description of the error.</p></description>
  1818. <remarks><p>TExecWait is defined as:</p>
  1819. <p><tt>TExecWait = (ewNoWait, ewWaitUntilTerminated, ewWaitUntilIdle);</tt></p>
  1820. <p>Use the <link topic="isxfunc_ShellExec">ShellExec</link> function instead if you need to launch a file that is not an executable or batch file.</p>
  1821. <p>Do not include quotes in the Filename parameter; the function will add them automatically.</p>
  1822. <p>The WorkingDir parameter can be an empty string, in which case it will try to extract a pathname from the Filename parameter and use that as the initial current directory for the process. If no pathname was specified in Filename, a default directory will be used.</p>
  1823. <p>If you have a single string containing both a filename and parameters (e.g. a command line obtained from an UninstallString registry value), you need not separate them yourself; just pass <tt>'>'</tt> in the Filename parameter, and the full command line in the Params parameter. (Note that when this is done, the function's special platform-independent support for .bat and .cmd files is disabled; it simply passes the specified command line to CreateProcess without any processing.)</p>
  1824. <p>To execute a 64-bit System32 binary from a 32-bit installer, use <tt>{sysnative}</tt> or <link topic="isxfunc_ApplyPathRedirRulesForCurrentProcess">ApplyPathRedirRulesForCurrentProcess</link> to rewrite the path. In a 64-bit installer the rewrite is not needed.</p>
  1825. <p>Can't be used to execute Setup itself until the installation has started.</p>
  1826. <p><i>Note: compared to ISPP's Exec the ShowCmd and Wait parameters are swapped!</i></p></remarks>
  1827. <example><pre>var
  1828. ResultCode: Integer;
  1829. begin
  1830. // Launch Notepad and wait for it to terminate
  1831. if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOWNORMAL,
  1832. ewWaitUntilTerminated, ResultCode) then
  1833. begin
  1834. // handle success if necessary; ResultCode contains the exit code
  1835. end
  1836. else begin
  1837. // handle failure if necessary; ResultCode contains the error code
  1838. end;
  1839. end;</pre></example>
  1840. <seealso><p><link topic="isxfunc_ExecAndCaptureOutput">ExecAndCaptureOutput</link><br />
  1841. <link topic="isxfunc_ExecAndLogOutput">ExecAndLogOutput</link><br />
  1842. <link topic="isxfunc_ExecAsOriginalUser">ExecAsOriginalUser</link><br/>
  1843. <link topic="isxfunc_ExecWithNativeSysDir">ExecWithNativeSysDir</link></p></seealso>
  1844. </function>
  1845. <function>
  1846. <name>ExecAsOriginalUser</name>
  1847. <prototype>function ExecAsOriginalUser(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;</prototype>
  1848. <description><p>Executes the specified executable or batch file, using the (normally non-elevated) credentials of the user that started Setup initially. See <link topic="isxfunc_Exec">Exec</link> and the [Run] section flag <tt>runasoriginaluser</tt> for more information.</p></description>
  1849. <remarks><p>This function is not supported at uninstall time.</p>
  1850. <p>In very unusual failure cases (e.g. if the initial Setup process died unexpectedly), it is possible for this function to raise an exception instead of just returning False.</p></remarks>
  1851. </function>
  1852. <function>
  1853. <name>ShellExec</name>
  1854. <prototype>function ShellExec(const Verb, Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ErrorCode: Integer): Boolean;</prototype>
  1855. <description><p>Opens the specified file or performs another action specified by Verb, using the same credentials as Setup/Uninstall. The filename can be an executable file, a document file, a folder, or a URL. Verb may be an empty string, in which case the default verb for the file type is used (usually "open"). The Wait parameter specifies whether the function should return immediately or wait until the launched process has terminated or is idle. Returns True if the specified file was opened successfully, False otherwise. If False is returned then ErrorCode specifies the error that occurred. Use SysErrorMessage(ErrorCode) to get a description of the error.</p></description>
  1856. <remarks><p>TExecWait is defined as:</p>
  1857. <p><tt>TExecWait = (ewNoWait, ewWaitUntilTerminated, ewWaitUntilIdle);</tt></p>
  1858. <p>Note that passing a Wait value other than <tt>ewNoWait</tt> will have no effect if a new process isn't spawned (for example, if the file is opened inside an already-running instance of the program that handles the file type).</p>
  1859. <p>Refer to the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms681381.aspx">system error codes on MSDN</a>.</p>
  1860. <p>Can't be used to execute Setup itself until the installation has started.</p></remarks>
  1861. <example><pre>var
  1862. ErrorCode: Integer;
  1863. begin
  1864. if not ShellExec('', ExpandConstant('{app}\filename.rtf'),
  1865. '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode) then
  1866. begin
  1867. // handle failure if necessary
  1868. end;
  1869. end;</pre></example>
  1870. <seealso><p><link topic="isxfunc_ShellExecAsOriginalUser">ShellExecAsOriginalUser</link></p></seealso>
  1871. </function>
  1872. <function>
  1873. <name>ShellExecAsOriginalUser</name>
  1874. <prototype>function ShellExecAsOriginalUser(const Verb, Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ErrorCode: Integer): Boolean;</prototype>
  1875. <description><p>Opens the specified file or performs another action specified by Verb, using the (normally non-elevated) credentials of the user that started Setup initially. See <link topic="isxfunc_ShellExec">ShellExec</link> and the [Run] section flag <tt>runasoriginaluser</tt> for more information.</p></description>
  1876. <remarks><p>This function is not supported at uninstall time.</p>
  1877. <p>In very unusual failure cases (e.g. if the initial Setup process died unexpectedly), it is possible for this function to raise an exception instead of just returning False.</p>
  1878. <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>
  1879. </function>
  1880. </subcategory>
  1881. <subcategory>
  1882. <function>
  1883. <name>ExecWithNativeSysDir</name>
  1884. <prototype>function ExecWithNativeSysDir(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;</prototype>
  1885. <description><p>Use this function instead of <link topic="isxfunc_Exec">Exec</link> to launch an executable located in the 64-bit System directory from a 32-bit installer.</p>
  1886. <p>This function avoids the problem that <tt>Exec</tt> in a 32-bit installer can only launch such an executable using the Sysnative alias, while that alias is not available to 64-bit applications. To achieve this, the function temporarily disables WOW64 file system redirection.</p></description>
  1887. <remarks><p>On 32-bit Windows or in a 64-bit installer, this function is just an alias for <tt>Exec</tt>.</p></remarks>
  1888. <example><pre>var
  1889. ResultCode: Integer;
  1890. begin
  1891. if IsWin64 then begin
  1892. { This starts 32-bit cmd.exe in a 32-bit installer, and 64-bit cmd.exe in a 64-bit installer }
  1893. Exec(ExpandConstant('{cmd}'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
  1894. { This starts 64-bit cmd.exe in both a 32-bit installer and a 64-bit installer }
  1895. ExecWithNativeSysDir(ExpandConstant('{cmd}'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
  1896. { WRONG: This would also start 64-bit cmd.exe in a 32-bit installer, but it would use the Sysnative alias, which 64-bit cmd.exe cannot access }
  1897. // Exec(ApplyPathRedirRulesForCurrentProcess(True, ExpandConstant('{cmd}')), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
  1898. end;</pre></example>
  1899. </function>
  1900. </subcategory>
  1901. <subcategory>
  1902. <function>
  1903. <name>ExtractTemporaryFile</name>
  1904. <prototype>procedure ExtractTemporaryFile(const FileName: String);</prototype>
  1905. <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>
  1906. <p>The extracted files are automatically deleted when Setup exits.</p>
  1907. <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>
  1908. <remarks><p>Use <tt>Flags: dontcopy noencryption</tt> in the [Files] section to tell Setup to skip the file during the normal file copying stage, and to ensure it can be extracted before the password is known.</p>
  1909. <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>
  1910. <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>
  1911. <seealso><p><link topic="isxfunc_ExtractTemporaryFiles">ExtractTemporaryFiles</link><br />
  1912. <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link></p></seealso>
  1913. <example><pre>[Files]
  1914. Source: "Readme.txt"; Flags: dontcopy noencryption
  1915. [Code]
  1916. function InitializeSetup: Boolean;
  1917. var
  1918. S: AnsiString;
  1919. begin
  1920. // Show the contents of Readme.txt (non Unicode) in a message box
  1921. ExtractTemporaryFile('Readme.txt');
  1922. if LoadStringFromFile(ExpandConstant('{tmp}\Readme.txt'), S) then
  1923. begin
  1924. MsgBox(S, mbInformation, MB_OK);
  1925. end;
  1926. Result := True;
  1927. end;</pre></example>
  1928. </function>
  1929. <function>
  1930. <name>ExtractTemporaryFiles</name>
  1931. <prototype>function ExtractTemporaryFiles(const Pattern: String): Integer;</prototype>
  1932. <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>
  1933. <p>The extracted files are automatically deleted when Setup exits.</p>
  1934. <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>
  1935. <remarks><p>Use <tt>Flags: dontcopy noencryption</tt> in the [Files] section to tell Setup to skip the file during the normal file copying stage, and to ensure it can be extracted before the password is known.</p>
  1936. <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>
  1937. <seealso><p><link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link></p></seealso>
  1938. <example><pre>[Files]
  1939. Source: "Readme.txt"; Flags: dontcopy noencryption
  1940. Source: "MyProg.exe"; DestDir: "{app}"
  1941. Source: "MyProg.chm"; DestDir: "{app}"
  1942. [Code]
  1943. function InitializeSetup: Boolean;
  1944. var
  1945. S: AnsiString;
  1946. ResultCode: Integer;
  1947. begin
  1948. // Show the contents of Readme.txt (non Unicode) in a message box
  1949. ExtractTemporaryFiles('{tmp}\Readme.txt');
  1950. if LoadStringFromFile(ExpandConstant('{tmp}\Readme.txt'), S) then
  1951. begin
  1952. MsgBox(S, mbInformation, MB_OK);
  1953. end;
  1954. // Extract all MyProg files and launch it. Note how {app} is left unexpanded.
  1955. ExtractTemporaryFiles('{app}\MyProg.*');
  1956. ExecAsOriginalUser(ExpandConstant('{tmp}\')+'{app}\MyProg.exe', '', '',
  1957. SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
  1958. Result := True;
  1959. end;</pre></example>
  1960. </function>
  1961. <function>
  1962. <name>DownloadTemporaryFile</name>
  1963. <prototype>function DownloadTemporaryFile(const Url, BaseName, RequiredSHA256OfFile: String; const OnDownloadProgress: TOnDownloadProgress): Int64;</prototype>
  1964. <description><p>Downloads the file from the specified URL to a temporary directory using the specified name. To find the location of the temporary directory, use <tt>ExpandConstant('{tmp}')</tt>.</p>
  1965. <p>If RequiredSHA256OfFile is set it will compare this to the SHA-256 of the downloaded file and raise an exception if the hashes don't match.</p>
  1966. <p>An exception will be raised if there was an error. Otherwise, returns the number of bytes downloaded. Returns 0 if RequiredSHA256OfFile is set and the file was already downloaded.</p>
  1967. <p>Supports HTTPS (but not expired or self-signed certificates) and HTTP. Redirects are automatically followed and proxy settings are automatically used. Safe to use from services.</p>
  1968. <p>For basic authentication use <link topic="isxfunc_SetDownloadCredentials">SetDownloadCredentials</link>.</p>
  1969. <p>Set OnDownloadProgress to a function to be informed of progress, or <tt>nil</tt> otherwise.</p></description>
  1970. <remarks><p>TOnDownloadProgress is defined as:</p>
  1971. <p><tt>TOnDownloadProgress = function(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;</tt></p>
  1972. <p>ProgressMax will be 0 if the file size is still unknown. Return True to allow the download to continue, False otherwise.</p></remarks>
  1973. <example><pre>
  1974. [Code]
  1975. function OnDownloadProgress(const Url, Filename: String; const Progress, ProgressMax: Int64): Boolean;
  1976. begin
  1977. if ProgressMax &lt;&gt; 0 then
  1978. Log(Format(' %d of %d bytes done.', [Progress, ProgressMax]))
  1979. else
  1980. Log(Format(' %d bytes done.', [Progress]));
  1981. Result := True;
  1982. end;
  1983. function InitializeSetup: Boolean;
  1984. begin
  1985. try
  1986. DownloadTemporaryFile('https://jrsoftware.org/download.php/is.exe?dontcount=1', 'innosetup-latest.exe', '', @OnDownloadProgress);
  1987. DownloadTemporaryFile('https://jrsoftware.org/download.php/iscrypt.dll?dontcount=1', 'ISCrypt.dll', '2f6294f9aa09f59a574b5dcd33be54e16b39377984f3d5658cda44950fa0f8fc', @OnDownloadProgress);
  1988. Result := True;
  1989. except
  1990. Log(GetExceptionMessage);
  1991. Result := False;
  1992. end;
  1993. end;</pre>
  1994. <p>See <i>CodeDownloadFiles.iss</i> for another example which uses <link topic="isxfunc_CreateDownloadPage">CreateDownloadPage</link> instead.</p>
  1995. <p>See <i>DownloadFiles.iss</i> for an example of file download using just a [Files] entry.</p></example>
  1996. <seealso><p><link topic="isxfunc_SetDownloadCredentials">SetDownloadCredentials</link><br />
  1997. <link topic="isxfunc_DownloadTemporaryFileWithISSigVerify">DownloadTemporaryFileWithISSigVerify</link><br />
  1998. <link topic="isxfunc_DownloadTemporaryFileSize">DownloadTemporaryFileSize</link><br />
  1999. <link topic="isxfunc_DownloadTemporaryFileDate">DownloadTemporaryFileDate</link><br />
  2000. <link topic="isxfunc_CreateDownloadPage">CreateDownloadPage</link><br />
  2001. <link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link><br />
  2002. <link topic="isxfunc_ExtractArchive">ExtractArchive</link></p></seealso>
  2003. </function>
  2004. <function>
  2005. <name>DownloadTemporaryFileWithISSigVerify</name>
  2006. <prototype>function DownloadTemporaryFileWithISSigVerify(const Url, ISSigUrl, BaseName: String; const AllowedKeysRuntimeIDs: TStringList; const OnDownloadProgress: TOnDownloadProgress): Int64;</prototype>
  2007. <description><p>Like <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link>, but downloads an .issig signature file first from the specified second URL and uses it to verify the main file downloaded from the first URL.</p>
  2008. <p>If the second URL is an empty string, Setup will instead append ".issig" (without quotes) to the path portion of the first URL. It will then use the result as the URL to download the .issig signature file from.</p>
  2009. <p>Verification uses the specified allowed keys, looked up using <link topic="issigkeyssection">[ISSigKeys] section</link> parameter <tt>RuntimeID</tt>. To allow all keys set AllowedKeysRuntimeIDs to <tt>nil</tt>.</p>
  2010. <p>An exception will be raised if there was an error. Otherwise, returns the number of bytes downloaded for the main file from the first URL. Returns 0 if the main file was already downloaded and still verified.</p></description>
  2011. <seealso><p><link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link><br/>
  2012. <link topic="issig">.issig Signatures: Introduction</link><br/>
  2013. <link topic="isxfunc_ISSigVerify">ISSigVerify</link></p></seealso>
  2014. <example><pre>
  2015. [Code]
  2016. function InitializeSetup: Boolean;
  2017. begin
  2018. try
  2019. DownloadTemporaryFileWithISSigVerify(
  2020. 'https://jrsoftware.org/download.php/myprog-extrareadmes.7z', '',
  2021. 'myprog-extrareadmes.7z', nil, nil);
  2022. Result := True;
  2023. except
  2024. Log(GetExceptionMessage);
  2025. Result := False;
  2026. end;
  2027. end;</pre></example>
  2028. </function>
  2029. <function>
  2030. <name>SetDownloadCredentials</name>
  2031. <prototype>procedure SetDownloadCredentials(const User, Pass: String);</prototype>
  2032. <description><p>Sets the basic authentication username and password for all following downloads done by <tt>DownloadTemporaryFile</tt>, <tt>DownloadTemporaryFileWithISSigVerify</tt>, <tt>DownloadTemporaryFileSize</tt>, and <tt>DownloadTemporaryFileDate</tt>.</p>
  2033. <p>Specify an empty username or password to unset the username or password.</p></description>
  2034. <seealso><p><link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link><br/>
  2035. <link topic="isxfunc_DownloadTemporaryFileWithISSigVerify">DownloadTemporaryFileWithISSigVerify</link><br/>
  2036. <link topic="isxfunc_DownloadTemporaryFileSize">DownloadTemporaryFileSize</link><br/>
  2037. <link topic="isxfunc_DownloadTemporaryFileDate">DownloadTemporaryFileDate</link></p></seealso>
  2038. </function>
  2039. <function>
  2040. <name>DownloadTemporaryFileSize</name>
  2041. <prototype>function DownloadTemporaryFileSize(const Url): Int64;</prototype>
  2042. <description><p>Returns the size of the file from the specified URL, without downloading the file. If the server does not provide the size, -1 will be returned.</p>
  2043. <p>An exception will be raised if there was an error.</p>
  2044. <p>See <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link> for other considerations.</p></description>
  2045. </function>
  2046. <function>
  2047. <name>DownloadTemporaryFileDate</name>
  2048. <prototype>function DownloadTemporaryFileDate(const Url): String;</prototype>
  2049. <description><p>Returns the last modified date of the file from the specified URL, without downloading the file. If the server does not provide the last modified file date, '' will be returned.</p>
  2050. <p>An exception will be raised if there was an error.</p>
  2051. <p>See <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link> for other considerations.</p></description>
  2052. </function>
  2053. <function>
  2054. <name>ExtractArchive</name>
  2055. <prototype>procedure ExtractArchive(const ArchiveFileName, DestDir, Password: String; const FullPaths: Boolean; const OnExtractionProgress: TOnExtractionProgress);</prototype>
  2056. <description><p>Extracts the specified archive to the specified directory, with or without preserving full path names.</p>
  2057. <p>An exception will be raised if there was an error.</p>
  2058. <p>The supported archive formats, beyond .7z, and the support for password-protected and multi-volume archives, depend on the <link topic="setup_archiveextraction">ArchiveExtraction</link> [Setup] section directive.</p>
  2059. <p>To allow the extraction of archives with custom extensions, such as self-extracting archives, call <link topic="isxfunc_MapArchiveExtensions">MapArchiveExtensions</link>.</p>
  2060. <p>Set OnExtractionProgress to a function to be informed of progress, or <tt>nil</tt> otherwise.</p></description>
  2061. <remarks><p>TOnExtractionProgress is defined as:</p>
  2062. <p><tt>TOnExtractionProgress = function(const ArchiveName, FileName: String; const Progress, ProgressMax: Int64): Boolean;</tt></p>
  2063. <p>Return True to allow the extraction to continue, False otherwise.</p></remarks>
  2064. <example><p>See <i>DownloadFiles.iss</i> for an example of archive extraction using just a [Files] entry.</p></example>
  2065. <seealso><p><link topic="isxfunc_CreateExtractionPage">CreateExtractionPage</link><br />
  2066. <link topic="isxfunc_MapArchiveExtensions">MapArchiveExtensions</link><br />
  2067. <link topic="isxfunc_CreateDownloadPage">CreateDownloadPage</link><br />
  2068. <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link><br />
  2069. <link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link></p></seealso>
  2070. </function>
  2071. <function>
  2072. <name>MapArchiveExtensions</name>
  2073. <prototype>procedure MapArchiveExtensions(const DestExt, SourceExt: String);</prototype>
  2074. <description><p>Allows files with a specified destination extension, such as .exe, to be treated as if they have a different source extension, such as .7z, for extraction purposes.</p>
  2075. <p>An exception will be raised if there was an error.</p></description>
  2076. <remarks><p>Calls to this function are ignored if the <link topic="setup_archiveextraction">ArchiveExtraction</link> [Setup] section directive is set to <tt>basic</tt>. In this case files as always extracted as .7z, regardless of the extension.</p></remarks>
  2077. <seealso><p><link topic="isxfunc_ExtractArchive">ExtractArchive</link><br/>
  2078. <link topic="isxfunc_CreateExtractionPage">CreateExtractionPage</link></p></seealso>
  2079. <example><pre>
  2080. [Files]
  2081. Source: "{src}\My7ZipSFX.exe; DestDir: "{app}"; Flags: external extractarchive recursesubdirs createallsubdirs ignoreversion
  2082. [Code]
  2083. function InitializeSetup: Boolean;
  2084. begin
  2085. MapArchiveExtensions('.exe', '.7z');
  2086. end;</pre></example>
  2087. </function>
  2088. </subcategory>
  2089. <subcategory>
  2090. <function>
  2091. <name>GetMD5OfFile</name>
  2092. <prototype>function GetMD5OfFile(const Filename: String): String;</prototype>
  2093. <description><p>Gets the MD5 sum of the specified file, as a string. An exception will be raised upon failure.</p></description>
  2094. </function>
  2095. <function>
  2096. <name>GetSHA1OfFile</name>
  2097. <prototype>function GetSHA1OfFile(const Filename: String): String;</prototype>
  2098. <description><p>Gets the SHA-1 hash of the specified file, as a string. An exception will be raised upon failure.</p></description>
  2099. </function>
  2100. <function>
  2101. <name>GetSHA256OfFile</name>
  2102. <prototype>function GetSHA256OfFile(const Filename: String): String;</prototype>
  2103. <description><p>Gets the SHA-256 hash of the specified file, as a string. An exception will be raised upon failure.</p></description>
  2104. <seealso><p><link topic="isxfunc_GetSHA256OfStream">GetSHA256OfStream</link></p></seealso>
  2105. </function>
  2106. </subcategory>
  2107. <subcategory>
  2108. <function>
  2109. <name>ISSigVerify</name>
  2110. <prototype>function ISSigVerify(const AllowedKeysRuntimeIDs: TStringList; const Filename: String; const VerifyFilename: Boolean; const KeepOpen: Boolean): TFileStream;</prototype>
  2111. <description><p>Verifies the signature of the specified file using the specified allowed keys, looked up using <link topic="issigkeyssection">[ISSigKeys] section</link> parameter <tt>RuntimeID</tt>. To allow all keys set AllowedKeysRuntimeIDs to <tt>nil</tt>. An exception will be raised upon failure.</p>
  2112. <p>If VerifyFilename is set to False the verification allows signatures for a different filename. It is recommended that you only set it to False if you don't know the name the file had when the signature was created. The size and hash of the file must always match.</p>
  2113. <p>Returns a handle to the still open file if KeepOpen is set to True, <tt>nil</tt> otherwise. It is recommended that you always set it to True if you plan to use the file for anything after verification. Otherwise, you risk creating a Time-Of-Check to Time-Of-Use (TOCTOU) problem.</p></description>
  2114. <example><pre>var
  2115. F: TFileStream;
  2116. begin
  2117. F := ISSigVerify([], Filename, True);
  2118. try
  2119. // Use file
  2120. finally
  2121. F.Free;
  2122. end;
  2123. end;</pre></example>
  2124. <seealso><p><link topic="issig">.issig Signatures: Introduction</link><br/>
  2125. <link topic="isxfunc_DownloadTemporaryFileWithISSigVerify">DownloadTemporaryFileWithISSigVerify</link></p></seealso>
  2126. </function>
  2127. </subcategory>
  2128. <subcategory>
  2129. <function>
  2130. <name>RenameFile</name>
  2131. <prototype>function RenameFile(const OldName, NewName: String): Boolean;</prototype>
  2132. <description><p>Attempts to change the name of the file or directory specified by OldFile to NewFile. If the operation succeeds, RenameFile returns True. If it cannot rename the file (for example, if a file called NewName already exists), it returns False.</p></description>
  2133. <remarks><p>Can't be used to rename Setup itself until the installation has started.</p></remarks>
  2134. </function>
  2135. <function>
  2136. <name>CopyFile</name>
  2137. <prototype>function CopyFile(const ExistingFile, NewFile: String; const FailIfExists: Boolean): Boolean;</prototype>
  2138. <description><p>Copies ExistingFile to NewFile, preserving time stamp and file attributes.<br />If FailIfExists is True it will fail if NewFile already exists, otherwise it will overwrite it.<br />Returns True if successful, False otherwise.</p>
  2139. <p>Files copied using <tt>CopyFile</tt> are not automatically uninstalled. Consider using a [Files] entry with the <tt>external</tt> flag set instead.</p></description>
  2140. <remarks><p>Can't be used to copy Setup itself until the installation has started.</p></remarks>
  2141. </function>
  2142. <function>
  2143. <name>DeleteFile</name>
  2144. <prototype>function DeleteFile(const FileName: String): Boolean;</prototype>
  2145. <description><p>Erases the file named by FileName from the disk.<br />If the file cannot be deleted or does not exist, the function returns False.</p></description>
  2146. </function>
  2147. <function>
  2148. <name>DelayDeleteFile</name>
  2149. <prototype>procedure DelayDeleteFile(const Filename: String; const Tries: Integer);</prototype>
  2150. <description><p>Attempts to delete Filename, retrying up to Tries times if the file is in use. It delays 250 msec between tries.</p></description>
  2151. </function>
  2152. <function>
  2153. <name>SetNTFSCompression</name>
  2154. <prototype>function SetNTFSCompression(const FileOrDir: String; Compress: Boolean): Boolean;</prototype>
  2155. <description><p>Changes the NTFS compression state of a file or directory. Returns True if successful, False otherwise.</p></description>
  2156. <remarks><p>If a directory is specified, the compression state of any files present in the directory will not be changed.</p></remarks>
  2157. </function>
  2158. </subcategory>
  2159. <subcategory>
  2160. <function>
  2161. <name>LoadStringFromFile</name>
  2162. <prototype>function LoadStringFromFile(const FileName: String; var S: AnsiString): Boolean;</prototype>
  2163. <description><p>Loads the specified binary or non Unicode text file into the specified string. Returns True if successful, False otherwise.</p></description>
  2164. <remarks><p>Use <link topic="isxfunc_LoadStringFromLockedFile">LoadStringFromLockedFile</link> to load even if the file is already opened for writing by another program.</p></remarks>
  2165. <seealso><p><link topic="isxfunc_LoadStringsFromFile">LoadStringsFromFile</link></p></seealso>
  2166. </function>
  2167. <function>
  2168. <name>LoadStringFromLockedFile</name>
  2169. <prototype>function LoadStringFromLockedFile(const FileName: String; var S: AnsiString): Boolean;</prototype>
  2170. <description><p>Loads the specified binary or non Unicode text file into the specified string, even if the file is already opened for writing by another program. Returns True if successful, False otherwise.</p></description>
  2171. <seealso><p><link topic="isxfunc_LoadStringFromFile">LoadStringFromFile</link></p></seealso>
  2172. </function>
  2173. <function>
  2174. <name>LoadStringsFromFile</name>
  2175. <prototype>function LoadStringsFromFile(const FileName: String; var S: TArrayOfString): Boolean;</prototype>
  2176. <description><p>Loads the specified text file into the specified string array. UTF-8 encoded files with or without a BOM are also supported. Returns True if successful, False otherwise.</p></description>
  2177. <remarks><p>Use <link topic="isxfunc_LoadStringsFromLockedFile">LoadStringsFromLockedFile</link> to load even if the file is already opened for writing by another program.</p></remarks>
  2178. <seealso><p><link topic="isxfunc_LoadStringFromFile">LoadStringFromFile</link></p></seealso>
  2179. </function>
  2180. <function>
  2181. <name>LoadStringsFromLockedFile</name>
  2182. <prototype>function LoadStringsFromLockedFile(const FileName: String; var S: TArrayOfString): Boolean;</prototype>
  2183. <description><p>Loads the specified text file into the specified string array, even if the file is already opened for writing by another program. UTF-8 encoded files with or without a BOM are also supported. Returns True if successful, False otherwise.</p></description>
  2184. <seealso><p><link topic="isxfunc_LoadStringsFromFile">LoadStringsFromFile</link></p></seealso>
  2185. </function>
  2186. <function>
  2187. <name>SaveStringToFile</name>
  2188. <prototype>function SaveStringToFile(const FileName: String; const S: AnsiString; const Append: Boolean): Boolean;</prototype>
  2189. <description><p>Saves the specified string to the specified file. If Append is True and the specified file already exists, it will be appended to instead of overwritten. Returns True if successful, False otherwise.</p></description>
  2190. <remarks><p>This function does not automatically write a line break before or after the string. If Append is True and the existing file did not end in a line break, the function will effectively append to the existing last line. To avoid this you can put line break characters before and/or after your string:</p>
  2191. <p><tt>SaveStringToFile('c:\filename.txt', #13#10 + 'the string' + #13#10, True);</tt></p></remarks>
  2192. </function>
  2193. <function>
  2194. <name>SaveStringsToFile</name>
  2195. <prototype>function SaveStringsToFile(const FileName: String; const S: TArrayOfString; const Append: Boolean): Boolean;</prototype>
  2196. <description><p>Saves the specified string array to the specified file with ASCII encoding. If Append is True and the specified file already exists, it will be appended to instead of overwritten. Returns True if successful, False otherwise.</p></description>
  2197. <seealso><p><link topic="isxfunc_SaveStringsToUTF8File">SaveStringsToUTF8File</link><br />
  2198. <link topic="isxfunc_SaveStringsToUTF8FileWithoutBOM">SaveStringsToUTF8FileWithoutBOM</link></p></seealso>
  2199. </function>
  2200. <function>
  2201. <name>SaveStringsToUTF8File</name>
  2202. <prototype>function SaveStringsToUTF8File(const FileName: String; const S: TArrayOfString; const Append: Boolean): Boolean;</prototype>
  2203. <description><p>Saves the specified string array to the specified file with UTF-8 encoding with a BOM. If Append is True and the specified file already exists, it will be appended to instead of overwritten. Returns True if successful, False otherwise.</p></description>
  2204. <seealso><p><link topic="isxfunc_SaveStringsToFile">SaveStringsToFile</link><br />
  2205. <link topic="isxfunc_SaveStringsToUTF8FileWithoutBOM">SaveStringsToUTF8FileWithoutBOM</link></p></seealso>
  2206. </function>
  2207. <function>
  2208. <name>SaveStringsToUTF8FileWithoutBOM</name>
  2209. <prototype>function SaveStringsToUTF8FileWithoutBOM(const FileName: String; const S: TArrayOfString; const Append: Boolean): Boolean;</prototype>
  2210. <description><p>Saves the specified string array to the specified file with UTF-8 encoding without a BOM. If Append is True and the specified file already exists, it will be appended to instead of overwritten. Returns True if successful, False otherwise.</p></description>
  2211. <seealso><p><link topic="isxfunc_SaveStringsToFile">SaveStringsToFile</link><br />
  2212. <link topic="isxfunc_SaveStringsToUTF8File">SaveStringsToUTF8File</link></p></seealso>
  2213. </function>
  2214. </subcategory>
  2215. <subcategory>
  2216. <function>
  2217. <name>CreateDir</name>
  2218. <prototype>function CreateDir(const Dir: String): Boolean;</prototype>
  2219. <description><p>Creates a new directory. The return value is True if a new directory was successfully created, or False if an error occurred.</p></description>
  2220. </function>
  2221. <function>
  2222. <name>ForceDirectories</name>
  2223. <prototype>function ForceDirectories(Dir: String): Boolean;</prototype>
  2224. <description><p>Creates all the directories along the specified directory path all at once. If the first directories in the path do exist, but the latter ones don't, ForceDirectories creates just the ones that don't exist. Returns True if successful, False otherwise.</p></description>
  2225. </function>
  2226. <function>
  2227. <name>RemoveDir</name>
  2228. <prototype>function RemoveDir(const Dir: String): Boolean;</prototype>
  2229. <description><p>Deletes an existing empty directory. The return value is True if the empty directory was successfully deleted, or False if an error occurred.</p></description>
  2230. </function>
  2231. <function>
  2232. <name>DelTree</name>
  2233. <prototype>function DelTree(const Path: String; const IsDir, DeleteFiles, DeleteSubdirsAlso: Boolean): Boolean;</prototype>
  2234. <description><p>Deletes the specified directory if IsDir is set to True, or files/directories matching a wildcard if IsDir is set to False. Returns True if it was able to successfully remove everything.</p>
  2235. <p>If DeleteFiles is set to True, files inside the specified directory will be deleted if IsDir is True, or files matching the specified wildcard (including those with hidden, system, and read-only attributes) will be deleted if IsDir is False.</p>
  2236. <p>If DeleteFiles and DeleteSubdirsAlso are both set to True, subdirectories (and their contents) will be deleted in addition to files.</p></description>
  2237. <remarks><p>This function will remove directories that are reparse points, but it will not recursively delete files/directories inside them.</p></remarks>
  2238. <example><pre>begin
  2239. // Delete the directory C:\Test and everything inside it
  2240. DelTree('C:\Test', True, True, True);
  2241. // Delete files matching C:\Test\*.tmp
  2242. DelTree('C:\Test\*.tmp', False, True, False);
  2243. // Delete all files and directories inside C:\Test
  2244. // but leave the directory itself
  2245. DelTree('C:\Test\*', False, True, True);
  2246. end;</pre></example>
  2247. </function>
  2248. </subcategory>
  2249. <subcategory>
  2250. <function>
  2251. <name>CreateShellLink</name>
  2252. <prototype>function CreateShellLink(const Filename, Description, ShortcutTo, Parameters, WorkingDir, IconFilename: String; const IconIndex, ShowCmd: Integer): String;</prototype>
  2253. <description><p>Creates a shortcut to a file or folder. Returns the resulting filename of the link, which may differ from <tt>Filename</tt> if it ended up creating a .pif file instead of a .lnk file. On failure, an exception will be raised.</p>
  2254. <p><b>Parameters:</b><br />
  2255. <i>Filename</i><br />Filename of the shortcut file to be created. This should be the full path and must end with ".lnk".<br />
  2256. <i>Description</i><br />Description of the link. This will be displayed on a supporting OS when the user hovers the mouse over the file or shows the properties.<br />
  2257. <i>ShortcutTo</i><br />Target file for the shortcut. This must be the full path to the file. Double quotation marks to surround the path will be added automatically.<br />
  2258. <i>Parameters</i><br />Parameters to pass to the target file of the shortcut. Parameters which may include spaces should have double quote marks surrounding them. e.g. <tt>ExpandConstant('"{app}\foo"')</tt><br />
  2259. <i>WorkingDir</i><br />Working directory for the target file. This should be set to an absolute directory.<br />
  2260. <i>IconFilename</i><br />Path to file to supply the icon. If this is left as the empty string then the system default icon for the target file will be used.<br />
  2261. <i>IconIndex</i><br />Zero-based index of the icon.<br />
  2262. <i>ShowCmd</i><br />One of the SW_* constants</p></description>
  2263. <remarks><p>You will most likely want to remove this shortcut on uninstall. Do this by adding an entry to the <tt>UninstallDelete</tt> section.</p></remarks>
  2264. <example><pre>CreateShellLink(
  2265. ExpandConstant('{app}\config\Open licence database.lnk'),
  2266. 'Opens the licence database in SQLite',
  2267. ExpandConstant('{app}\config\sqlite.exe'),
  2268. ExpandConstant('"{app}\config\licences.db"'),
  2269. ExpandConstant('{app}\config'),
  2270. '',
  2271. 0,
  2272. SW_SHOWNORMAL);</pre></example>
  2273. </function>
  2274. <function>
  2275. <name>UnpinShellLink</name>
  2276. <prototype>function UnpinShellLink(const Filename: String): Boolean;</prototype>
  2277. <description><p>Attempt to unpin the shortcut with the specified filename. Returns True if the shortcut was successfully removed from the list of pinned items and/or the taskbar, or if the shortcut was not pinned at all.</p></description>
  2278. </function>
  2279. </subcategory>
  2280. <subcategory>
  2281. <function>
  2282. <name>RegisterServer</name>
  2283. <prototype>procedure RegisterServer(const Is64Bit: Boolean; const Filename: String; const FailCriticalErrors: Boolean);</prototype>
  2284. <description><p>Registers the DLL/OCX with the specified filename. If Is64Bit is True, the DLL/OCX will be loaded as a 64-bit image and registered in a 64-bit process. If FailCriticalErrors is True, the system will not display any critical-error-handler message boxes. Raises an exception if not successful.</p></description>
  2285. <example><pre>begin
  2286. // Register hhctrl.ocx located in the System directory.
  2287. RegisterServer(Is64BitInstallMode, ExpandConstant('{sys}\hhctrl.ocx'), False);
  2288. end;</pre>
  2289. <p>Because we specify Is64BitInstallMode in the first parameter, it will register the 64-bit OCX in the 64-bit System directory when Setup is running in 64-bit install mode. Otherwise, it will register the 32-bit OCX in the 32-bit System directory.</p></example>
  2290. </function>
  2291. <function>
  2292. <name>UnregisterServer</name>
  2293. <prototype>function UnregisterServer(const Is64Bit: Boolean; const Filename: String; const FailCriticalErrors: Boolean): Boolean;</prototype>
  2294. <description><p>Unregisters the DLL/OCX with the specified filename. If Is64Bit is True, the DLL/OCX will be loaded as a 64-bit image and unregistered in a 64-bit process. If FailCriticalErrors is True, the system will not display any critical-error-handler message boxes. Returns True if successful, False otherwise.</p></description>
  2295. </function>
  2296. <function>
  2297. <name>RegisterTypeLibrary</name>
  2298. <prototype>procedure RegisterTypeLibrary(const Is64Bit: Boolean; const Filename: String);</prototype>
  2299. <description><p>Registers the type library with the specified filename. If Is64Bit is True, the type library will be registered in a 64-bit process. Raises an exception if not successful.</p></description>
  2300. <example><pre>begin
  2301. // Register stdole2.tlb located in the System directory.
  2302. RegisterTypeLibrary(Is64BitInstallMode, ExpandConstant('{sys}\stdole2.tlb'));
  2303. end;</pre>
  2304. <p>Because we specify Is64BitInstallMode in the first parameter, it will register the 64-bit type library in the 64-bit System directory when Setup is running in 64-bit install mode. Otherwise, it will register the 32-bit type library in the 32-bit System directory.</p></example>
  2305. </function>
  2306. <function>
  2307. <name>UnregisterTypeLibrary</name>
  2308. <prototype>function UnregisterTypeLibrary(const Is64Bit: Boolean; const Filename: String): Boolean</prototype>
  2309. <description><p>Unregisters the type library with the specified filename. If Is64Bit is True, the type library will be unregistered in a 64-bit process. Returns True if successful, False otherwise.</p></description>
  2310. </function>
  2311. <function>
  2312. <name>IncrementSharedCount</name>
  2313. <prototype>procedure IncrementSharedCount(const Is64Bit: Boolean; const Filename: String; const AlreadyExisted: Boolean);</prototype>
  2314. <description><p>Increments or initializes the reference count for the specified file in the following registry key:</p>
  2315. <p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs</p>
  2316. <p>64-bit versions of Windows have two separate SharedDLLs keys, one for 64-bit files and one for 32-bit files. If Is64Bit is True, the 64-bit SharedDLLs key will be updated, otherwise the 32-bit SharedDLLs key will be updated. The setting of this parameter should correspond to the bitness of the file; for example, if it is a 32-bit DLL located in the 32-bit System directory, you should specify False. You may also specify <tt>Is64BitInstallMode</tt> in which case it will use the current install mode to determine which key to open.</p>
  2317. <p>Pass True in the AlreadyExisted parameter if the file already exists; in this case the initial reference count for the file will be 2 if the value for the file doesn't already exist in the registry. (This behavior is in line with Microsoft's requirements.)</p>
  2318. <p>An exception will be raised if the registry key cannot be opened for write access.</p></description>
  2319. </function>
  2320. <function>
  2321. <name>DecrementSharedCount</name>
  2322. <prototype>function DecrementSharedCount(const Is64Bit: Boolean; const Filename: String): Boolean;</prototype>
  2323. <description><p>Decrements the reference count for the specified file in the following registry key:</p>
  2324. <p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs</p>
  2325. <p>64-bit versions of Windows have two separate SharedDLLs keys, one for 64-bit files and one for 32-bit files. If Is64Bit is True, the 64-bit SharedDLLs key will be updated, otherwise the 32-bit SharedDLLs key will be updated. The setting of this parameter should correspond to the bitness of the file; for example, if it is a 32-bit DLL located in the 32-bit System directory, you should specify False. You may also specify <tt>Is64BitInstallMode</tt> in which case it will use the current install mode to determine which key to open.</p>
  2326. <p>Returns True if the count reached zero (meaning it's OK to delete the file). Returns False if the new count is greater than zero, or if the value for the file doesn't exist or is in an unrecognizable format.</p>
  2327. <p>An exception will be raised if the registry key cannot be opened for write access.</p></description>
  2328. </function>
  2329. <function>
  2330. <name>RestartReplace</name>
  2331. <prototype>procedure RestartReplace(const TempFile, DestFile: String);</prototype>
  2332. <description><p>Renames TempFile to DestFile the next time Windows is started. If DestFile already existed, it will be overwritten. If DestFile is '' then TempFile will be deleted. An exception will be raised upon failure.</p></description>
  2333. </function>
  2334. <function>
  2335. <name>UnregisterFont</name>
  2336. <prototype>procedure UnregisterFont(const FontName, FontFilename: String; const PerUserFont: Boolean);</prototype>
  2337. <description><p>Unregisters the font with the specified face and filename.</p></description>
  2338. </function>
  2339. <function>
  2340. <name>ModifyPifFile</name>
  2341. <prototype>function ModifyPifFile(const Filename: String; const CloseOnExit: Boolean): Boolean;</prototype>
  2342. <description><p>Changes the "Close on exit" setting of a .pif file. Returns True if it was able to make the change.</p></description>
  2343. </function>
  2344. </subcategory>
  2345. </category>
  2346. <category>
  2347. <description>File Version</description>
  2348. <subcategory>
  2349. <function>
  2350. <name>GetVersionNumbers</name>
  2351. <prototype>function GetVersionNumbers(const Filename: String; var VersionMS, VersionLS: Cardinal): Boolean;</prototype>
  2352. <description><p>Gets the version numbers of the specified file. Returns True if successful, False otherwise.</p></description>
  2353. <seealso><p><link topic="isxfunc_PackVersionNumbers">PackVersionNumbers</link></p></seealso>
  2354. </function>
  2355. <function>
  2356. <name>GetVersionComponents</name>
  2357. <prototype>function GetVersionComponents(const Filename: String; var Major, Minor, Revision, Build: Word): Boolean;</prototype>
  2358. <description><p>Gets the individual version components of the specified file. Returns True if successful, False otherwise.</p></description>
  2359. <seealso><p><link topic="isxfunc_PackVersionComponents">PackVersionComponents</link></p></seealso>
  2360. </function>
  2361. <function>
  2362. <name>GetVersionNumbersString</name>
  2363. <prototype>function GetVersionNumbersString(const Filename: String; var Version: String): Boolean;</prototype>
  2364. <description><p>Gets the version of the specified file as a string (in "0.0.0.0" format). Returns True if successful, False otherwise.</p></description>
  2365. </function>
  2366. <function>
  2367. <name>GetPackedVersion</name>
  2368. <prototype>function GetPackedVersion(const Filename: String; var Version: Int64): Boolean;</prototype>
  2369. <description><p>Gets the packed version of the specified file. Returns True if successful, False otherwise.</p>
  2370. <p>Always use <link topic="isxfunc_ComparePackedVersion">ComparePackedVersion</link> or <link topic="isxfunc_SamePackedVersion">SamePackedVersion</link> to compare packed versions.</p></description>
  2371. <seealso><p><link topic="isxfunc_PackVersionComponents">PackVersionComponents</link></p></seealso>
  2372. </function>
  2373. </subcategory>
  2374. <subcategory>
  2375. <function>
  2376. <name>PackVersionNumbers</name>
  2377. <prototype>function PackVersionNumbers(const VersionMS, VersionLS: Cardinal): Int64;</prototype>
  2378. <description><p>Packs version numbers into a single value.</p>
  2379. <p>Always use <link topic="isxfunc_ComparePackedVersion">ComparePackedVersion</link> or <link topic="isxfunc_SamePackedVersion">SamePackedVersion</link> to compare packed versions.</p></description>
  2380. <seealso><p><link topic="isxfunc_GetVersionNumbers">GetVersionNumbers</link><br />
  2381. <link topic="isxfunc_PackVersionComponents">PackVersionComponents</link><br />
  2382. <link topic="isxfunc_UnpackVersionNumbers">UnpackVersionNumbers</link></p></seealso>
  2383. </function>
  2384. <function>
  2385. <name>PackVersionComponents</name>
  2386. <prototype>function PackVersionComponents(const Major, Minor, Revision, Build: Word): Int64;</prototype>
  2387. <description><p>Packs individual version components into a single value.</p>
  2388. <p>Always use <link topic="isxfunc_ComparePackedVersion">ComparePackedVersion</link> or <link topic="isxfunc_SamePackedVersion">SamePackedVersion</link> to compare packed versions.</p></description>
  2389. <seealso><p><link topic="isxfunc_GetVersionComponents">GetVersionComponents</link><br />
  2390. <link topic="isxfunc_PackVersionNumbers">PackVersionNumbers</link><br />
  2391. <link topic="isxfunc_UnpackVersionComponents">UnpackVersionComponents</link></p></seealso>
  2392. </function>
  2393. </subcategory>
  2394. <subcategory>
  2395. <function>
  2396. <name>ComparePackedVersion</name>
  2397. <prototype>function ComparePackedVersion(const Version1, Version2: Int64): Integer;</prototype>
  2398. <description><p>Compares Version1 to Version2. The return value is less than 0 if Version1 is less than Version2, 0 if Version1 equals Version2, or greater than 0 if Version1 is greater than Version2.</p></description>
  2399. </function>
  2400. <function>
  2401. <name>SamePackedVersion</name>
  2402. <prototype>function SamePackedVersion(const Version1, Version2: Int64): Boolean;</prototype>
  2403. <description><p>Compares the packed versions Version1 and Version2 and returns True if they are equal.</p></description>
  2404. </function>
  2405. </subcategory>
  2406. <subcategory>
  2407. <function>
  2408. <name>UnpackVersionNumbers</name>
  2409. <prototype>procedure UnpackVersionNumbers(const Version: Int64; var VersionMS, VersionLS: Cardinal);</prototype>
  2410. <description><p>Unpacks a packed version into version numbers.</p></description>
  2411. <seealso><p><link topic="isxfunc_UnpackVersionComponents">UnpackVersionComponents</link><br />
  2412. <link topic="isxfunc_PackVersionNumbers">PackVersionNumbers</link></p></seealso>
  2413. </function>
  2414. <function>
  2415. <name>UnpackVersionComponents</name>
  2416. <prototype>procedure UnpackVersionComponents(const Version: Int64; var Major, Minor, Revision, Build: Word);</prototype>
  2417. <description><p>Unpacks a packed version into individual version components.</p></description>
  2418. <seealso><p><link topic="isxfunc_UnpackVersionNumbers">UnpackVersionNumbers</link><br />
  2419. <link topic="isxfunc_PackVersionComponents">PackVersionComponents</link></p></seealso>
  2420. </function>
  2421. </subcategory>
  2422. <subcategory>
  2423. <function>
  2424. <name>VersionToStr</name>
  2425. <prototype>function VersionToStr(const Version: Int64): String;</prototype>
  2426. <description><p>Returns the specified packed version as a string (in "0.0.0.0" format).</p></description>
  2427. <seealso><p><link topic="isxfunc_StrToVersion">StrToVersion</link><br />
  2428. <link topic="isxfunc_UnpackVersionNumbers">UnpackVersionNumbers</link><br />
  2429. <link topic="isxfunc_UnpackVersionComponents">UnpackVersionComponents</link></p></seealso>
  2430. </function>
  2431. <function>
  2432. <name>StrToVersion</name>
  2433. <prototype>function StrToVersion(const Version: String; var Version: Int64): Boolean;</prototype>
  2434. <description><p>Returns the specified string (in "0.0.0.0" format) as a packed version. Returns True if successful, False otherwise.</p></description>
  2435. <seealso><p><link topic="isxfunc_VersionToStr">VersionToStr</link><br />
  2436. <link topic="isxfunc_PackVersionNumbers">PackVersionNumbers</link><br />
  2437. <link topic="isxfunc_PackVersionComponents">PackVersionComponents</link></p></seealso>
  2438. </function>
  2439. </subcategory>
  2440. </category>
  2441. <category>
  2442. <description>Registry</description>
  2443. <subcategory>
  2444. <function>
  2445. <name>RegKeyExists</name>
  2446. <prototype>function RegKeyExists(const RootKey: HKEY; const SubKeyName: String): Boolean;</prototype>
  2447. <description><p>Returns True if the specified registry key exists.</p></description>
  2448. <example><pre>begin
  2449. if RegKeyExists(HKEY_AUTO, 'Software\Jordan Russell\Inno Setup') then
  2450. begin
  2451. // The key exists
  2452. end;
  2453. end;</pre></example>
  2454. </function>
  2455. <function>
  2456. <name>RegValueExists</name>
  2457. <prototype>function RegValueExists(const RootKey: HKEY; const SubKeyName, ValueName: String): Boolean;</prototype>
  2458. <description><p>Returns True if the specified registry key and value exist.</p></description>
  2459. <example><pre>begin
  2460. if RegValueExists(HKEY_CURRENT_USER, 'Console', 'WindowSize') then
  2461. begin
  2462. // The value exists
  2463. end;
  2464. end;</pre></example>
  2465. </function>
  2466. </subcategory>
  2467. <subcategory>
  2468. <function>
  2469. <name>RegGetSubkeyNames</name>
  2470. <prototype>function RegGetSubkeyNames(const RootKey: HKEY; const SubKeyName: String; var Names: TArrayOfString): Boolean;</prototype>
  2471. <description><p>Opens the specified registry key and reads the names of its subkeys into the specified string array Names. Returns True if successful, False otherwise.</p></description>
  2472. <example><pre>var
  2473. Names: TArrayOfString;
  2474. S: String;
  2475. begin
  2476. if RegGetSubkeyNames(HKEY_CURRENT_USER, 'Control Panel', Names) then
  2477. begin
  2478. S := StringJoin(#13#10, Names);
  2479. MsgBox('List of subkeys:'#13#10#13#10 + S, mbInformation, MB_OK);
  2480. end else
  2481. begin
  2482. // add any code to handle failure here
  2483. end;
  2484. end;</pre></example>
  2485. </function>
  2486. <function>
  2487. <name>RegGetValueNames</name>
  2488. <prototype>function RegGetValueNames(const RootKey: HKEY; const SubKeyName: String; var Names: TArrayOfString): Boolean;</prototype>
  2489. <description><p>Opens the specified registry key and reads the names of its values into the specified string array Names. Returns True if successful, False otherwise.</p></description>
  2490. <example><pre>var
  2491. Names: TArrayOfString;
  2492. S: String;
  2493. begin
  2494. if RegGetValueNames(HKEY_CURRENT_USER, 'Control Panel\Mouse', Names) then
  2495. begin
  2496. S := StringJoin(#13#10, Names);
  2497. MsgBox('List of values:'#13#10#13#10 + S, mbInformation, MB_OK);
  2498. end else
  2499. begin
  2500. // add any code to handle failure here
  2501. end;
  2502. end;</pre></example>
  2503. </function>
  2504. </subcategory>
  2505. <subcategory>
  2506. <function>
  2507. <name>RegQueryStringValue</name>
  2508. <prototype>function RegQueryStringValue(const RootKey: HKEY; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;</prototype>
  2509. <description><p>Queries the specified REG_SZ- or REG_EXPAND_SZ-type value, and returns the data in ResultStr. Returns True if successful. When False is returned, ResultStr is unmodified.</p></description>
  2510. <example><pre>var
  2511. Country: String;
  2512. begin
  2513. if RegQueryStringValue(HKEY_CURRENT_USER, 'Control Panel\International',
  2514. 'sCountry', Country) then
  2515. begin
  2516. // Successfully read the value
  2517. MsgBox('Your country: ' + Country, mbInformation, MB_OK);
  2518. end;
  2519. end;</pre></example>
  2520. </function>
  2521. <function>
  2522. <name>RegQueryMultiStringValue</name>
  2523. <prototype>function RegQueryMultiStringValue(const RootKey: HKEY; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;</prototype>
  2524. <description><p>Queries the specified REG_MULTI_SZ-type registry value, and returns the data in ResultStr. Returns True if successful. When False is returned, ResultStr is unmodified.</p></description>
  2525. <remarks><p>In a REG_MULTI_SZ-type value, each string is separated by a null character (<tt>#0</tt>).</p></remarks>
  2526. </function>
  2527. <function>
  2528. <name>RegQueryDWordValue</name>
  2529. <prototype>function RegQueryDWordValue(const RootKey: HKEY; const SubKeyName, ValueName: String; var ResultDWord: Cardinal): Boolean;</prototype>
  2530. <description><p>Queries the specified REG_DWORD-type registry value, and returns the data in ResultDWord. Returns True if successful. When False is returned, ResultDWord is unmodified.</p></description>
  2531. <example><pre>var
  2532. HistoryBufferSize: Cardinal;
  2533. begin
  2534. if RegQueryDWordValue(HKEY_CURRENT_USER, 'Console',
  2535. 'HistoryBufferSize', HistoryBufferSize) then
  2536. begin
  2537. // Successfully read the value
  2538. MsgBox('Console history buffer size: ' + IntToStr(HistoryBufferSize),
  2539. mbInformation, MB_OK);
  2540. end;
  2541. end;</pre></example>
  2542. </function>
  2543. <function>
  2544. <name>RegQueryBinaryValue</name>
  2545. <prototype>function RegQueryBinaryValue(const RootKey: HKEY; const SubKeyName, ValueName: String; var ResultStr: AnsiString): Boolean;</prototype>
  2546. <description><p>Queries the specified registry value, and returns the data in ResultStr. Returns True if successful. When False is returned, ResultStr is unmodified.</p></description>
  2547. </function>
  2548. </subcategory>
  2549. <subcategory>
  2550. <function>
  2551. <name>RegWriteStringValue</name>
  2552. <prototype>function RegWriteStringValue(const RootKey: HKEY; const SubKeyName, ValueName, Data: String): Boolean;</prototype>
  2553. <description><p>Writes the specified REG_SZ-type registry value. Returns True if successful, False otherwise.</p></description>
  2554. <remarks><p>If the value already exists and is of type REG_EXPAND_SZ, the new value will also be of type REG_EXPAND_SZ. Otherwise, a REG_SZ-type value will be created.</p></remarks>
  2555. <example><pre>begin
  2556. RegWriteStringValue(HKEY_AUTO, 'Software\My Company\My Program',
  2557. 'Language', ExpandConstant('{language}'));
  2558. end;</pre></example>
  2559. </function>
  2560. <function>
  2561. <name>RegWriteExpandStringValue</name>
  2562. <prototype>function RegWriteExpandStringValue(const RootKey: HKEY; const SubKeyName, ValueName, Data: String): Boolean;</prototype>
  2563. <description><p>Writes the specified REG_EXPAND_SZ-type registry value. Returns True if successful, False otherwise.</p></description>
  2564. <example><pre>begin
  2565. RegWriteStringValue(HKEY_CURRENT_USER, 'Software\My Company\My Program',
  2566. 'UserName', '%UserName%);
  2567. end;</pre></example>
  2568. </function>
  2569. <function>
  2570. <name>RegWriteMultiStringValue</name>
  2571. <prototype>function RegWriteMultiStringValue(const RootKey: HKEY; const SubKeyName, ValueName, Data: String): Boolean;</prototype>
  2572. <description><p>Writes the specified REG_MULTI_SZ-type registry value. Returns True if successful, False otherwise.</p></description>
  2573. <remarks><p>In a REG_MULTI_SZ-type value, each string is separated by a null character (<tt>#0</tt>).</p></remarks>
  2574. <example><pre>begin
  2575. RegWriteMultiStringValue(HKEY_AUTO, 'Software\My Company\My Program',
  2576. 'MultiStringTest', 'String1' + #0 + 'String2' + #0 + 'String3');
  2577. end;</pre></example>
  2578. </function>
  2579. <function>
  2580. <name>RegWriteDWordValue</name>
  2581. <prototype>function RegWriteDWordValue(const RootKey: HKEY; const SubKeyName, ValueName: String; const Data: Cardinal): Boolean;</prototype>
  2582. <description><p>Writes the specified REG_DWORD-type registry value. Returns True if successful, False otherwise.</p></description>
  2583. <example><pre>begin
  2584. RegWriteDWordValue(HKEY_AUTO, 'Software\My Company\My Program',
  2585. 'ShowToolbar', 1);
  2586. end;</pre></example>
  2587. </function>
  2588. <function>
  2589. <name>RegWriteBinaryValue</name>
  2590. <prototype>function RegWriteBinaryValue(const RootKey: HKEY; const SubKeyName, ValueName: String; const Data: AnsiString): Boolean;</prototype>
  2591. <description><p>Writes the specified REG_BINARY-type registry value. Returns True if successful, False otherwise.</p></description>
  2592. <example><pre>begin
  2593. RegWriteBinaryValue(HKEY_AUTO, 'Software\My Company\My Program',
  2594. 'BinaryTest', 'Whatever' + #1#2#3#4);
  2595. end;</pre></example>
  2596. </function>
  2597. </subcategory>
  2598. <subcategory>
  2599. <function>
  2600. <name>RegDeleteKeyIncludingSubkeys</name>
  2601. <prototype>function RegDeleteKeyIncludingSubkeys(const RootKey: HKEY; const SubkeyName: String): Boolean;</prototype>
  2602. <description><p>Deletes the specified key and all subkeys. Returns True if successful, False otherwise.</p></description>
  2603. </function>
  2604. <function>
  2605. <name>RegDeleteKeyIfEmpty</name>
  2606. <prototype>function RegDeleteKeyIfEmpty(const RootKey: HKEY; const SubkeyName: String): Boolean;</prototype>
  2607. <description><p>Deletes the specified subkey if it has no subkeys or values. Returns True if successful, False otherwise.</p></description>
  2608. </function>
  2609. <function>
  2610. <name>RegDeleteValue</name>
  2611. <prototype>function RegDeleteValue(const RootKey: HKEY; const SubKeyName, ValueName: String): Boolean;</prototype>
  2612. <description><p>Deletes the specified value. Returns True if successful, False otherwise.</p></description>
  2613. </function>
  2614. </subcategory>
  2615. </category>
  2616. <category>
  2617. <description>INI File</description>
  2618. <subcategory>
  2619. <function>
  2620. <name>IniKeyExists</name>
  2621. <prototype>function IniKeyExists(const Section, Key, Filename: String): Boolean;</prototype>
  2622. <description><p>Returns True if the specified INI key exists.</p></description>
  2623. </function>
  2624. <function>
  2625. <name>IsIniSectionEmpty</name>
  2626. <prototype>function IsIniSectionEmpty(const Section, Filename: String): Boolean;</prototype>
  2627. <description><p>Returns True if the specified INI section is empty.</p></description>
  2628. </function>
  2629. </subcategory>
  2630. <subcategory>
  2631. <function>
  2632. <name>GetIniBool</name>
  2633. <prototype>function GetIniBool(const Section, Key: String; const Default: Boolean; const Filename: String): Boolean</prototype>
  2634. <description><p>Reads a Boolean from an INI file.</p></description>
  2635. </function>
  2636. <function>
  2637. <name>GetIniInt</name>
  2638. <prototype>function GetIniInt(const Section, Key: String; const Default, Min, Max: LongInt; const Filename: String): LongInt;</prototype>
  2639. <description><p>Reads a LongInt from an INI file. If the LongInt read is not between Min/Max then it returns Default. If Min=Max then Min/Max are ignored.</p></description>
  2640. </function>
  2641. <function>
  2642. <name>GetIniString</name>
  2643. <prototype>function GetIniString(const Section, Key, Default, Filename: String): String;</prototype>
  2644. <description><p>Reads a String from an INI file.</p></description>
  2645. </function>
  2646. </subcategory>
  2647. <subcategory>
  2648. <function>
  2649. <name>SetIniBool</name>
  2650. <prototype>function SetIniBool(const Section, Key: String; const Value: Boolean; const Filename: String): Boolean;</prototype>
  2651. <description><p>Writes a Boolean to an INI file.</p></description>
  2652. </function>
  2653. <function>
  2654. <name>SetIniInt</name>
  2655. <prototype>function SetIniInt(const Section, Key: String; const Value: LongInt; const Filename: String): Boolean;</prototype>
  2656. <description><p>Writes a LongInt to an INI file.</p></description>
  2657. </function>
  2658. <function>
  2659. <name>SetIniString</name>
  2660. <prototype>function SetIniString(const Section, Key, Value, Filename: String): Boolean;</prototype>
  2661. <description><p>Writes a string to an INI file.</p></description>
  2662. </function>
  2663. </subcategory>
  2664. <subcategory>
  2665. <function>
  2666. <name>DeleteIniSection</name>
  2667. <prototype>procedure DeleteIniSection(const Section, Filename: String);</prototype>
  2668. <description><p>Deletes the specified section from an INI file.</p></description>
  2669. </function>
  2670. <function>
  2671. <name>DeleteIniEntry</name>
  2672. <prototype>procedure DeleteIniEntry(const Section, Key, Filename: String);</prototype>
  2673. <description><p>Deletes the specified key from an INI file.</p></description>
  2674. </function>
  2675. </subcategory>
  2676. </category>
  2677. <category>
  2678. <description>Custom Setup Wizard Page</description>
  2679. <subcategory>
  2680. <function>
  2681. <name>CreateInputQueryPage</name>
  2682. <prototype>function CreateInputQueryPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputQueryWizardPage;</prototype>
  2683. <description><p>Creates a wizard page containing edit boxes.</p></description>
  2684. <remarks><p>To create edit boxes on the page, call the Add method. Use the Values property to get/set the text of the edit boxes.</p></remarks>
  2685. <example><pre>var
  2686. Page: TInputQueryWizardPage;
  2687. UserName, UserCompany: String;
  2688. ...
  2689. // Create the page
  2690. Page := CreateInputQueryPage(wpWelcome,
  2691. 'Personal Information', 'Who are you?',
  2692. 'Please specify your name and the company for whom you work, then click Next.');
  2693. // Add items (False means it's not a password edit)
  2694. Page.Add('&amp;Name:', False);
  2695. Page.Add('&amp;Company:', False);
  2696. // Set initial values (optional)
  2697. Page.Values[0] := ExpandConstant('{sysuserinfoname}');
  2698. Page.Values[1] := ExpandConstant('{sysuserinfoorg}');
  2699. ...
  2700. // Read values into variables
  2701. UserName := Page.Values[0];
  2702. UserCompany := Page.Values[1];
  2703. </pre>
  2704. <p>See <i>AllPagesExample.iss</i> for another example.</p></example>
  2705. <seealso><p><link topic="scriptclasses" anchor="TInputQueryWizardPage">TInputQueryWizardPage</link></p></seealso>
  2706. </function>
  2707. <function>
  2708. <name>CreateInputOptionPage</name>
  2709. <prototype>function CreateInputOptionPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; Exclusive, ListBox: Boolean): TInputOptionWizardPage;</prototype>
  2710. <description><p>Creates a wizard page containing check boxes or radio buttons.</p>
  2711. <p>If Exclusive is True, radio buttons are displayed instead of check boxes, and only one item in the list may be selected at a time. If ListBox is True, the check boxes or radio buttons are placed inside a scrollable list box.</p></description>
  2712. <remarks><p>To create check boxes / radio buttons on the page, call the Add method. Use the Values property to get/set the checked state of items. On pages created with Exclusive=True, you can get/set the index of the one selected item via the SelectedValueIndex property.</p></remarks>
  2713. <example><pre>var
  2714. Page: TInputOptionWizardPage;
  2715. IsRegisteredUser: Boolean;
  2716. ...
  2717. // Create the page
  2718. Page := CreateInputOptionPage(wpWelcome,
  2719. 'License Information', 'Are you a registered user?',
  2720. 'If you are a registered user, please check the box below, then click Next.',
  2721. False, False);
  2722. // Add items
  2723. Page.Add('&amp;I am a registered user');
  2724. // Set initial values (optional)
  2725. Page.Values[0] := False;
  2726. ...
  2727. // Read values into variables
  2728. IsRegisteredUser := Page.Values[0];
  2729. </pre>
  2730. <p>See <i>AllPagesExample.iss</i> for another example.</p></example>
  2731. <seealso><p><link topic="scriptclasses" anchor="TInputOptionWizardPage">TInputOptionWizardPage</link></p></seealso>
  2732. </function>
  2733. <function>
  2734. <name>CreateInputDirPage</name>
  2735. <prototype>function CreateInputDirPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; AAppendDir: Boolean; ANewFolderName: String): TInputDirWizardPage;</prototype>
  2736. <description><p>Creates a wizard page that contains edit boxes and Browse buttons for selecting directories. If AAppendDir is True, the value of ANewFolderName will be appended onto any folder name the user clicks. If AAppendDir is False and ANewFolderName is not empty, a Make New Folder button will be shown that creates a new folder with the specified default name.</p></description>
  2737. <remarks><p>To create directory selection boxes on the page, call the Add method. Use the Values property to get/set the items' values.</p></remarks>
  2738. <example><pre>var
  2739. Page: TInputDirWizardPage;
  2740. DataDir: String;
  2741. ...
  2742. // Create the page
  2743. Page := CreateInputDirPage(wpWelcome,
  2744. 'Select Personal Data Location', 'Where should personal data files be stored?',
  2745. 'Personal data files will be stored in the following folder.'#13#10#13#10 +
  2746. 'To continue, click Next. If you would like to select a different folder, click Browse.',
  2747. False, SetupMessage(msgNewFolderName));
  2748. // Add item (with an empty caption)
  2749. Page.Add('');
  2750. // Set initial value (optional)
  2751. Page.Values[0] := ExpandConstant('{userappdata}\My Company\My Program');
  2752. ...
  2753. // Read value into variable
  2754. DataDir := Page.Values[0];
  2755. </pre>
  2756. <p>See <i>AllPagesExample.iss</i> for another example.</p></example>
  2757. <seealso><p><link topic="scriptclasses" anchor="TInputDirWizardPage">TInputDirWizardPage</link></p></seealso>
  2758. </function>
  2759. <function>
  2760. <name>CreateInputFilePage</name>
  2761. <prototype>function CreateInputFilePage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputFileWizardPage;</prototype>
  2762. <description><p>Creates a wizard page that contains edit boxes and Browse buttons for selecting files.</p></description>
  2763. <remarks><p>To create file selection boxes on the page, call the Add method. Use the Values property to get/set the items' values.</p>
  2764. <p>An example Filter: 'Text files (*.txt)|*.txt|All files (*.*)|*.*'</p></remarks>
  2765. <example><pre>var
  2766. Page: TInputFileWizardPage;
  2767. NotepadLocation: String;
  2768. ...
  2769. // Create the page
  2770. Page := CreateInputFilePage(wpWelcome,
  2771. 'Select Notepad Location', 'Where is Notepad located?',
  2772. 'Select where Notepad is located, then click Next.');
  2773. // Add item
  2774. Page.Add('&amp;Location of notepad.exe:', // caption
  2775. 'Executable files|*.exe|All files|*.*', // filters
  2776. '.exe'); // default extension
  2777. // Set initial value (optional)
  2778. Page.Values[0] := ExpandConstant('{win}\notepad.exe');
  2779. ...
  2780. // Read value into variable
  2781. NotepadLocation := Page.Values[0];
  2782. </pre>
  2783. <p>See <i>AllPagesExample.iss</i> for another example.</p></example>
  2784. <seealso><p><link topic="scriptclasses" anchor="TInputFileWizardPage">TInputFileWizardPage</link></p></seealso>
  2785. </function>
  2786. <function>
  2787. <name>CreateOutputMsgPage</name>
  2788. <prototype>function CreateOutputMsgPage(const AfterID: Integer; const ACaption, ADescription, AMsg: String): TOutputMsgWizardPage;</prototype>
  2789. <description><p>Creates a wizard page containing only static text. The AMsg parameter specifies the text to display.</p></description>
  2790. <example><pre>var
  2791. Page: TOutputMsgWizardPage;
  2792. ...
  2793. // Create the page
  2794. Page := CreateOutputMsgPage(wpWelcome,
  2795. 'Information', 'Please read the following important information before continuing.',
  2796. 'Blah blah blah.');
  2797. </pre>
  2798. <p>See <i>AllPagesExample.iss</i> for another example.</p></example>
  2799. <seealso><p><link topic="scriptclasses" anchor="TOutputMsgWizardPage">TOutputMsgWizardPage</link></p></seealso>
  2800. </function>
  2801. <function>
  2802. <name>CreateOutputMsgMemoPage</name>
  2803. <prototype>function CreateOutputMsgMemoPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; const AMsg: AnsiString): TOutputMsgMemoWizardPage;</prototype>
  2804. <description><p>Creates a wizard page containing static text as well as a read-only, multi-line edit control, capable of displaying RTF text. The ASubCaption parameter specifies the static text to display. AMsg specifies the text to assign to the edit control.</p></description>
  2805. <example><pre>var
  2806. Page: TOutputMsgMemoWizardPage;
  2807. ...
  2808. // Create the page
  2809. Page := CreateOutputMsgMemoPage(wpWelcome,
  2810. 'Information', 'Please read the following important information before continuing.',
  2811. 'When you are ready to continue with Setup, click Next.',
  2812. 'Blah blah blah.');
  2813. </pre>
  2814. <p>See <i>AllPagesExample.iss</i> for another example.</p></example>
  2815. <seealso><p><link topic="scriptclasses" anchor="TOutputMsgMemoWizardPage">TOutputMsgMemoWizardPage</link></p></seealso>
  2816. </function>
  2817. <function>
  2818. <name>CreateOutputProgressPage</name>
  2819. <prototype>function CreateOutputProgressPage(const ACaption, ADescription: String): TOutputProgressWizardPage;</prototype>
  2820. <description><p>Creates a wizard page containing static text as well as a progress bar (which is hidden by default).</p>
  2821. <p>Unlike the other types of wizard pages, progress pages are not displayed as part of the normal page sequence (note that there is no <tt>AfterID</tt> parameter). A progress page can only be displayed programmatically by calling its <tt>Show</tt> method.</p></description>
  2822. <remarks><p>Call the <tt>Show</tt> method to activate and show the page. When you're finished with it, call the <tt>Hide</tt> method to revert to the previous page.</p>
  2823. <p>Always put the <tt>Hide</tt> call inside the <tt>finally</tt> part of a <tt>try..finally</tt> language construct, as demonstrated in <i>CodeDlg.iss</i>. Not calling <tt>Hide</tt> will result in the wizard being permanently stuck on the progress page.</p>
  2824. <p>To set the text on the page, call the <tt>SetText</tt> method. <tt>SetText</tt> takes two string parameters: use the first to tell the user what you're doing, and the second to display a file or directory name. Either parameter may be blank.</p>
  2825. <p>To show or update the progress bar, call the <tt>SetProgress</tt> method. <tt>SetProgress</tt> takes two integer parameters: the first specifies the position of the progress bar (zero-based), and the second specifies the highest possible position. If the second parameter is 0, the progress bar will be hidden.</p></remarks>
  2826. <example><p>See <i>CodeDlg.iss</i> and <i>AllPagesExample.iss</i> example scrips in the "Examples" subdirectory in your Inno Setup directory for examples.</p></example>
  2827. <seealso><p><link topic="scriptclasses" anchor="TOutputProgressWizardPage">TOutputProgressWizardPage</link><br />
  2828. <link topic="isxfunc_CreateOutputMarqueeProgressPage">CreateOutputMarqueeProgressPage</link></p></seealso>
  2829. </function>
  2830. <function>
  2831. <name>CreateOutputMarqueeProgressPage</name>
  2832. <prototype>function CreateOutputMarqueeProgressPage(const ACaption, ADescription: String): TOutputMarqueeProgressWizardPage;</prototype>
  2833. <description><p>Creates a wizard page containing static text as well as a marquee progress bar.</p>
  2834. <p>See <link topic="isxfunc_CreateOutputProgressPage">CreateOutputProgressPage</link> for information on how to work with progress pages.</p></description>
  2835. <remarks><p>To animate the progress bar, call the <tt>Animate</tt> method. Do not call the <tt>SetProgress</tt> method, it will raise an internal error.</p></remarks>
  2836. <example><p>See <i>AllPagesExample.iss</i> for an example.</p></example>
  2837. <seealso><p><link topic="scriptclasses" anchor="TOutputMarqueeProgressWizardPage">TOutputMarqueeProgressWizardPage</link></p></seealso>
  2838. </function>
  2839. <function>
  2840. <name>CreateDownloadPage</name>
  2841. <prototype>function CreateDownloadPage(const ACaption, ADescription: String; const OnDownloadProgress: TOnDownloadProgress): TDownloadWizardPage;</prototype>
  2842. <description><p>Creates a wizard page to download files and show progress.</p>
  2843. <p>Set OnDownloadProgress to a function to be informed of progress, or <tt>nil</tt> otherwise.</p>
  2844. <p>Unlike the other types of wizard pages, progress pages are not displayed as part of the normal page sequence (note that there is no <tt>AfterID</tt> parameter). A progress page can only be displayed programmatically by calling its <tt>Show</tt> method.</p></description>
  2845. <remarks><p>Call the <tt>Show</tt> method to activate and show the page. When you're finished with it, call the <tt>Hide</tt> method to revert to the previous page.</p>
  2846. <p>Always put the <tt>Hide</tt> call inside the <tt>finally</tt> part of a <tt>try..finally</tt> language construct, as demonstrated in <i>CodeDownloadFiles.iss</i>. Not calling <tt>Hide</tt> will result in the wizard being permanently stuck on the progress page.</p>
  2847. <p>To add a new file to download, call the <tt>Add</tt> method. Always call the <tt>Clear</tt> method before adding the first file.</p>
  2848. <p>To start the download, call the <tt>Download</tt> method. An exception will be raised if there was an error. Otherwise, <tt>Download</tt> returns the number of bytes downloaded.</p>
  2849. <p>Set the <tt>ShowBaseNameInsteadOfUrl</tt> property to <tt>True</tt> to show the base name of the file which is being downloaded to the user instead of the URL.</p>
  2850. <p>See <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link> for other considerations and the definition of <tt>TOnDownloadProgress</tt>.</p></remarks>
  2851. <example><p>See <i>CodeDownloadFiles.iss</i> for an example.</p>
  2852. <p>See <i>DownloadFiles.iss</i> for an example of file download using just a [Files] entry instead.</p></example>
  2853. <seealso><p><link topic="scriptclasses" anchor="TDownloadWizardPage">TDownloadWizardPage</link><br />
  2854. <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link><br />
  2855. <link topic="isxfunc_CreateOutputProgressPage">CreateOutputProgressPage</link></p></seealso>
  2856. </function>
  2857. <function>
  2858. <name>CreateExtractionPage</name>
  2859. <prototype>function CreateExtractionPage(const ACaption, ADescription: String; const OnExtractionProgress: TOnExtractionProgress): TExtractionWizardPage;</prototype>
  2860. <description><p>Creates a wizard page to extract archives and show progress.</p>
  2861. <p>The supported archive formats, beyond .7z, and the support for password-protected and multi-volume archives, depend on the <link topic="setup_archiveextraction">ArchiveExtraction</link> [Setup] section directive.</p>
  2862. <p>To allow the extraction of archives with custom extensions, such as self-extracting archives, call <link topic="isxfunc_MapArchiveExtensions">MapArchiveExtensions</link>.</p>
  2863. <p>Set OnExtractionProgress to a function to be informed of progress, or <tt>nil</tt> otherwise.</p>
  2864. <p>Unlike the other types of wizard pages, progress pages are not displayed as part of the normal page sequence (note that there is no <tt>AfterID</tt> parameter). A progress page can only be displayed programmatically by calling its <tt>Show</tt> method.</p></description>
  2865. <remarks><p>Call the <tt>Show</tt> method to activate and show the page. When you're finished with it, call the <tt>Hide</tt> method to revert to the previous page.</p>
  2866. <p>Always put the <tt>Hide</tt> call inside the <tt>finally</tt> part of a <tt>try..finally</tt> language construct, as demonstrated in <i>CodeDownloadFiles.iss</i>. Not calling <tt>Hide</tt> will result in the wizard being permanently stuck on the progress page.</p>
  2867. <p>To add a new archive to extract, call the <tt>Add</tt> method or the <tt>AddEx</tt> method if the archive is password-protected. Always call the <tt>Clear</tt> method before adding the first file.</p>
  2868. <p>To start the extraction, call the <tt>Extract</tt> method. An exception will be raised if there was an error. Otherwise, <tt>Extract</tt> returns the number of archives extracted.</p>
  2869. <p>Set the <tt>ShowArchiveInsteadFile</tt> property to <tt>True</tt> to show the name of the archive which is being extracted to the user instead of the names of the files inside the archive.</p>
  2870. <p>See <link topic="isxfunc_ExtractArchive">ExtractArchive</link> for the definition of <tt>TOnExtractionProgress</tt>.</p></remarks>
  2871. <example><p>See <i>CodeDownloadFiles.iss</i> for an example of <tt>CreateDownloadPage</tt> which works very similar to <tt>CreateExtractionPage</tt>.</p>
  2872. <p>See <i>DownloadFiles.iss</i> for an example of archive extraction using just a [Files] entry instead.</p>
  2873. </example>
  2874. <seealso><p><link topic="scriptclasses" anchor="TExtractionWizardPage">TExtractionWizardPage</link><br />
  2875. <link topic="isxfunc_ExtractArchive">ExtractArchive</link><br />
  2876. <link topic="isxfunc_MapArchiveExtensions">MapArchiveExtensions</link><br />
  2877. <link topic="isxfunc_CreateOutputProgressPage">CreateOutputProgressPage</link></p></seealso>
  2878. </function>
  2879. <function>
  2880. <name>CreateCustomPage</name>
  2881. <prototype>function CreateCustomPage(const AfterID: Integer; const ACaption, ADescription: String): TWizardPage;</prototype>
  2882. <description><p>Creates a custom wizard page. The page is empty by default; you have to create your own controls afterward and place them on the page (by setting their Parent properties to the Surface property of the <link topic="scriptclasses" anchor="TWizardPage">TWizardPage</link> instance returned by this function).</p></description>
  2883. <example><p>See <i>CodeClasses.iss</i> and <i>AllPagesExample.iss</i> example scripts in the "Examples" subdirectory in your Inno Setup directory for examples.</p></example>
  2884. <seealso><p><link topic="scriptclasses" anchor="TWizardPage">TWizardPage</link></p></seealso>
  2885. </function>
  2886. </subcategory>
  2887. <subcategory>
  2888. <function>
  2889. <name>CreateCustomForm</name>
  2890. <prototype>function CreateCustomForm(const ClientWidth, ClientHeight: Integer; const KeepSizeX, KeepSizeY: Boolean): TSetupForm;</prototype>
  2891. <description><p>Creates a form. The form is empty by default; you have to create your own controls afterward and place them on the form (by setting their Parent properties to the <link topic="scriptclasses" anchor="TSetupForm">TSetupForm</link> instance returned by this function).</p></description>
  2892. <remarks><p>You should call this function instead of creating <link topic="scriptclasses" anchor="TForm">TForm</link> or <link topic="scriptclasses" anchor="TSetupForm">TSetupForm</link> instances directly. This function automatically initializes the font and other properties of the created form to be like Setup's other dialogs.</p>
  2893. <p>The <tt>[LangOptions]</tt> section's <tt>DialogFontName</tt> and <tt>DialogFontSize</tt> directives determine the font used by the form and, by default, any child controls created on the form.</p>
  2894. <p>You should use <link topic="isxfunc_ScaleX">ScaleX</link> and <link topic="isxfunc_ScaleY">ScaleY</link> to scale the desired client width and height to appropriate values. A form's client width and height are the form's full width and height minus its borders.</p>
  2895. <p><tt>KeepSizeX</tt> and <tt>KeepSizeY</tt> specify whether the form is allowed to grow horizontally and vertically as the client area is resized, for [Setup] section directive <link topic="setup_wizardsizepercent">WizardSizePercent</link>.</p>
  2896. <p>The signature of the <tt>CreateCustomForm</tt> function has changed as of version 6.6.0. The width and height must now be specified upfront (they are now read-only properties once the form is constructed). Previously, your code might have looked like this:</p>
  2897. <pre>
  2898. Form := CreateCustomForm;
  2899. Form.Caption := 'TSetupForm';
  2900. Form.ClientWidth := ScaleX(256);
  2901. Form.ClientHeight := ScaleY(128);
  2902. </pre>
  2903. <p>Starting with version 6.6.0, it should be updated as follows:</p>
  2904. <pre>
  2905. Form := CreateCustomForm(ScaleX(256), ScaleY(128), False, False);
  2906. Form.Caption := 'TSetupForm';
  2907. </pre>
  2908. <p>The same applies to the <tt>KeepSizeX</tt> and <tt>KeepSizeY</tt> properties, which were writable properties before version 6.6.0, but are now specified as parameters when calling <tt>CreateCustomForm</tt> and are read-only properties afterwards.</p>
  2909. </remarks>
  2910. <example><p>See <i>CodeClasses.iss</i> for an example.</p></example>
  2911. <seealso><p><link topic="scriptclasses" anchor="TForm">TForm</link><br />
  2912. <link topic="scriptclasses" anchor="TSetupForm">TSetupForm</link></p></seealso>
  2913. </function>
  2914. </subcategory>
  2915. <subcategory>
  2916. <function>
  2917. <name>PageFromID</name>
  2918. <prototype>function PageFromID(const ID: Integer): TWizardPage;</prototype>
  2919. <description><p>Given a page ID, returns a <link topic="scriptclasses" anchor="TWizardPage">TWizardPage</link> instance. Call this if, for example, you need to get at the surface of a page and only know its ID.</p>
  2920. <p>An exception will be raised if an invalid page ID is specified.</p></description>
  2921. <example><pre>var
  2922. Page: TWizardPage;
  2923. begin
  2924. Page := PageFromID(wpWelcome);
  2925. Page.Surface.Color := clBlue;
  2926. end;</pre></example>
  2927. <seealso><p><link topic="scriptclasses" anchor="TWizardPage">TWizardPage</link></p></seealso>
  2928. </function>
  2929. <function>
  2930. <name>PageIndexFromID</name>
  2931. <prototype>function PageIndexFromID(const ID: Integer): NativeInt;</prototype>
  2932. <description><p>Given a page ID, returns an position index. Call this if, for example, you want to check whether a page is positioned before a certain other page.</p></description>
  2933. <example><pre>function ShouldSkipPage(PageID: Integer): Boolean;
  2934. begin
  2935. Result := PageIndexFromID(PageID) &lt; PageIndexFromID(wpReady);
  2936. end;</pre></example>
  2937. </function>
  2938. <function>
  2939. <name>ScaleX</name>
  2940. <prototype>function ScaleX(X: Integer): Integer;</prototype>
  2941. <description><p>Takes an X coordinate or width and returns it scaled to fit the size of the current dialog font. If you use the default font settings with standard DPI (100%), then X is returned unchanged.</p></description>
  2942. </function>
  2943. <function>
  2944. <name>ScaleY</name>
  2945. <prototype>function ScaleY(Y: Integer): Integer;</prototype>
  2946. <description><p>Takes a Y coordinate or height and returns it scaled to fit the size of the current dialog font. If you use the default font settings with standard DPI (100%), then Y is returned unchanged.</p></description>
  2947. </function>
  2948. <function>
  2949. <name>InitializeBitmapButtonFromIcon</name>
  2950. <prototype>function InitializeBitmapButtonFromIcon(const BitmapButton: TBitmapButton; const IconFilename: String; const BkColor: TColor; const AscendingTrySizes: TArrayOfInteger): Boolean;</prototype>
  2951. <description><p>Initializes the given bitmap button with an icon from the given icon file using the given background color for transparent parts.</p>
  2952. <p>See <link topic="isxfunc_InitializeBitmapImageFromIcon">InitializeBitmapImageFromIcon</link> for more information.</p></description>
  2953. </function>
  2954. <function>
  2955. <name>InitializeBitmapImageFromIcon</name>
  2956. <prototype>function InitializeBitmapImageFromIcon(const BitmapImage: TBitmapImage; const IconFilename: String; const BkColor: TColor; const AscendingTrySizes: TArrayOfInteger): Boolean;</prototype>
  2957. <description><p>Initializes the given bitmap image with an icon from the given icon file using the given background color for transparent parts.</p>
  2958. <p>The bitmap image should be scaled already and the function will load the largest fitting icon which has a size from the given array of sizes. After loading the function will set the size of the bitmap image to the loaded size.</p>
  2959. <p>The array must be sorted already from smallest to highest size.</p>
  2960. <p>If no match is found in the array (for example, because it is empty), the minimum of the bitmap image's width and height will be used as the size.</p>
  2961. <p>Returns True if the icon could be loaded, False otherwise.</p></description>
  2962. <example><pre>procedure InitializeWizard;
  2963. var
  2964. Page: TWizardPage;
  2965. BitmapImage: TBitmapImage;
  2966. begin
  2967. Page := CreateCustomPage(wpWelcome, 'Test', 'Test');
  2968. BitmapImage := TBitmapImage.Create(Page);
  2969. with BitmapImage do begin
  2970. Width := ScaleX(32);
  2971. Height := ScaleY(32);
  2972. Parent := Page.Surface;
  2973. end;
  2974. InitializeBitmapImageFromIcon(BitmapImage, 'MyProg.ico', clNone, [32, 48, 64]);
  2975. end;</pre></example>
  2976. <seealso><p><link topic="isxfunc_InitializeBitmapImageFromStockIcon">InitializeBitmapImageFromStockIcon</link></p></seealso>
  2977. </function>
  2978. <function>
  2979. <name>InitializeBitmapButtonFromStockIcon</name>
  2980. <prototype>function InitializeBitmapButtonFromStockIcon(const BitmapButton: TBitmapButton; const Siid: Integer; const BkColor: TColor; const AscendingTrySizes: TArrayOfInteger): Boolean;</prototype>
  2981. <description><p>Initializes the given bitmap button with a system-defined stock icon from the given stock icon id (siid) using the given background color for transparent parts.</p>
  2982. <p>See <link topic="isxfunc_InitializeBitmapImageFromStockIcon">InitializeBitmapImageFromStockIcon</link> for more information.</p></description>
  2983. </function>
  2984. <function>
  2985. <name>InitializeBitmapImageFromStockIcon</name>
  2986. <prototype>function InitializeBitmapImageFromStockIcon(const BitmapImage: TBitmapImage; const Siid: Integer; const BkColor: TColor; const AscendingTrySizes: TArrayOfInteger): Boolean;</prototype>
  2987. <description><p>Initializes the given bitmap image with a system-defined stock icon from the given stock icon id (siid) using the given background color for transparent parts.</p>
  2988. <p>The bitmap image should be scaled already and the function will load the largest fitting icon which has a size from the given array of sizes. After loading the function will set the size of the bitmap image to the loaded size.</p>
  2989. <p>The array must be sorted already from smallest to highest size.</p>
  2990. <p>If no match is found in the array (for example, because it is empty), the minimum of the bitmap image's width and height will be used as the size.</p>
  2991. <p>Unlike <link topic="isxfunc_InitializeBitmapImageFromIcon">InitializeBitmapImageFromIcon</link>, this function supports arbitrary sizes.</p>
  2992. <p>Returns True if the icon could be loaded, False otherwise.</p></description>
  2993. <remarks><p>See <a href="https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ne-shellapi-shstockiconid#constants">Microsoft Learn</a> for an overview of all available icons.</p>
  2994. <p>Supported values for <tt>Siid</tt> are:</p>
  2995. <p><tt>SIID_DOCNOASSOC, SIID_DOCASSOC, SIID_APPLICATION, SIID_FOLDER, SIID_FOLDEROPEN,
  2996. SIID_DRIVE525, SIID_DRIVE35, SIID_DRIVEREMOVE, SIID_DRIVEFIXED, SIID_DRIVENET,
  2997. SIID_DRIVENETDISABLED, SIID_DRIVECD, SIID_DRIVERAM, SIID_WORLD, SIID_SERVER,
  2998. SIID_PRINTER, SIID_MYNETWORK, SIID_FIND, SIID_HELP, SIID_SHARE, SIID_LINK,
  2999. SIID_SLOWFILE, SIID_RECYCLER, SIID_RECYCLERFULL, SIID_MEDIACDAUDIO, SIID_LOCK,
  3000. SIID_AUTOLIST, SIID_PRINTERNET, SIID_SERVERSHARE, SIID_PRINTERFAX,
  3001. SIID_PRINTERFAXNET, SIID_PRINTERFILE, SIID_STACK, SIID_MEDIASVCD,
  3002. SIID_STUFFEDFOLDER, SIID_DRIVEUNKNOWN, SIID_DRIVEDVD, SIID_MEDIADVD,
  3003. SIID_MEDIADVDRAM, SIID_MEDIADVDRW, SIID_MEDIADVDR, SIID_MEDIADVDROM,
  3004. SIID_MEDIACDAUDIOPLUS, SIID_MEDIACDRW, SIID_MEDIACDR, SIID_MEDIACDBURN,
  3005. SIID_MEDIABLANKCD, SIID_MEDIACDROM, SIID_AUDIOFILES, SIID_IMAGEFILES,
  3006. SIID_VIDEOFILES, SIID_MIXEDFILES, SIID_FOLDERBACK, SIID_FOLDERFRONT, SIID_SHIELD,
  3007. SIID_WARNING, SIID_INFO, SIID_ERROR, SIID_KEY, SIID_SOFTWARE, SIID_RENAME,
  3008. SIID_DELETE, SIID_MEDIAAUDIODVD, SIID_MEDIAMOVIEDVD, SIID_MEDIAENHANCEDCD,
  3009. SIID_MEDIAENHANCEDDVD, SIID_MEDIAHDDVD, SIID_MEDIABLURAY, SIID_MEDIAVCD,
  3010. SIID_MEDIADVDPLUSR, SIID_MEDIADVDPLUSRW, SIID_DESKTOPPC, SIID_MOBILEPC,
  3011. SIID_USERS, SIID_MEDIASMARTMEDIA, SIID_MEDIACOMPACTFLASH, SIID_DEVICECELLPHONE,
  3012. SIID_DEVICECAMERA, SIID_DEVICEVIDEOCAMERA, SIID_DEVICEAUDIOPLAYER,
  3013. SIID_NETWORKCONNECT, SIID_INTERNET, SIID_ZIPFILE, SIID_SETTINGS, SIID_DRIVEHDDVD,
  3014. SIID_DRIVEBD, SIID_MEDIAHDDVDROM, SIID_MEDIAHDDVDR, SIID_MEDIAHDDVDRAM,
  3015. SIID_MEDIABDROM, SIID_MEDIABDR, SIID_MEDIABDRE, SIID_CLUSTEREDDRIVE</tt></p></remarks>
  3016. <example><pre>procedure InitializeWizard;
  3017. var
  3018. Page: TWizardPage;
  3019. BitmapImage: TBitmapImage;
  3020. begin
  3021. Page := CreateCustomPage(wpWelcome, 'Test', 'Test');
  3022. BitmapImage := TBitmapImage.Create(Page);
  3023. with BitmapImage do begin
  3024. Width := ScaleX(32);
  3025. Height := ScaleY(32);
  3026. Parent := Page.Surface;
  3027. end;
  3028. InitializeBitmapImageFromStockIcon(BitmapImage, SIID_ERROR, clNone, [32, 48, 64]);
  3029. end;</pre></example>
  3030. <seealso><p><link topic="isxfunc_InitializeBitmapImageFromIcon">InitializeBitmapImageFromIcon</link></p></seealso>
  3031. </function>
  3032. </subcategory>
  3033. </category>
  3034. <category>
  3035. <description>Dialog</description>
  3036. <subcategory>
  3037. <function>
  3038. <name>MsgBox</name>
  3039. <prototype>function MsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons: Integer): Integer;</prototype>
  3040. <description><p>Displays a message box. <tt>Text</tt> specifies the message to display. <tt>Typ</tt> specifies which icon to display in the message box. <tt>Buttons</tt> specifies which buttons to include in the message box. Returns an ID* constant indicating the button the user clicked, or 0 if the function fails (which shouldn't happen unless an invalid parameter is specified or system resources are exhausted).</p></description>
  3041. <remarks><p>TMsgBoxType is defined as:</p>
  3042. <p><tt>TMsgBoxType = (mbInformation, mbConfirmation, mbError, mbCriticalError);</tt></p>
  3043. <p>Supported flags for <tt>Buttons</tt> are:</p>
  3044. <p><tt>MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_SETFOREGROUND</tt></p>
  3045. <p>Possible return values are:</p>
  3046. <p><tt>IDOK, IDCANCEL, IDABORT, IDRETRY, IDIGNORE, IDYES, IDNO</tt></p></remarks>
  3047. <example><pre>begin
  3048. // Display a simple message box with an OK button
  3049. MsgBox('Hello.', mbInformation, MB_OK);
  3050. // Ask the user a Yes/No question
  3051. if MsgBox('Are you sure?', mbConfirmation, MB_YESNO) = IDYES then
  3052. begin
  3053. // user clicked Yes
  3054. end;
  3055. // Ask the user a Yes/No question, defaulting to No
  3056. if MsgBox('Are you sure?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
  3057. begin
  3058. // user clicked Yes
  3059. end;
  3060. end;</pre></example>
  3061. <seealso><p><link topic="isxfunc_SuppressibleMsgBox">SuppressibleMsgBox</link><br />
  3062. <link topic="isxfunc_TaskDialogMsgBox">TaskDialogMsgBox</link></p></seealso>
  3063. </function>
  3064. <function>
  3065. <name>SuppressibleMsgBox</name>
  3066. <prototype>function SuppressibleMsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons, Default: Integer): Integer;</prototype>
  3067. <description><p>Displays a suppressible message box. If message boxes are being suppressed (see <link topic="setupcmdline" window="main">Setup Command Line Parameters</link>), <tt>Default</tt> is returned. Otherwise, SuppressibleMsgBox acts the same as the regular <link topic="isxfunc_MsgBox">MsgBox</link>.</p></description>
  3068. </function>
  3069. <function>
  3070. <name>TaskDialogMsgBox</name>
  3071. <prototype>function TaskDialogMsgBox(const Instruction, Text: String; const Typ: TMsgBoxType; const Buttons: Cardinal; const ButtonLabels: TArrayOfString; const ShieldButton: Integer): Integer;</prototype>
  3072. <description><p>Displays a message box using a task dialog:<br />
  3073. <tt>Instruction</tt> specifies the instruction to display.<br />
  3074. <tt>Text</tt> specifies the message to display.<br />
  3075. <tt>Typ</tt> specifies which icon to display in the task dialog. If set to <tt>mbConfirmation</tt>, no icon will be displayed.<br />
  3076. <tt>Buttons</tt> specifies which buttons to include in the task dialog.<br />
  3077. <tt>ButtonLabels</tt> specifies which custom button labels to use. If set to an empty array, the system's default button labels will be used. If a label consists of two strings separated by a newline, then the first string specifies the button label and the second string specifies the button note. If <tt>Buttons</tt> is set to <tt>MB_OKCANCEL</tt>, <tt>MB_YESNOCANCEL</tt>, or <tt>MB_RETRYCANCEL</tt>, specifying a label for the Cancel button as the last element in the array is optional.<br />
  3078. <tt>ShieldButton</tt> specifies which button to display a shield icon on. If set to 0, no shield icon will be displayed.</p>
  3079. <p>Returns an ID* constant indicating the button the user clicked, or 0 if the function fails (which shouldn't happen unless an invalid parameter is specified or system resources are exhausted).</p></description>
  3080. <remarks><p>TMsgBoxType is defined as:</p>
  3081. <p><tt>TMsgBoxType = (mbInformation, mbConfirmation, mbError, mbCriticalError);</tt></p>
  3082. <p>Supported values for <tt>Buttons</tt> are:</p>
  3083. <p><tt>MB_OK, MB_OKCANCEL, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_ABORTRETRYIGNORE</tt></p>
  3084. <p>If <tt>MB_ABORTRETRYIGNORE</tt> is used, <tt>ButtonLabels</tt> may not be an empty array and the button labels must be specified in the following special order: Retry, Ignore, Abort.</p>
  3085. <p>Supported values for <tt>ShieldButton</tt> and possible return values are:</p>
  3086. <p><tt>IDOK, IDCANCEL, IDRETRY, IDYES, IDNO, IDABORT, IDIGNORE</tt></p></remarks>
  3087. <example><pre>begin
  3088. case TaskDialogMsgBox('Choose A or B',
  3089. 'You can choose A or B.',
  3090. mbInformation,
  3091. MB_YESNOCANCEL, ['I choose &amp;A'#13#10'A will be chosen.', 'I choose &amp;B'#13#10'B will be chosen.'],
  3092. IDYES) of
  3093. IDYES: MsgBox('You chose A.', mbInformation, MB_OK);
  3094. IDNO: MsgBox('You chose B.', mbInformation, MB_OK);
  3095. end;
  3096. end;</pre></example>
  3097. <seealso><p><link topic="isxfunc_SuppressibleTaskDialogMsgBox">SuppressibleTaskDialogMsgBox</link><br />
  3098. <link topic="isxfunc_MsgBox">MsgBox</link></p></seealso>
  3099. </function>
  3100. <function>
  3101. <name>SuppressibleTaskDialogMsgBox</name>
  3102. <prototype>function SuppressibleTaskDialogMsgBox(const Instruction, Text: String; const Typ: TMsgBoxType; const Buttons: Cardinal; const ButtonLabels: TArrayOfString; const ShieldButton: Integer; const Default: Integer): Integer;</prototype>
  3103. <description><p>Displays a suppressible message box using a task dialog. If message boxes are being suppressed (see <link topic="setupcmdline" window="main">Setup Command Line Parameters</link>), <tt>Default</tt> is returned. Otherwise, SuppressibleTaskDialogMsgBox acts the same as the regular <link topic="isxfunc_TaskDialogMsgBox">TaskDialogMsgBox</link>.</p></description>
  3104. </function>
  3105. <function>
  3106. <name>GetOpenFileName</name>
  3107. <prototype>function GetOpenFileName(const Prompt: String; var FileName: String; const InitialDirectory, Filter, DefaultExtension: String): Boolean;</prototype>
  3108. <description><p>Displays a dialog box that enables the user to select an existing file. Returns True if the user selected a file, False otherwise. The name of the selected file is returned in the FileName string.</p></description>
  3109. <remarks><p>An example Filter: 'Text files (*.txt)|*.txt|All files (*.*)|*.*'</p></remarks>
  3110. <example><pre>var
  3111. FileName: String;
  3112. begin
  3113. // Set the initial filename
  3114. FileName := '';
  3115. if GetOpenFileName('', FileName, '',
  3116. 'Text Documents (*.txt)|*.txt|All Files|*.*', 'txt') then
  3117. begin
  3118. // Successful; user clicked OK
  3119. // FileName contains the selected filename
  3120. end;
  3121. end;</pre></example>
  3122. </function>
  3123. <function>
  3124. <name>GetOpenFileNameMulti</name>
  3125. <prototype>function GetOpenFileNameMulti(const Prompt: String; var FileNameList: TStrings; const InitialDirectory, Filter, DefaultExtension: String): Boolean;</prototype>
  3126. <description><p>Displays a dialog box that enables the user to select one or more existing file(s). Returns True if the user selected a file, False otherwise. The name of the selected file(s) is returned in the FileNameList list.</p></description>
  3127. <remarks><p>An example Filter: 'Text files (*.txt)|*.txt|All files (*.*)|*.*'</p></remarks>
  3128. <example><pre>var
  3129. FileNameList: TStrings;
  3130. begin
  3131. // Create the list
  3132. FileNameList := TStringList.Create;
  3133. try
  3134. if GetOpenFileNameMulti('', FileNameList, '',
  3135. 'Text Documents (*.txt)|*.txt|All Files|*.*', 'txt') then
  3136. begin
  3137. // Successful; user clicked OK
  3138. // FileNameList contains the selected filename(s)
  3139. end;
  3140. finally
  3141. FileNameList.Free;
  3142. end;
  3143. end;</pre></example>
  3144. </function>
  3145. <function>
  3146. <name>GetSaveFileName</name>
  3147. <prototype>function GetSaveFileName(const Prompt: String; var FileName: String; const InitialDirectory, Filter, DefaultExtension: String): Boolean;</prototype>
  3148. <description><p>Displays a dialog box that enables the user to select a new file. Returns True if the user selected a file, False otherwise. The name of the selected file is returned in the FileName string.</p></description>
  3149. <remarks><p>An example Filter: 'Text files (*.txt)|*.txt|All files (*.*)|*.*'</p></remarks>
  3150. <example><pre>var
  3151. Filename: String;
  3152. begin
  3153. // Set the initial filename
  3154. Filename := '';
  3155. if GetSaveFileName('', Filename, '',
  3156. 'Text Documents (*.txt)|*.txt|All Files|*.*', 'txt') then
  3157. begin
  3158. // Successful; user clicked OK
  3159. // Filename contains the selected filename
  3160. end;
  3161. end;</pre></example>
  3162. </function>
  3163. <function>
  3164. <name>BrowseForFolder</name>
  3165. <prototype>function BrowseForFolder(const Prompt: String; var Directory: String; const NewFolderButton: Boolean): Boolean;</prototype>
  3166. <description><p>Displays a dialog box that enables the user to select a directory. The current value of Directory is used as the initially selected directory. If NewFolderButton is True, a <i>New Folder</i> button will be shown, allowing the user to create new folders. Returns True if the user selected a directory and clicked OK, False otherwise. The selected directory is returned in the Directory string.</p></description>
  3167. </function>
  3168. <function>
  3169. <name>ExitSetupMsgBox</name>
  3170. <prototype>function ExitSetupMsgBox: Boolean;</prototype>
  3171. <description><p>Displays the "Exit Setup?" message box, and returns True if the user selects Yes. Does not terminate Setup or Uninstall.</p></description>
  3172. </function>
  3173. <function>
  3174. <name>SelectDisk</name>
  3175. <prototype>function SelectDisk(const DiskNumber: Integer; const AFilename: String; var Path: String): Boolean;</prototype>
  3176. <description><p>Displays the "Setup Needs the Next Disk" message box, and returns True if the user enters a path containing the file specified by AFileName and selects OK. The selected path is returned in the Path string. The current value of Path is used as the initially selected path and DiskNumber is used only as information to the user.</p></description>
  3177. </function>
  3178. </subcategory>
  3179. </category>
  3180. <category>
  3181. <description>COM Automation objects support</description>
  3182. <subcategory>
  3183. <function>
  3184. <name>CreateOleObject</name>
  3185. <prototype>function CreateOleObject(const ClassName: String): Variant;</prototype>
  3186. <description><p>See the <link topic="scriptautomation" window="main">Using COM Automation objects</link> topic.</p></description>
  3187. </function>
  3188. <function>
  3189. <name>GetActiveOleObject</name>
  3190. <prototype>function GetActiveOleObject(const ClassName: String): Variant;</prototype>
  3191. <description><p>See the <link topic="scriptautomation" window="main">Using COM Automation objects</link> topic.</p></description>
  3192. </function>
  3193. <function>
  3194. <name>IDispatchInvoke</name>
  3195. <prototype>function IDispatchInvoke(Self: IDispatch; PropertySet: Boolean; const Name: String; Par: array of Variant): Variant;</prototype>
  3196. <description><p>Use <tt>IDispatchInvoke</tt> to access a COM Automation property or method whose name is a reserved word.</p></description>
  3197. <example><pre>var
  3198. AObject: Variant;
  3199. AType: String;
  3200. begin
  3201. AObject := CreateOleObject('MyObject');
  3202. // Set a property named 'Type'
  3203. // Cannot use "AObject.Type := 'MyType';" because Type is a reserved word
  3204. IDispatchInvoke(AObject, True, 'Type', ['MyType']);
  3205. // Get a property or call a method named 'Type'
  3206. AType := IDispatchInvoke(AObject, False, 'Type', ['']);
  3207. end;</pre></example>
  3208. <seealso><p><link topic="scriptautomation" window="main">Using COM Automation objects</link></p></seealso>
  3209. </function>
  3210. <function>
  3211. <name>CreateComObject</name>
  3212. <prototype>function CreateComObject(const ClassID: TGUID): IUnknown;</prototype>
  3213. <description><p>See the <link topic="scriptautomation" window="main">Using COM Automation objects</link> topic.</p></description>
  3214. </function>
  3215. <function>
  3216. <name>StringToGUID</name>
  3217. <prototype>function StringToGUID(const S: String): TGUID;</prototype>
  3218. <description><p>StringToGUID converts the string representation of a GUID into a 'real' GUID. An exception will be raised upon failure.</p></description>
  3219. <seealso><p><link topic="scriptautomation" window="main">Using COM Automation objects</link></p></seealso>
  3220. </function>
  3221. <function>
  3222. <name>OleCheck</name>
  3223. <prototype>procedure OleCheck(Result: HResult);</prototype>
  3224. <description><p>Use OleCheck to wrap any IUnknown based COM methods you call, so that if that method fails, an exception will be raised.</p>
  3225. <p>OleCheck is called automatically when the method declaration specifies the <tt>safecall</tt> calling convention.</p></description>
  3226. <seealso><p><link topic="scriptautomation" window="main">Using COM Automation objects</link></p></seealso>
  3227. </function>
  3228. <function>
  3229. <name>CoFreeUnusedLibraries</name>
  3230. <prototype>procedure CoFreeUnusedLibraries;</prototype>
  3231. <description><p>See the <link topic="scriptautomation" window="main">Using COM Automation objects</link> topic.</p></description>
  3232. </function>
  3233. </subcategory>
  3234. </category>
  3235. <category>
  3236. <description>Setup Logging</description>
  3237. <subcategory>
  3238. <function>
  3239. <name>Log</name>
  3240. <prototype>procedure Log(const S: String);</prototype>
  3241. <description><p>Logs the specified string in Setup's or Uninstall's log file and/or in the Compiler IDE's "Debug Output" view.</p></description>
  3242. <remarks><p>Calls to this function are ignored if logging is not enabled (via the <link topic="setupcmdline">/LOG</link> command line parameter or the <link topic="setup_setuplogging">SetupLogging</link> [Setup] section directive or the <link topic="setup_uninstalllogging">UninstallLogging</link> [Setup] section directive or debugging from the Compiler IDE).</p></remarks>
  3243. <seealso><p><link topic="isxfunc_LogFmt">LogFmt</link></p></seealso>
  3244. </function>
  3245. <function>
  3246. <name>LogFmt</name>
  3247. <prototype>procedure LogFmt(const S: String; const Args: array of const);</prototype>
  3248. <description><p>Formats the string S using the series of arguments in the open array Args, and then logs it.</p></description>
  3249. <example><pre>function OnDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;
  3250. begin
  3251. LogFmt('%s->%s: %d/%d', [Url, FileName, Progress, ProgressMax]);
  3252. Result := True;
  3253. end;</pre></example>
  3254. <seealso><p><link topic="isxfunc_Log">Log</link><br/>
  3255. <link topic="isxfunc_Format">Format</link></p></seealso>
  3256. </function>
  3257. </subcategory>
  3258. <subcategory>
  3259. <function>
  3260. <name>ExecAndCaptureOutput</name>
  3261. <prototype>function ExecAndCaptureOutput(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; var Output: TExecOutput): Boolean;</prototype>
  3262. <description><p>Identical to <link topic="isxfunc_Exec">Exec</link> except:</p>
  3263. <p>Program output from the stdout and stderr streams is captured. This is different from <link topic="isxfunc_ExecAndLogOutput">ExecAndLogOutput</link> which merges the streams.</p>
  3264. <p>Console programs are always hidden and the ShowCmd parameter only affects GUI programs, so always using <tt>SW_SHOWNORMAL</tt> instead of <tt>SW_HIDE</tt> is recommended.</p>
  3265. <p>An exception will be raised if there was an error setting up output redirection (which should be very rare).</p></description>
  3266. <remarks><p>Parameter <tt>Wait</tt> must always be set to <tt>ewWaitUntilTerminated</tt> when calling this function.</p>
  3267. <p>TExecOutput is defined as:</p>
  3268. <pre>
  3269. TExecOutput = record
  3270. StdOut: TArrayOfString;
  3271. StdErr: TArrayOfString;
  3272. Error: Boolean;
  3273. end;
  3274. </pre>
  3275. <p>Error will be True if there was an error reading the output (which should be very rare) or if the output is too big. The error is logged in Setup's or Uninstall's log file and/or in the Compiler IDE's "Debug Output" view. There is no further output after an error.</p>
  3276. <p>Output is limited to a total size of 10 million bytes or a maximum of 1 million lines.</p></remarks>
  3277. <example><pre>var
  3278. ResultCode: Integer;
  3279. Output: TExecOutput;
  3280. begin
  3281. try
  3282. // Get the system configuration
  3283. Result := ExecAndCaptureOutput(ExpandConstant('{cmd}'), '/c systeminfo', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode, Output);
  3284. except
  3285. Result := False;
  3286. Log(GetExceptionMessage);
  3287. end;
  3288. if Result then begin
  3289. // Do something with the Output.StdOut array of string
  3290. end;
  3291. end;</pre></example>
  3292. <seealso><p><link topic="isxfunc_Exec">Exec</link><br />
  3293. <link topic="isxfunc_ExecAndLogOutput">ExecAndLogOutput</link><br/>
  3294. <link topic="isxfunc_ExecAndCaptureOutputWithNativeSysDir">ExecAndCaptureOutputWithNativeSysDir</link></p></seealso>
  3295. </function>
  3296. <function>
  3297. <name>ExecAndLogOutput</name>
  3298. <prototype>function ExecAndLogOutput(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; const OnLog: TOnLog): Boolean;</prototype>
  3299. <description><p>Identical to <link topic="isxfunc_Exec">Exec</link> except:</p>
  3300. <p>Console programs are always hidden and the ShowCmd parameter only affects GUI programs, so always using <tt>SW_SHOWNORMAL</tt> instead of <tt>SW_HIDE</tt> is recommended.</p>
  3301. <p>If OnLog is set to <tt>nil</tt> then the output of the executed executable or batch file is logged in Setup's or Uninstall's log file and/or in the Compiler IDE's "Debug Output" view.</p>
  3302. <p>If OnLog is not set to <tt>nil</tt> then the output is sent to the specified function, line by line.</p>
  3303. <p>An exception will be raised if there was an error setting up output redirection (which should be very rare).</p></description>
  3304. <remarks><p>Parameter <tt>Wait</tt> must always be set to <tt>ewWaitUntilTerminated</tt> when calling this function.</p>
  3305. <p>TOnLog is defined as:</p>
  3306. <p><tt>TOnLog = procedure(const S: String; const Error, FirstLine: Boolean);</tt></p>
  3307. <p>Parameter S is the output line when Error is False, otherwise an error message. FirstLine is True if this is the first line of output from the program, otherwise False.</p>
  3308. <p>Error will be True if reading the output failed (which should be very rare), or if the output is too big. There is no further output after an error.</p>
  3309. <p>Output is limited to a total size of 10 million bytes or a maximum of 1 million lines.</p></remarks>
  3310. <example><pre>var
  3311. Line: String;
  3312. procedure ExecAndGetFirstLineLog(const S: String; const Error, FirstLine: Boolean);
  3313. begin
  3314. if not Error and (Line = '') and (Trim(S) &lt;&gt; '') then
  3315. Line := S; { First non-empty line found, store it }
  3316. if FirstLine then
  3317. Log('Output:');
  3318. Log(S);
  3319. end;
  3320. function ExecAndGetFirstLine(const Filename, Params, WorkingDir: String; var ResultCode: Integer): String;
  3321. begin
  3322. Line := '';
  3323. try
  3324. ExecAndLogOutput(Filename, Params, WorkingDir, SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode, @ExecAndGetFirstLineLog);
  3325. except
  3326. Log(GetExceptionMessage);
  3327. end;
  3328. Result := Line;
  3329. end;</pre></example>
  3330. <seealso><p><link topic="isxfunc_Exec">Exec</link><br />
  3331. <link topic="isxfunc_ExecAndCaptureOutput">ExecAndCaptureOutput</link><br/>
  3332. <link topic="isxfunc_ExecAndLogOutputWithNativeSysDir">ExecAndLogOutputWithNativeSysDir</link></p></seealso>
  3333. </function>
  3334. </subcategory>
  3335. <subcategory>
  3336. <function>
  3337. <name>ExecAndCaptureOutputWithNativeSysDir</name>
  3338. <prototype>function ExecAndCaptureOutputWithNativeSysDir(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; var Output: TExecOutput): Boolean;</prototype>
  3339. <description><p>Use this function instead of <link topic="isxfunc_ExecAndCaptureOutput">ExecAndCaptureOutput</link> to launch an executable located in the 64-bit System directory from a 32-bit installer.</p>
  3340. <p>This function avoids the problem that <tt>ExecAndCaptureOutput</tt> in a 32-bit installer can only launch such an executable using the Sysnative alias, while that alias is not available to 64-bit applications. To achieve this, the function temporarily disables WOW64 file system redirection.</p></description>
  3341. <remarks><p>On 32-bit Windows or in a 64-bit installer, this function is just an alias for <tt>ExecAndCaptureOutput</tt>.</p></remarks>
  3342. </function>
  3343. <function>
  3344. <name>ExecAndLogOutputWithNativeSysDir</name>
  3345. <prototype>function ExecAndLogOutputWithNativeSysDir(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; const OnLog: TOnLog): Boolean;</prototype>
  3346. <description><p>Use this function instead of <link topic="isxfunc_ExecAndLogOutput">ExecAndLogOutput</link> to launch an executable located in the 64-bit System directory from a 32-bit installer.</p>
  3347. <p>This function avoids the problem that <tt>ExecAndLogOutput</tt> in a 32-bit installer can only launch such an executable using the Sysnative alias, while that alias is not available to 64-bit applications. To achieve this, the function temporarily disables WOW64 file system redirection.</p></description>
  3348. <remarks><p>On 32-bit Windows or in a 64-bit installer, this function is just an alias for <tt>ExecAndLogOutput</tt>.</p></remarks>
  3349. </function>
  3350. </subcategory>
  3351. </category>
  3352. <category>
  3353. <description>Other</description>
  3354. <subcategory>
  3355. <function>
  3356. <name>Sleep</name>
  3357. <prototype>procedure Sleep(const Milliseconds: Cardinal);</prototype>
  3358. <description><p>Suspends the execution of Setup or Uninstall for a specified interval.</p></description>
  3359. </function>
  3360. <function>
  3361. <name>Random</name>
  3362. <prototype>function Random(const Range: Integer): Integer;</prototype>
  3363. <description><p>Returns a random number within the range 0 &lt;= X &lt; Range.</p></description>
  3364. </function>
  3365. <function>
  3366. <name>Beep</name>
  3367. <prototype>procedure Beep;</prototype>
  3368. <description><p>Beeps.</p></description>
  3369. <example><pre>Beep; //Beeps</pre></example>
  3370. </function>
  3371. </subcategory>
  3372. <subcategory>
  3373. <function>
  3374. <name>Round</name>
  3375. <prototype>function Round(const E: Extended): Int64;</prototype>
  3376. <description><p>Returns the value of E rounded to the integer number.</p></description>
  3377. <remarks><p>If E is exactly halfway between two integer numbers, the result is always the even number. This method of rounding is often called "Banker's rounding."</p></remarks>
  3378. </function>
  3379. <function>
  3380. <name>Trunc</name>
  3381. <prototype>function Trunc(const E: Extended): Int64;</prototype>
  3382. <description><p>Returns the truncated value of E; that is, E rounded toward zero, as an integer number.</p></description>
  3383. </function>
  3384. <function>
  3385. <name>Int</name>
  3386. <prototype>function Int(const E: Extended): Extended;</prototype>
  3387. <description><p>Returns the integer part of E; that is, E rounded toward zero.</p></description>
  3388. </function>
  3389. <function>
  3390. <name>MulDiv</name>
  3391. <prototype>function MulDiv(const Number, Numerator, Denominator: Integer): Integer;</prototype>
  3392. <description><p>Multiplies two 32-bit values (Number and Numerator) and then divides the 64-bit result by a third 32-bit value (Denominator). The final result is rounded to the nearest integer.</p></description>
  3393. <remarks><p>If the result is a positive half integer (ends in .5), it is rounded up. If the result is a negative half integer, it is rounded down.</p></remarks>
  3394. </function>
  3395. <function>
  3396. <name>Set8087CW</name>
  3397. <prototype>procedure Set8087CW(NewCW: Word);</prototype>
  3398. <description><p>Sets the FPU control word.</p></description>
  3399. <example><pre>Set8087CW($133f); //Disables all fpu exceptions }</pre></example>
  3400. </function>
  3401. <function>
  3402. <name>Get8087CW</name>
  3403. <prototype>function Get8087CW: Word;</prototype>
  3404. <description><p>Returns the current value of the FPU control word.</p></description>
  3405. </function>
  3406. </subcategory>
  3407. <subcategory>
  3408. <function>
  3409. <name>BringToFrontAndRestore</name>
  3410. <prototype>procedure BringToFrontAndRestore;</prototype>
  3411. <description><p>Makes sure that Setup or Uninstall is visible and the foreground window.</p></description>
  3412. </function>
  3413. </subcategory>
  3414. </category>
  3415. <category>
  3416. <description>Deprecated</description>
  3417. <subcategory>
  3418. <function>
  3419. <name>LoadDLL</name>
  3420. <prototype>function LoadDLL(const DLLName: String; var ErrorCode: Integer): HMODULE;</prototype>
  3421. <description><p>Loads the specified DLL. Returns the DLL handle if the DLL was loaded successfully, zero otherwise. If zero is returned then ErrorCode specifies the error that occurred. Use SysErrorMessage(ErrorCode) to get a description of the error.</p></description>
  3422. <remarks><p>This function is deprecated. See the <link topic="scriptdll" window="main">Using DLLs</link> topic.</p>
  3423. <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>
  3424. </function>
  3425. <function>
  3426. <name>CallDLLProc</name>
  3427. <prototype>function CallDLLProc(const DLLHandle: HMODULE; const ProcName: String; const Param1, Param2: NativeInt; var Result: NativeInt): Boolean;</prototype>
  3428. <description><p>Calls the specified function in a DLL specified using the DLL handle returned by LoadDLL. Returns True is the procedure was called successfully, False otherwise.<br />The function must use the standard calling convention, accept two 4 byte integer parameters and return a 4 byte integer result.</p></description>
  3429. <remarks><p>This function is deprecated. See the <link topic="scriptdll" window="main">Using DLLs</link> topic.</p></remarks>
  3430. </function>
  3431. <function>
  3432. <name>FreeDLL</name>
  3433. <prototype>function FreeDLL(const DLLHandle: HMODULE): Boolean;</prototype>
  3434. <description><p>Unloads a DLL specified using the DLL handle returned by LoadDLL.</p></description>
  3435. <remarks><p>This function is deprecated. See the <link topic="scriptdll" window="main">Using DLLs</link> topic.</p></remarks>
  3436. </function>
  3437. </subcategory>
  3438. <subcategory>
  3439. <function>
  3440. <name>CastStringToInteger</name>
  3441. <prototype>function CastStringToInteger(var S: String): LongInt;</prototype>
  3442. <description><p>Casts a string to an integer so that a string can be passed to a DLL using CallDllProc.</p></description>
  3443. <remarks><p>This function is deprecated. See the <link topic="scriptdll" window="main">Using DLLs</link> topic.</p></remarks>
  3444. </function>
  3445. <function>
  3446. <name>CastIntegerToString</name>
  3447. <prototype>function CastIntegerToString(const L: LongInt): String;</prototype>
  3448. <description><p>Casts an integer to a string so that a string can be received from a DLL using CallDllProc.</p></description>
  3449. <remarks><p>This function is deprecated. See the <link topic="scriptdll" window="main">Using DLLs</link> topic.</p></remarks>
  3450. </function>
  3451. </subcategory>
  3452. </category>
  3453. </isxfunc>
  3454. <isxenum>
  3455. <enum>
  3456. <description>Exec and ShellExec - ShowCmd values</description>
  3457. <values>SW_SHOW, SW_SHOWNORMAL, SW_SHOWMAXIMIZED, SW_SHOWMINIMIZED, SW_SHOWMINNOACTIVE, SW_HIDE</values>
  3458. </enum>
  3459. <enum>
  3460. <description>MsgBox - Buttons flags</description>
  3461. <values>MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_SETFOREGROUND</values>
  3462. </enum>
  3463. <enum>
  3464. <description>MsgBox - return values</description>
  3465. <values>IDOK, IDCANCEL, IDABORT, IDRETRY, IDIGNORE, IDYES, IDNO</values>
  3466. </enum>
  3467. <enum>
  3468. <description>Reg* - RootKey values (also see the <link topic="registrysection" window="main">[Registry]</link> section documentation)</description>
  3469. <values>HKEY_AUTO, HKEY_AUTO_32, HKEY_AUTO_64,<br />HKEY_CLASSES_ROOT, HKEY_CLASSES_ROOT_32, HKEY_CLASSES_ROOT_64,<br />HKEY_CURRENT_USER, HKEY_CURRENT_USER_32, HKEY_CURRENT_USER_64,<br />HKEY_LOCAL_MACHINE, HKEY_LOCAL_MACHINE_32, HKEY_LOCAL_MACHINE_64,<br />HKEY_USERS, HKEY_USERS_32, HKEY_USERS_64,<br />HKEY_PERFORMANCE_DATA,<br />HKEY_CURRENT_CONFIG, HKEY_CURRENT_CONFIG_32, HKEY_CURRENT_CONFIG_64,<br />HKEY_DYN_DATA,<br />HKA, HKA32, HKA64, HKCR, HKCR32, HKCR64, HKCU, HKCU32, HKCU64, HKLM, HKLM32, HKLM64, HKU, HKU32, HKU64, HKCC, HKCC32, HKCC64</values>
  3470. </enum>
  3471. </isxenum>
  3472. </isxhelp>