Wise Installation Studio/Express Getting Started Guide
39
Advanced Tutorial: Using MSI Script in a Windows Installer Installation
To test the custom action:
1. Save the installation.
2. Compile the installation by clicking Compile at the lower right of the main window.
3. To run the installation, click the Run button, select Run from the button menu, and
when prompted, select QuickFacts.msi.
If QuickFacts is already installed, the Application Maintenance dialog box appears.
Mark Remove and click Next to uninstall it. Then run the QuickFacts.msi again.
Note
Avoid uninstalling by selecting one of the other options from the Run button, which
either uninstalls and then reinstalls, or forces a reinstall over an installed product.
4. In the installation wizard, click Next on all the dialog boxes, leaving the Put
installation under the Common Files folder check box cleared.
Because of the custom action you added earlier in this tutorial, a dialog box displays
the value of INSTALLDIR during installation. After installation, notice that the
QuickFacts directory is in the Program Files directory.
5. Now uninstall QuickFacts and run the installation again, this time marking the Put
installation under the Common Files folder check box.
When this installation is finished, the QuickFacts directory should appear in your
Common Files directory.
Call an .EXE With a Custom Action
In this section, you create a custom action that calls an .EXE and passes parameters to
it. This action calls Notepad.exe and passes the name of the QuickFacts readme file to it,
causing the readme file to be displayed during installation.
Before you perform this task, you must have created a custom action that calls a .DLL.
See
Call a .DLL With a Custom Action
on page 31.
To create a custom action that opens a file in the installation
1. Select MSI Script.
2. Make sure Normal Installation is selected in Installation Mode.
3. Click the Execute Deferred tab at the bottom of the Installation Sequence pane.
For this tutorial, you add the action to the Execute Deferred sequence immediately
after the InstallFiles action. This action must run in deferred mode because it relies
on an installed file (readme.txt), which is not present on the destination computer
until after the InstallFiles action runs in the Execute Deferred sequence.
4. Locate the InstallFiles action in the Execute Deferred script:
a. Press Ctrl+F to open the Find dialog box.
b. In the Find dialog box, enter InstallFiles in the Find What field and make sure
Normal Installation is selected in the In What drop-down list.
c.
Click Find Next.
d. Click Cancel after the InstallFiles action is found.