Passing Variables
InstallAware makes it very easy to connect variables used in the setup script to dialog elements. This makes extracting information the user entered into the setup dialogs a trivial task.
Passing Values from Dialogs to the Script
- Make sure the dialog contains the control that you wish to extract information from.
- Double-click the desired control. The dialog appears. Select the tab on this dialog.
- In the drop down menu, confirm the desired control is selected. Controls are listed on this drop down menu by their Name property accessible from the window.
- If the control contains any meaningful information that can be passed back to the script, the field will enable.
- Type in the must already be defined in your setup script before the dialog is shown. Do not use dollar signs surrounding the variable while you are entering its name here. For instance, if your variable is called MYVAR, input MYVAR into this field. Do not input $MYVAR$. field the name of the script variable that you wish to hold control information. This variable
- Be sure to click on the dialog to finalize your changes, and save your dialog in the main editor.
An example dialog box illustrating this concept is the setup type dialog.
Passing Values from the Script to Dialogs
While under most circumstances the above procedure will establish a two-way link between the control and the script variable in question, you may want to explicitly obtain the value of a variable, and assign it to a dialog control as a property. You may then use this property in controlling the state of other dialog controls.
- Add a label to the dialog. Give the label a descriptive name.
- Set the visible property of the label to FALSE using the window. Since this control is only used internally, we do no want the end user to see it.
- Set the caption property of the label to the dereferenced variable. For instance, if the script variable you wish to capture is called MYVAR, set the caption to $MYVAR$.
- Use the caption property of this label in defining intra-dialog relations.
An example dialog box illustrating this concept is the finish dialog.