To perform an additional task during installation, you can use the Custom CheckBox component (page Interface \ Custom). The user will be able to select (or unselect) the checkbox, and depending on its state the setup program can execute some command (for example, copy additional files).
The state (checked or unchecked) of the component is stored in the variable <CheckBox>. If checked, this variable contains 1, otherwise 0.
To perform an action on its state, use System \ Commands.
Example #1: if the checkbox is checked, then launch file App.exe from the installation directory:
File: <SystemDir>\cmd.exe Parameters: /C IF /I <CheckBox>==1 "<InstallDir>\App.exe" Timing: After Installation Wait: Yes
Example #2: if the checkbox is checked, then copy file App.exe (from temp directory of the installation <SetupTempDir>) to the installation directory:
File: <SystemDir>\cmd.exe Parameters: /C IF /I <CheckBox>==1 (COPY /Y "<SetupTempDir>\App.exe" "<InstallDir>\App.exe") Timing: After Installation Wait: Yes Show: Hide
Example #3: if checked, then download a file to the installation directory. Downloader.exe must be included in <SetupTempDir>
File: <SystemDir>\cmd.exe Parameters: /C IF /I <CheckBox>==1 (<SetupTempDir>\Downloader.exe /S "http://www.MyWebSite.com/App.exe" /D "<InstallDir>\App.exe") Timing: After Installation Wait: Yes
It is also possible to set the default state for the checkbox depending the value from the Registry or INI file. To make it, add the variable <CheckBox> on the System \ Variables page. Specify the Registry Key and Value (or INI file key/section). In the Default Data field type 0. The checkbox will be checked, if the value is 0, or doesn't exist. Otherwise - unchecked. To inverse the state for the checkbox, add -inversecheckbox to Setup Parameters.
To make the checkbox disabled, add a parameter -disablecheckbox, or add variable <EnableCheckBox> on the System \ Variables page. The checkbox will be enabled, if the value is 0, or doesn't exist. Otherwise - disabled.
Also, use a parameter -discheckboxifchecked to disable the checkbox if it is checked.
Use this option to add a custom ComboBox - a drop-down list that allows the user to select one item from the list. Enter the name for the combobox in the Text field and items (one per line).
Variable <ComboBox> contains a text of selected item. Variable <ComboBoxIndex> contains an index number of the selected item (if the first item is selected, this variable contains 0, second item - 1, etc.).
Default index - sets default item index for the drop-down list. If not specified, the user must select it before installation. To make the first item selected, enter 0, second item - 1, etc.
Example: if second item is selected, then copy file File.exe (from temp directory of the installation <SetupTempDir>) to the installation directory:
File: <SystemDir>\cmd.exe Parameters: /C IF /I <ComboBoxIndex>==1 (COPY /Y "<SetupTempDir>\File.exe" "<InstallDir>\File.exe") Timing: After Installation Wait: No
It is also possible to set the default index for the ComboBox at setup startup. To make it, add the variable <ComboBoxIndex> on the System \ Variables page. Specify the Registry Key and Value (or INI file key/section). The Default field leave empty. If the value is 0, the first item will be selected, if 1 - second, etc.
To make the combobox disabled, add the variable <EnableComboBox> on the System \ Variables page. If registry value exists, the combobox will be disabled. if doesn't - enabled.
To allow the user to select multiple items, use the Select Components feature: