User Guide

501
Guidelines for Using Custom Actions
To Run Only During Uninstall
If the product is being uninstalled, the REMOVE property is set to All or ALL. To run a
custom action during uninstall only, set its condition to REMOVE~=”ALL. (The ~ causes
the comparison to be case-insensitive.)
Guidelines for Nested Installation Custom Actions
You can call another installation from within the running installation with an Install MSI
custom action. Use this type of custom action to deploy or uninstall one product from
within the installation of another product. See Nested Installation Actions in the
Windows Installer SDK Help.
Limitations
Nested installations are supported according to the Windows Installer specification.
While nested installations may sometimes be necessary, we do not recommend using
them because of the restrictions on their use. See a list of restrictions at the end of
Nested Installation Actions in the Windows Installer SDK help.
Usage
According to the Windows Installer SDK, Install MSI custom actions should be placed
between InstallInitialize and InstallFinalize of the main installation’s action sequence.
Install MSI custom actions must be set to run synchronously.
Example: Suppose your main installation, Main.MSI, has a button on a dialog that, if
clicked, installs Second.MSI. You can use an Install MSI custom action to run the second
.MSI. Then you can use another Install MSI custom action to provide for uninstallation if
the main installation is uninstalled.
To specify the circumstances in which a nested .MSI is called, set conditional If
Statements around the Install MSI custom action in the sequence. See Guidelines for
Custom Action Conditions on page 500.
Note
Getting a nested installation to install is straightforward, but getting it to uninstall properly
when the calling application is uninstalled requires that you add 2 custom actions. Set the first
custom action to call the nested installation, and set its condition to NOT Installed (Custom
Action Location dialog). Set the second custom action to call the nested installation also, set
its Property Settings field to REMOVE=ALL (Custom Action Target dialog), and set its
condition to REMOVE~=”All”.
With this type of custom action, you can call only Windows Installer installations. To call
an installation that was created with the Wise Installation System or WiseScript Editor,
use a Run WiseScript custom action. See WiseScript Editing Tools on page 494. To call
an installation that was created with any other installation technology, use an Execute
Program custom action type.
A nested installation file can be accessed from 3 different locations:
! It can be stored within the main installation file. See Install MSI From Installation on
page 522.
! It can be distributed along with the main installation file. See Install MSI From
Relative Path on page 523.
! It can be an installed or advertised application that already exists on the destination
computer. See Install MSI From Destination on page 521.