InstallAware for Windows Installer
 

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

  1. Make sure the dialog contains the control that you wish to extract information from.
  2. Double-click the desired control. The Define Interactive Characteristics dialog appears. Select the Object Behavior tab on this dialog.
  3. In the Control drop down menu, confirm the desired control is selected. Controls are listed on this drop down menu by their Name property accessible from the Object Properties window.
  4. If the control contains any meaningful information that can be passed back to the script, the Writes Values to Variable field will enable.
  5. Type in the Write Values to Variable field the name of the script variable that you wish to hold control information. This variable 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$.
  6. Be sure to click Close 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.

  1. Add a label to the dialog. Give the label a descriptive name.
  2. Set the visible property of the label to FALSE using the Object Properties window. Since this control is only used internally, we do no want the end user to see it.
  3. 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$.
  4. Use the caption property of this label in defining intra-dialog relations.

An example dialog box illustrating this concept is the finish dialog.