It’s always useful to know what mode an installation is being run in. Here are different ways to determine that based on InstallShield project type.
In Windows Installer–based projects, especially Basic MSI, the following conditions detect certain types of installation:
- Initial Installation: Not Installed
- Maintenance: Installed
- Uninstallation: REMOVE=”ALL” (make sure it’s used after the InstallValidate action)
These conditions also work in InstallScript MSI projects. However with those, most work is done from the script, not from custom actions.
In InstallScript-based projects, the MAINTENANCE variable is FALSE for an Initial installation and TRUE for Maintenance mode or Uninstallation.
Also, you can use the return value from the call to the MaintenanceType dialog to determine what the user selected, either Modify, Repair or Remove.