by Robert Dickau, Principal Technical Training Writer, Flexera Software
As important as properly designing your installer is designing your uninstaller. Most simple projects will not require much uninstaller customization. However, if you are installing multiple projects, using merge modules, or installing server applications, you may wish to add additional functionalityto your uninstaller.
This white paper describes how to build customized uninstallers to control the removal of products and features.
Learn More about InstallAnywhere
If you wish to learn more about the capabilities of InstallAnywhere and download a free evaluation, please visit the Flexera Software Web site at www.flexerasoftware.com/installanywhere
In InstallAnywhere, you can customize the uninstaller in the same way you can customize the installer. In particular, you use the Pre-Uninstall and Post-Uninstall tasks to modify the panels and actions performed during uninstallation.
Starting with InstallAnywhere 2009, you can set the variable $SKIP_UNINSTALL$ to true to prevent the Uninstall step from being performed.
The uninstaller is similar to the installer. It is a collection of panels, consoles, and actions. It keeps track of what the installer has done, and contains a record of every action run during install time. All Pre-Uninstall panels, actions, and consoles run first; then the uninstall functionality of actions in the Install task are called; and lastly the Post-Uninstall actions are run. In addition, the product information (product, feature, and component information) is removed from the InstallAnywhere registry.
Note: You can disable integration with the InstallAnywhere registry by deselecting the Do not update the product registry check box in the Project > Info task.
If your installer supports console mode, you should add console equivalents to the graphical panels displayed during uninstallation.
You can customize the appearance, location, and some of the behavior of the uninstaller using its customizer in the Install task.
By default, the uninstaller executable is called Uninstall_ ProductName, and is located in an Uninstall_ProductName subdirectory of the installation location $USER_INSTALL_ DIR$.
Each installer project has one uninstaller. All features are registered with the uninstaller through a local registry. If the Choose Feature panel is included in the uninstaller, the user will be offered the option to uninstall only certain features.
There are two options for controlling the behavior of a feature-level uninstall. The default behavior, illustrated in the following figure, is that installed features appear checked at uninstall time, and that clearing a feature’s check box causes it to be uninstalled.
In the settings for the Choose Features to Uninstall panel, you can specify to use the opposite behavior, that installed features are displayed un-selected, and selecting a feature causes it to be uninstalled.