Wise Installation Studio/Express Getting Started Guide
37
Advanced Tutorial: Using MSI Script in a Windows Installer Installation
8. If necessary, drag the check box so it is aligned with other controls on the dialog
box.
In the next procedure, you create a custom action that tests the value of the
COMMONDIR property during installation. If COMMONDIR is true (which means that the
check box is marked), the custom action resets the value of the installation directory
(INSTALLDIR) so that it is placed in the Common Files directory.
To add a custom action that defines INSTALLDIR based on user input
1. Select MSI Script.
2. Make sure Normal Installation is selected in the Installation Mode drop-down
list.
3. Click the User Interface tab at the bottom of the Installation Sequence pane.
For this tutorial, you add the action to the User Interface sequence immediately
after the Welcome_Dialog If block. The Welcome_Dialog action contains all the
dialog boxes that the end user sees during installation. The User Interface sequence
gathers end user input and sets installation properties.
4. Scroll to near the end of the script and select the “If Installed AND (RESUME OR
Preselected) AND NOT PATCH then” statement. You will place a new If block above
this line.
5. In the Actions list, double-click Set Directory.
The Set Directory dialog box appears.
6. Click the Details tab and complete the dialog box:
Custom Action Name
Enter: ChangeDirectory
Directory
Browse to the QuickFacts directory, which is the installation directory
represented by the INSTALLDIR property. Click OK.
INSTALLDIR appears in the Directory field.
If the end user marks the Put installation under the Common Files folder
check box during installation, this is the directory whose location is redefined.
Directory Value
Enter (case-sensitive):
[CommonFilesFolder]QuickFacts
This will be the new location of the installation directory if the end user marks
the check box during installation. CommonFilesFolder is a directory property
that represents the Common Files directory on the destination computer.
7. Leave the defaults on the Properties tab. The dialog box should look like this: