Readme.html 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>InstallOptions 2</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
  7. <style type="text/css">
  8. /*<![CDATA[*/body
  9. {
  10. padding: 10px;
  11. background-color: #F0F0F0;
  12. font-family: Verdana, Arial, Helvetica, sans-serif;
  13. font-size: 13px;
  14. font-weight: normal;
  15. text-align: left;
  16. }
  17. p, li
  18. {
  19. font-size: 13px;
  20. }
  21. .center
  22. {
  23. text-align: center;
  24. }
  25. table
  26. {
  27. margin: auto;
  28. font-size: 13px;
  29. background-color: #FFFFFF;
  30. }
  31. .maintable
  32. {
  33. border: 2px solid #376EAB;
  34. }
  35. .parameter
  36. {
  37. font-weight: bold;
  38. color: #6586AC;
  39. }
  40. h1
  41. {
  42. font-size: 30px;
  43. color: #333333;
  44. font-weight: normal;
  45. text-align: center;
  46. margin-top: 20px;
  47. }
  48. h2
  49. {
  50. font-size: 20px;
  51. color: #7A7272;
  52. font-weight: normal;
  53. }
  54. h3
  55. {
  56. font-size: 17px;
  57. font-weight: bold;
  58. color: #303030;
  59. }
  60. pre
  61. {
  62. font-size: 13px;
  63. }
  64. div
  65. {
  66. margin: 20px;
  67. }
  68. a:link, a:visited, a:active
  69. {
  70. color: #294F75;
  71. text-decoration: none;
  72. }
  73. a:hover
  74. {
  75. color: #182634;
  76. text-decoration: underline;
  77. }
  78. .subtable
  79. {
  80. border: 0px;
  81. margin-left: 20px;
  82. margin-right: 20px;
  83. }
  84. .lefttable
  85. {
  86. background-color: #CCCCCC;
  87. vertical-align: top;
  88. }
  89. .righttable
  90. {
  91. background-color: #EEEEEE;
  92. vertical-align: top;
  93. }
  94. /*]]>*/</style>
  95. </head>
  96. <body>
  97. <table width="750" class="maintable" cellspacing="0" cellpadding="0" align="center">
  98. <tr>
  99. <td>
  100. <h1>
  101. InstallOptions 2</h1>
  102. <div>
  103. <p>
  104. The InstallOptions plug-in is deprecated. For new scripts, it is recommended to
  105. use the new nsDialogs plug-in instead.</p>
  106. </div>
  107. <div>
  108. <h2>
  109. Introduction</h2>
  110. <div>
  111. <p>
  112. InstallOptions is an NSIS plugin which allows you to create custom pages for NSIS
  113. installers, to prompt the user for extra information.</p>
  114. <p>
  115. The dialogs created by InstallOptions are based on INI files which define the controls
  116. on the dialog and their properties. These INI files can be modified from the script
  117. to adjust the dialogs on runtime.</p>
  118. <p>
  119. The format of INI files is described in a <a href="http://en.wikipedia.org/wiki/Ini_file">
  120. Wikipedia article</a>.</p>
  121. </div>
  122. <h2>
  123. INI file structure</h2>
  124. <div>
  125. <p>
  126. The INI file has one required section. This section includes the number of controls
  127. to be created as well as general window attributes. The INI file also includes a
  128. variable number of Field sections which are used to create the controls to be displayed.</p>
  129. <p>
  130. The required section is named &quot;<em>Settings</em>&quot;. It can contain the
  131. following values:</p>
  132. <table class="subtable">
  133. <tr>
  134. <td class="lefttable">
  135. <strong>NumFields</strong></td>
  136. <td class="lefttable">
  137. <em>(required)</em></td>
  138. <td class="righttable">
  139. The number of control elements to be displayed on the dialog window.</td>
  140. </tr>
  141. <tr>
  142. <td class="lefttable">
  143. <strong>Title</strong></td>
  144. <td class="lefttable">
  145. <em>(optional)</em></td>
  146. <td class="righttable">
  147. If specified, gives the text to set the titlebar to. Otherwise, the titlebar text
  148. is not changed.</td>
  149. </tr>
  150. <tr>
  151. <td class="lefttable">
  152. <strong>CancelEnabled</strong></td>
  153. <td class="lefttable">
  154. <em>(optional)</em></td>
  155. <td class="righttable">
  156. If specified, overrides NSIS settings and enables or disables the cancel button.
  157. If set to 1, the cancel button will be enabled. If set to 0, the cancel button will
  158. be disabled.</td>
  159. </tr>
  160. <tr>
  161. <td class="lefttable">
  162. <strong>CancelShow</strong></td>
  163. <td class="lefttable">
  164. <em>(optional)</em></td>
  165. <td class="righttable">
  166. If specified, overrides NSIS settings and shows or hides the cancel button If set
  167. to 1, the cancel button will be shown. If set to 0, the cancel button will be hidden.</td>
  168. </tr>
  169. <tr>
  170. <td class="lefttable">
  171. <strong>BackEnabled</strong></td>
  172. <td class="lefttable">
  173. <em>(optional)</em></td>
  174. <td class="righttable">
  175. If specified, overrides NSIS settings and enables or disables the back button. If
  176. set to 1, the back button will be enabled. If set to 0, the back button will be
  177. disabled.</td>
  178. </tr>
  179. <tr>
  180. <td class="lefttable">
  181. <strong>CancelButtonText</strong></td>
  182. <td class="lefttable">
  183. <em>(optional)</em></td>
  184. <td class="righttable">
  185. Overrides the text for the cancel button. If not specified, the cancel button text
  186. will not be changed.</td>
  187. </tr>
  188. <tr>
  189. <td class="lefttable">
  190. <strong>NextButtonText</strong></td>
  191. <td class="lefttable">
  192. <em>(optional)</em></td>
  193. <td class="righttable">
  194. Overrides the text for the next button. If not specified, the next button text will
  195. not be changed.</td>
  196. </tr>
  197. <tr>
  198. <td class="lefttable">
  199. <strong>BackButtonText</strong></td>
  200. <td class="lefttable">
  201. <em>(optional)</em></td>
  202. <td class="righttable">
  203. Overrides the text for the back button. If not specified, the back button text will
  204. not be changed.</td>
  205. </tr>
  206. <tr>
  207. <td class="lefttable">
  208. <strong>Rect</strong></td>
  209. <td class="lefttable">
  210. <em>(optional)</em></td>
  211. <td class="righttable">
  212. Overrides the default rect ID to run over. This will make IO resize itself according
  213. to a different rect than NSIS's dialogs rect.</td>
  214. </tr>
  215. <tr>
  216. <td class="lefttable">
  217. <strong>RTL</strong></td>
  218. <td class="lefttable">
  219. <em>(optional)</em></td>
  220. <td class="righttable">
  221. If 1 is specified the dialog will be mirrored and all texts will be aligned to the
  222. right. The INSTALLOPTIONS_EXTRACT macros automatically set this field to the right
  223. value for the current installer language as given by the NSIS string $(^RTL).</td>
  224. </tr>
  225. <tr>
  226. <td class="lefttable">
  227. <strong>State</strong></td>
  228. <td class="lefttable">
  229. <em>(output)</em></td>
  230. <td class="righttable">
  231. This is not something you have to supply yourself but is set by InstallOptions,
  232. before calling your custom page validation function, to the field number of the
  233. custom Button control (or other control having the Notify flag) the user pressed,
  234. if any.</td>
  235. </tr>
  236. </table>
  237. <p>
  238. Each field section has the heading &quot;Field #&quot; where # must be sequential
  239. numbers from 1 to NumFields. Each Field section can contain the following values:</p>
  240. <table class="subtable">
  241. <tr>
  242. <td class="lefttable">
  243. <strong>Type</strong></td>
  244. <td class="lefttable">
  245. <em>(required)</em></td>
  246. <td class="righttable">
  247. Type of control to be created. Valid values are &quot;<em>Label</em>&quot;, &quot;<em>Text</em>&quot;,
  248. &quot;<em>Password</em>&quot;, &quot;<em>Combobox</em>&quot;, &quot;<em>DropList</em>&quot;,
  249. &quot;<em>Listbox</em>&quot;, &quot;<em>CheckBox</em>&quot;, &quot;<em>RadioButton</em>&quot;,
  250. &quot;<em>FileRequest</em>&quot;, &quot;<em>DirRequest</em>&quot; &quot;<em>Icon</em>&quot;,
  251. &quot;<em>Bitmap</em>&quot;, &quot;<em>GroupBox</em>&quot;, &quot;<em>HLine</em>&quot;,
  252. &quot;<em>VLine</em>&quot;, &quot;<em>Link</em>&quot; or &quot;<em>Button</em>&quot;.<br />
  253. <br />
  254. A &quot;<em>Label</em>&quot; is used to display static text. (i.e. a caption for
  255. a textbox)<br />
  256. A &quot;<em>Text</em>&quot; and &quot;<em>Password</em>&quot; accept text input
  257. from the user. &quot;<em>Password</em>&quot; masks the input with * characters.<br />
  258. A &quot;<em>Combobox</em>&quot; allows the user to type text not in the popup list,
  259. a &quot;<em>Droplist</em>&quot; only allows selection of items in the list.<br />
  260. A &quot;<em>Listbox</em>&quot; shows multiple items and can optionally allow the
  261. user to select more than one item.<br />
  262. A &quot;<em>CheckBox</em>&quot; control displays a check box with label.<br />
  263. A &quot;<em>RadioButton</em>&quot; control displays a radio button with label.<br />
  264. A &quot;<em>FileRequest</em>&quot; control displays a textbox and a browse button.
  265. Clicking the browse button will display a file requester where the user can browse
  266. for a file.<br />
  267. A &quot;<em>DirRequest</em>&quot; control displays a textbox and a browse button.
  268. Clicking the browse button will display a directory requester where the user can
  269. browse for a directory.<br />
  270. An &quot;<em>Icon</em>&quot; control displays an icon. Use no Text to use the installer
  271. icon.<br />
  272. A &quot;<em>Bitmap</em>&quot; control displays a bitmap.<br />
  273. A &quot;<em>GroupBox</em>&quot; control displays a frame to group controls.<br />
  274. A &quot;<em>HLine</em>&quot; control displays a horizontal line to separate controls.<br />
  275. A &quot;<em>VLine</em>&quot; control displays a vertical line to separate controls.<br />
  276. A &quot;<em>Link</em>&quot; control displays a static hot text. When the user clicks
  277. the control the contents of <strong>State</strong> (e.g. http://...) will be executed
  278. using ShellExecute. Alternatively <strong>State</strong> can be omitted and the
  279. <em>NOTIFY</em> flag used to have your NSIS script called. See the &quot;<em>NOTIFY</em>&quot;
  280. flag below for more information.<br />
  281. A &quot;<em>Button</em>&quot; control displays a push button that can be used in
  282. the same way as the &quot;<em>Link</em>&quot; control above.</td>
  283. </tr>
  284. <tr>
  285. <td class="lefttable">
  286. <strong>Text</strong></td>
  287. <td class="lefttable">
  288. <em>(optional)</em></td>
  289. <td class="righttable">
  290. Specifies the caption of a label, checkbox, or radio button control. For DirRequest
  291. control this specifies the title of the browse dialog. For icon and bitmaps control
  292. this specifies the path to the image.<br />
  293. <br />
  294. <strong>Note:</strong> For labels, \r\n will be converted to a newline. To use a
  295. back-slash in your text you have to escape it using another back-slash - \\. Described
  296. <a href="#escaping">below</a> are NSIS functions for converting text to/from this
  297. format.</td>
  298. </tr>
  299. <tr>
  300. <td class="lefttable">
  301. <strong>State</strong></td>
  302. <td class="lefttable">
  303. <em>(optional)</em></td>
  304. <td class="righttable">
  305. Specifies the state of the control. This is updated when the user closes the window,
  306. so you can read from it from NSIS. For edit texts and dir and file request boxes,
  307. this is the string that is specified. For radio button and check boxes, this can
  308. be '0' or '1' (for unchecked or checked). For list boxes, combo boxes and drop lists
  309. this is the selected items separated by pipes ('|'). For Links and Buttons this
  310. can specify something to be executed or opened (using ShellExecute).<br />
  311. <br />
  312. <strong>Note:</strong> For Text fields with the MULTILINE flag, \r\n will be converted
  313. to a newline. To use a back-slash in your text you have to escape it using another
  314. back-slash - \\. Described <a href="#escaping">below</a> are NSIS functions for
  315. converting text to/from this format.</td>
  316. </tr>
  317. <tr>
  318. <td class="lefttable">
  319. <strong>ListItems</strong></td>
  320. <td class="lefttable">
  321. <em>(optional)</em></td>
  322. <td class="righttable">
  323. A list of items to display in a combobox, droplist, or listbox.<br />
  324. This is a single line of text with each item separated by a pipe character '|'</td>
  325. </tr>
  326. <tr>
  327. <td class="lefttable">
  328. <strong>MaxLen</strong></td>
  329. <td class="lefttable">
  330. <em>(optional)</em></td>
  331. <td class="righttable">
  332. Causes validation on the selected control to limit the maximum length of text.<br />
  333. If the user specifies more text than this, a message box will appear when they click
  334. &quot;OK&quot; and the dialog will not be dismissed.<br />
  335. You should not use this on a &quot;<em>combobox</em>&quot; since the user can not
  336. control what is selected.<br />
  337. This should be set to a maximum of 260 for &quot;<em>FileRequest</em>&quot; and
  338. &quot;<em>DirRequest</em>&quot; controls.<br />
  339. Ignored on &quot;<em>Label</em>&quot; controls.</td>
  340. </tr>
  341. <tr>
  342. <td class="lefttable">
  343. <strong>MinLen</strong></td>
  344. <td class="lefttable">
  345. <em>(optional)</em></td>
  346. <td class="righttable">
  347. Causes validation on the selected control to force the user to enter a minimum amount
  348. of text.<br />
  349. If the user specifies less text than this, a message box will appear when they click
  350. &quot;OK&quot; and the dialog will not be dismissed.<br />
  351. Unlike MaxLen, this is useful for &quot;<em>Combobox</em>&quot; controls. By setting
  352. this to a value of &quot;1&quot; the program will force the user to select an item.<br />
  353. Ignored on &quot;<em>Label</em>&quot; controls.</td>
  354. </tr>
  355. <tr>
  356. <td class="lefttable">
  357. <strong>ValidateText</strong></td>
  358. <td class="lefttable">
  359. <em>(optional)</em></td>
  360. <td class="righttable">
  361. If the field fails the test for &quot;<em>MinLen</em>&quot; or &quot;<em>MaxLen</em>&quot;,
  362. a messagebox will be displayed with this text.<br />
  363. <br />
  364. <strong>Note:</strong> \r\n will be converted to a newline, two back-slashes will
  365. be converted to one - \\. Described <a href="#escaping">below</a> are NSIS functions
  366. for converting text to/from this format.</td>
  367. </tr>
  368. <tr>
  369. <td class="lefttable">
  370. <strong>Left<br />
  371. Right<br />
  372. Top<br />
  373. Bottom</strong></td>
  374. <td class="lefttable">
  375. <em>(required)</em></td>
  376. <td class="righttable">
  377. The position on the dialog where this control appears. All sizes should be set in
  378. dialog units. To get the right dimensions for your controls, design your dialog
  379. using a resource editor and copy the dimensions to the INI file.<br />
  380. <br />
  381. <strong>Note:</strong> You can specify negative coordinates to specify the distance
  382. from the right or bottom edge.<br />
  383. <br />
  384. <strong>Note (2):</strong> For combobox or droplist, the &quot;<em>bottom</em>&quot;
  385. value is not used in the same way.<br />
  386. In this case, the bottom value is the maximum size of the window when the pop-up
  387. list is being displayed. All other times, the combobox is automatically sized to
  388. be one element tall. If you have trouble where you can not see the combobox drop-down,
  389. then check the bottom value and ensure it is large enough. A rough guide for the
  390. height required is the number of items in the list multiplied by 8, plus 20.<br />
  391. <br />
  392. <strong>Note (3):</strong> FileRequest and DirRequest controls will allocate 15
  393. dialog units to the browse button. Make this control wide enough the contents of
  394. the textbox can be seen.</td>
  395. </tr>
  396. <tr>
  397. <td class="lefttable">
  398. <strong>Filter</strong></td>
  399. <td class="lefttable">
  400. <em>(optional)</em></td>
  401. <td class="righttable">
  402. Specifies the filter to be used in the &quot;<em>FileRequest</em>&quot; control.<br />
  403. This is constructed by putting pairs of entries together, each item separated by
  404. a | character.<br />
  405. The first value in each pair is the text to display for the filter.<br />
  406. The second value is the pattern to use to match files.<br />
  407. For example, you might specify:<br />
  408. Filter=Text Files|*.txt|Programs|*.exe;*.com|All Files|*.*<br />
  409. If not specified, then the filter defaults to All Files|*.*<br />
  410. <br />
  411. <strong>Note:</strong> you should not put any extra spaces around the | characters.</td>
  412. </tr>
  413. <tr>
  414. <td class="lefttable">
  415. <strong>Root</strong></td>
  416. <td class="lefttable">
  417. <em>(optional)</em></td>
  418. <td class="righttable">
  419. Used by <strong>DirRequest</strong> controls to specify the root directory of the
  420. search. By default, this allows the user to browse any directory on the computer.
  421. This will limit the search to a particular directory on the system.</td>
  422. </tr>
  423. <tr>
  424. <td class="lefttable">
  425. <strong>Flags</strong></td>
  426. <td class="lefttable">
  427. <em>(optional)</em></td>
  428. <td class="righttable">
  429. This specifies additional flags for the display of different controls. Each value
  430. should be separated by a | character, and you should be careful not to put any spaces
  431. around the | character.<br />
  432. <table class="righttable">
  433. <tr>
  434. <td class="righttable">
  435. <strong>Value</strong></td>
  436. <td class="righttable">
  437. <strong>Meaning</strong></td>
  438. </tr>
  439. <tr>
  440. <td class="righttable">
  441. REQ_SAVE</td>
  442. <td class="righttable">
  443. This causes &quot;<em>FileRequest</em>&quot; controls to display a Save As dialog.
  444. If not specified, an Open dialog is used.</td>
  445. </tr>
  446. <tr>
  447. <td class="righttable">
  448. FILE_MUST_EXIST</td>
  449. <td class="righttable">
  450. Used by &quot;<em>FileRequest</em>&quot; to determine if the selected file must
  451. exist.<br />
  452. This only applies if an &quot;Open&quot; dialog is being displayed.<br />
  453. This currently does not force the file to exist other than through the browse button.</td>
  454. </tr>
  455. <tr>
  456. <td class="righttable">
  457. FILE_EXPLORER</td>
  458. <td class="righttable">
  459. Used by &quot;<em>FileRequest</em>&quot;, enables new file request look (recommended)</td>
  460. </tr>
  461. <tr>
  462. <td class="righttable">
  463. FILE_HIDEREADONLY</td>
  464. <td class="righttable">
  465. Used by &quot;<em>FileRequest</em>&quot;, hides &quot;open read only&quot; checkbox
  466. in open dialog.</td>
  467. </tr>
  468. <tr>
  469. <td class="righttable">
  470. WARN_IF_EXIST</td>
  471. <td class="righttable">
  472. Used by &quot;<em>FileRequest</em>&quot; to display a warning message if the selected
  473. file already exists.<br />
  474. The warning message is only displayed for files selected with the browse button.</td>
  475. </tr>
  476. <tr>
  477. <td class="righttable">
  478. PATH_MUST_EXIST</td>
  479. <td class="righttable">
  480. Used by &quot;<em>FileRequest</em>&quot; to force the path to exist. Prevents the
  481. user from typing a non-existent path into the browse dialog window.<br />
  482. This only validates path's selected with the browse button.</td>
  483. </tr>
  484. <tr>
  485. <td class="righttable">
  486. PROMPT_CREATE</td>
  487. <td class="righttable">
  488. Used by &quot;<em>FileRequest</em>&quot; to display a warning if the selected file
  489. does not exist. However, it still allows the user to select the file.<br />
  490. This only displays the warning for files selected with the browse button.<br />
  491. Doesn't work along with REQ_SAVE.</td>
  492. </tr>
  493. <tr>
  494. <td class="righttable">
  495. RIGHT</td>
  496. <td class="righttable">
  497. Used by &quot;<em>Checkbox</em>&quot; and &quot;<em>Radiobutton</em>&quot; controls
  498. to specify you want the checkbox to the right of the text instead of the left as
  499. is the default.</td>
  500. </tr>
  501. <tr>
  502. <td class="righttable">
  503. MULTISELECT</td>
  504. <td class="righttable">
  505. Used by &quot;<em>Listbox</em>&quot; controls. Turns string selection on or off
  506. each time the user clicks or double-clicks a string in the list box. The user can
  507. select any number of strings. If this flag and EXTENDEDSELCT are not specified,
  508. only one item can be selected from the list.</td>
  509. </tr>
  510. <tr>
  511. <td class="righttable">
  512. EXTENDEDSELCT</td>
  513. <td class="righttable">
  514. Used by &quot;<em>Listbox</em>&quot; controls. Allows multiple items to be selected
  515. by using the SHIFT key and the mouse or special key combinations. If this flag and
  516. MULTISELECT are not specified, only one item can be selected from the list.</td>
  517. </tr>
  518. <tr>
  519. <td class="righttable">
  520. RESIZETOFIT</td>
  521. <td class="righttable">
  522. This causes &quot;<em>Bitmap</em>&quot; controls to resize the image to the size
  523. of the control. Also useful to support custom DPI settings. Without this, the image
  524. will be centered within the specified area.</td>
  525. </tr>
  526. <td class="righttable">
  527. TRANSPARENT</td>
  528. <td class="righttable">
  529. Used by &quot;<em>Bitmap</em>&quot; controls. Hides every pixel with the same color
  530. as of the top left pixel. This allows to see-through to controls behind it. This
  531. flag doesn't work well with a combination of the RESIZETOFIT flag and bitmaps with
  532. more than 256 colors.</td>
  533. </tr>
  534. <tr>
  535. <td class="righttable">
  536. GROUP</td>
  537. <td class="righttable">
  538. Add this flag to the first control of a group of controls to group them. Grouping
  539. controls allows you to create multiple groups of radio button and makes keyboard
  540. navigation using arrow keys easier.</td>
  541. </tr>
  542. <tr>
  543. <td class="righttable">
  544. FOCUS</td>
  545. <td class="righttable">
  546. Sets focus on the specified control, instead of the first focusable control. If
  547. more than one field is specified with this flag, only the first one will receive
  548. focus.</td>
  549. </tr>
  550. <tr>
  551. <td class="righttable">
  552. NOTABSTOP</td>
  553. <td class="righttable">
  554. Do not stop on the control when the user pressed the Tab key. Add NOTABSTOP to all
  555. controls of a group except the first one to allow navigation between groups with
  556. the Tab key.</td>
  557. </tr>
  558. <tr>
  559. <td class="righttable">
  560. DISABLED</td>
  561. <td class="righttable">
  562. Causes a control to be disabled.</td>
  563. </tr>
  564. <tr>
  565. <td class="righttable">
  566. ONLY_NUMBERS</td>
  567. <td class="righttable">
  568. Used by &quot;<em>Text</em>&quot; controls. Forces the user to enter only numbers
  569. into the edit box.</td>
  570. </tr>
  571. <tr>
  572. <td class="righttable">
  573. MULTILINE</td>
  574. <td class="righttable">
  575. Used by &quot;<em>Text</em>&quot; controls. Causes the control to accept multiple-lines.</td>
  576. </tr>
  577. <tr>
  578. <td class="righttable">
  579. WANTRETURN</td>
  580. <td class="righttable">
  581. Used by &quot;<em>Text</em>&quot; controls with multiple-line. Specifies that a
  582. carriage return be inserted when the user presses the ENTER key while entering text
  583. into the text box.</td>
  584. </tr>
  585. <tr>
  586. <td class="righttable">
  587. NOWORDWRAP</td>
  588. <td class="righttable">
  589. Used by &quot;<em>Text</em>&quot; controls with multiple-line. Disables the word-wrap
  590. that occurs when long lines are entered. Long lines instead scroll off to the side.
  591. Specifying the HSCROLL flag also has this effect.</td>
  592. </tr>
  593. <tr>
  594. <td class="righttable">
  595. HSCROLL</td>
  596. <td class="righttable">
  597. Show a horizontal scrollbar. When used by &quot;<em>Text</em>&quot; controls with
  598. multiple-lines this also disables word-wrap.</td>
  599. </tr>
  600. <tr>
  601. <td class="righttable">
  602. VSCROLL</td>
  603. <td class="righttable">
  604. Show a vertical scrollbar.</td>
  605. </tr>
  606. <tr>
  607. <td class="righttable">
  608. READONLY</td>
  609. <td class="righttable">
  610. Used by &quot;<em>Text</em>&quot; controls. Prevents the user from entering or editing
  611. text in the edit control, but allow the user to select and copy the text.</td>
  612. </tr>
  613. <tr>
  614. <td class="righttable">
  615. NOTIFY</td>
  616. <td class="righttable">
  617. Used by &quot;<em>Button</em>&quot;, &quot;<em>Link</em>&quot;, &quot;<em>CheckBox</em>&quot;,
  618. &quot;<em>RadioButton</em>&quot;, &quot;<em>ListBox</em>&quot; and &quot;<em>DropList</em>&quot;
  619. controls. Causes InstallOptions to call your NSIS custom page validation/leave function
  620. whenever the control's selection changes. Your validation/leave function can read
  621. the &quot;<em>State</em>&quot; value from the &quot;<em>Settings</em>&quot; section
  622. to determine which control caused the notification, if any, and perform some appropriate
  623. action followed by an Abort instruction (to tell NSIS to return to the page). The
  624. Examples\InstallOptions folder contains an example script showing how this might
  625. be used.</td>
  626. </tr>
  627. </table>
  628. </td>
  629. </tr>
  630. <tr>
  631. <td class="lefttable">
  632. <strong>TxtColor</strong></td>
  633. <td class="lefttable">
  634. <em>(optional)</em></td>
  635. <td class="righttable">
  636. Used by <strong>Link</strong> controls to specify the foreground color of the text.
  637. Format: 0xBBGGRR (hexadecimal).</td>
  638. </tr>
  639. <tr>
  640. <td class="lefttable">
  641. <strong>HWND<br>
  642. HWND2</strong></td>
  643. <td class="lefttable">
  644. <em>(output)</em></td>
  645. <td class="righttable">
  646. After initDialog returns, this will contain the HWND of the control created by this
  647. field. It can be used instead of FindWindow and GetDlgItem. HWND2 contains the HWND
  648. of an additional control, such as the browse button.</td>
  649. </tr>
  650. </table>
  651. </div>
  652. <h2>
  653. Header file</h2>
  654. <div>
  655. <p>
  656. The InstallOptions header files provides macros and functions to easily create custom
  657. dialogs. You can include it on the top of your script as follows:
  658. <pre>
  659. !include InstallOptions.nsh
  660. </pre>
  661. </div>
  662. <h2>
  663. Creating dialogs</h2>
  664. <div>
  665. <h3>
  666. Extracting the INI file</h3>
  667. <div>
  668. <p>
  669. First, you have to extract your InstallOptions INI files in the .onInit function
  670. (or un.onInit for the uninstaller) using the INSTALLOPTIONS_EXTRACT macro. The files
  671. will be extracted to a temporary folder (the NSIS plug-ins folder) that is automatically
  672. created.</p>
  673. <pre>
  674. Function .onInit
  675. !insertmacro INSTALLOPTIONS_EXTRACT &quot;ioFile.ini&quot;
  676. FunctionEnd
  677. </pre>
  678. <p>
  679. If the INI file is located in another directory, use INSTALLOPTIONS_EXTRACT_AS.
  680. The second parameter is the filename in the temporary folder, which is the filename
  681. that should be used as input for the other macros.</p>
  682. <pre>
  683. Function .onInit
  684. !insertmacro INSTALLOPTIONS_EXTRACT_AS &quot;..\ioFile.ini&quot; &quot;ioFile.ini&quot;
  685. FunctionEnd
  686. </pre>
  687. </div>
  688. <h3>
  689. Displaying the dialog</h3>
  690. <div>
  691. <p>
  692. You can call InstallOptions in a page function defined with the Page or UninstPage
  693. command. Check the NSIS documentation (Scripting Reference -&gt; Pages) for information
  694. about the page system.</p>
  695. <pre>
  696. Page custom CustomPageFunction</pre>
  697. <p>
  698. To display the dialog, use the INSTALLOPTIONS_DISPLAY macro:<pre>
  699. Function CustomPageFunction ;Function name defined with Page command
  700. !insertmacro INSTALLOPTIONS_DISPLAY &quot;ioFile.ini&quot;
  701. FunctionEnd
  702. </pre>
  703. </div>
  704. </div>
  705. <h2>
  706. User input</h2>
  707. <div>
  708. <p>
  709. To get the input of the user, read the State value of a Field using the INSTALLOPTIONS_READ
  710. macro:</p>
  711. <pre>
  712. !insertmacro INSTALLOPTIONS_READ $VAR &quot;ioFile.ini&quot; &quot;Field #&quot; &quot;Name&quot;
  713. </pre>
  714. </div>
  715. <h2>
  716. Writing to INI files</h2>
  717. <div>
  718. <p>
  719. The INSTALLOPTIONS_WRITE macro allows you to write values to the INI file to change
  720. texts or control settings on runtime:
  721. <pre>
  722. !insertmacro INSTALLOPTIONS_WRITE &quot;ioFile.ini&quot; &quot;Field #&quot; &quot;Name&quot; &quot;Value&quot;
  723. </pre>
  724. </div>
  725. <h2>
  726. Escaped values</h2>
  727. <div>
  728. <p>
  729. Some InstallOptions values are escaped (in a similar manner to &quot;C&quot; strings)
  730. to allow characters to be used that are not normally valid in INI file values. The
  731. affected values are:</p>
  732. <ul>
  733. <li>The ValidateText field</li>
  734. <li>The Text value of Label fields</li>
  735. <li>The State value of Text fields that have the MULTILINE flag</li>
  736. </ul>
  737. <p>
  738. The escape character is the back-slash character (&quot;\&quot;) and the available
  739. escape sequences are:</p>
  740. <table class="subtable">
  741. <tr>
  742. <td class="lefttable">
  743. &quot;\\&quot;</td>
  744. <td class="righttable">
  745. Back-slash</td>
  746. </tr>
  747. <tr>
  748. <td class="lefttable">
  749. &quot;\r&quot;</td>
  750. <td class="righttable">
  751. Carriage return (ASCII 13)</td>
  752. </tr>
  753. <tr>
  754. <td class="lefttable">
  755. &quot;\n&quot;</td>
  756. <td class="righttable">
  757. Line feed (ASCII 10)</td>
  758. </tr>
  759. <tr>
  760. <td class="lefttable">
  761. &quot;\t&quot;</td>
  762. <td class="righttable">
  763. Tab (ASCII 9)</td>
  764. </tr>
  765. </table>
  766. <p>
  767. The INSTALLOPTIONS_READ_CONVERT and INSTALLOPTIONS_WRITE_CONVERT macros automatically
  768. convert these characters in installer code. In uninstaller code, use INSTALLOPTIONS_READ_UNCONVERT
  769. and INSTALLOPTIONS_WRITE_UNCONVERT.</p>
  770. <p>
  771. To use these macros in your script, the conversion functions need to be included:</p>
  772. <pre>
  773. ;For INSTALLOPTIONS_READ_CONVERT
  774. !insertmacro INSTALLOPTIONS_FUNCTION_READ_CONVERT
  775. ;For INSTALLOPTIONS_WRITE_CONVERT
  776. !insertmacro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT
  777. ;For INSTALLOPTIONS_READ_UNCONVERT
  778. !insertmacro INSTALLOPTIONS_UNFUNCTION_READ_CONVERT
  779. ;For INSTALLOPTIONS_WRITE_UNCONVERT
  780. !insertmacro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT
  781. </pre>
  782. </div>
  783. <h2>
  784. Input validation</h2>
  785. <div>
  786. <p>
  787. To validate the user input (for example, to check whether the user has filled in
  788. a textbox) use the leave function of the Page command and Abort when the validation
  789. has failed:</p>
  790. <pre>
  791. Function ValidateCustom
  792. !insertmacro INSTALLOPTIONS_READ $R0 "test.ini" "Field 1" "State"
  793. StrCmp $R0 "" 0 +3
  794. MessageBox MB_ICONEXCLAMATION|MB_OK "Please enter your name."
  795. Abort
  796. FunctionEnd
  797. </pre>
  798. </div>
  799. <h2>
  800. Return value</h2>
  801. <div>
  802. After a dialog is created (using display or show), a return value is available:</p>
  803. <ul>
  804. <li>success - The user has pressed the Next button</li>
  805. <li>back - The user has pressed the Back button</li>
  806. <li>cancel - The user has pressed the Cancel button</li>
  807. <li>error - An error has occurred, the dialog cannot be displayed.</li>
  808. </ul>
  809. <p>
  810. You only have to check this value if you need something really special, such as
  811. doing something when the user pressed the Back button.</p>
  812. <p>
  813. If you need the return value, use the INSTALLOPTIONS_DISPLAY_RETURN or INSTALLOPTIONS_SHOW_RETURN
  814. macro. The return value will be added to the stack, so you can use the Pop command
  815. to get it.</p>
  816. </div>
  817. <h2>
  818. Reserve files</h2>
  819. <div>
  820. <p>
  821. When using solid compression, it's important that files which are being extracted
  822. in user interface functions are located before other files in the data block. Otherwise
  823. there may be a delay before a page can be displayed.</p>
  824. <p>
  825. To ensure that this is the case, add ReserveFile commands for InstallOptions and
  826. the INI files before all sections and functions:</p>
  827. <pre>
  828. ReserveFile &quot;test.ini&quot;
  829. ReserveFile /plugin InstallOptions.dll
  830. </pre>
  831. </div>
  832. <h2>
  833. Fonts and colors</h2>
  834. <div>
  835. <p>
  836. To customize fonts or colors on InstallOptions dialogs, the INSTALLOPTIONS_INITDIALOG
  837. and INSTALLOPTIONS_SHOW macro can be used.</p>
  838. <p>
  839. INSTALLOPTIONS_INITDIALOG creates the dialog in memory, but does not show it. After
  840. inserting this macro, you can set the fonts and colors, and then insert INSTALLOPTIONS_SHOW
  841. to show the dialog.</p>
  842. <p>
  843. The INSTALLOPTIONS_INITDIALOG macro also pushes the HWND of the custom dialog to
  844. the stack. Control HWND's are available for each control in the HWND entry of the
  845. corresponding field in the INI file.</p>
  846. <p>
  847. Example of using a custom font:</p>
  848. <pre>
  849. Var HWND
  850. Var DLGITEM
  851. Var FONT
  852. Function FunctionName ;FunctionName defined with Page command
  853. !insertmacro INSTALLOPTIONS_INITDIALOG &quot;ioFile.ini&quot;
  854. Pop $HWND ;HWND of dialog
  855. !insertmacro INSTALLOPTIONS_READ $DLGITEM &quot;ioFile.ini&quot; &quot;Field 1&quot; &quot;HWND&quot;
  856. ;$DLGITEM contains the HWND of the first field
  857. CreateFont $FONT &quot;Tahoma&quot; 10 700
  858. SendMessage $DLGITEM ${WM_SETFONT} $FONT 0
  859. !insertmacro INSTALLOPTIONS_SHOW
  860. FunctionEnd
  861. </pre>
  862. </div>
  863. <h2>
  864. Credits</h2>
  865. <div>
  866. <p>
  867. Original version by Michael Bishop<br />
  868. DLL version by Nullsoft, Inc.<br />
  869. DLL version 2 by Amir Szekely, ORTIM, Joost Verburg<br />
  870. New documentation by Joost Verburg</p>
  871. </div>
  872. <h2>
  873. License</h2>
  874. <div>
  875. <pre>
  876. Original version Copyright &copy; 2001 Michael Bishop
  877. DLL version 1 Copyright &copy; 2001-2002 Nullsoft, Inc., ORTIM
  878. DLL version 2 Copyright &copy; 2003-2017 Amir Szekely, Joost Verburg, Dave Laundon
  879. This software is provided 'as-is', without any express or implied
  880. warranty. In no event will the authors be held liable for any damages
  881. arising from the use of this software.
  882. Permission is granted to anyone to use this software for any purpose,
  883. including commercial applications, and to alter it and redistribute
  884. it freely, subject to the following restrictions:
  885. 1. The origin of this software must not be misrepresented;
  886. you must not claim that you wrote the original software.
  887. If you use this software in a product, an acknowledgment in the
  888. product documentation would be appreciated but is not required.
  889. 2. Altered versions must be plainly marked as such,
  890. and must not be misrepresented as being the original software.
  891. 3. This notice may not be removed or altered from any distribution.
  892. </pre>
  893. </div>
  894. </div> </td> </tr> </table>
  895. </body>
  896. </html>