| Reference information | |
|---|---|
| Project page | Action Sequences, Installer Dialogs |
| Related topics | Working with attribute panes |
The Uninstall Program action checks for the presence of a registered uninstaller for any program, and optionally runs the uninstaller or fails the installation. You can use this action to uninstall the previous version of your product or related products, or to detect the presence of a conflicting product and prevent installation of your product.
Uninstaller detection searches the Software\Microsoft\Windows\CurrentVersion\Uninstall registry keys under HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER, in that order. If the desired installer is found and must be executed, Tarma Installer first tries to use the QuietUninstallString command line; if that is not defined, it will use UninstallString instead.
Windows Installer does not have an equivalent for this action.
For synchronous actions (see Time out below), the installer stores the uninstaller's exit code in the LastExitCode variable; you can use this variable in the conditions of subsequent actions. The exit code is one of the following:
For asynchronous actions, LastExitCode is set to 0 if the uninstaller was started successfully, or to a nonzero Windows error code if an error occurred while starting the program.
Note: LastExitCode is overwritten by the next action that runs an external program (including Run Script, Run DLL, Run Program, and Uninstall Product).
This pane contains the following attributes and options.
| Attribute | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Action name | Enter the name of the action. This name is only used in Tarma ExpertInstall and is not visible to the user. | ||||||||||
| Description | Enter the localizable description of the action. This description is displayed in progress messages in the installer while the action is executing. | ||||||||||
| Uninstall type |
Select the uninstallation type from the drop-down list. The following choices are available:
Uninstallation behavior differs depending on the installer's TsuQuiet level:
|
||||||||||
| Uninstall key |
Enter the uninstaller registry key name for the product that must be uninstalled. This is the registry key under Software\Microsoft\Windows\CurrentVersion\Uninstall that contains the uninstallation information for the product that you want to uninstall. Tip: To uninstall a previous version of the current product, enter <ProductCode> in this field. |
||||||||||
| Arguments |
Enter additional arguments for the uninstaller, if any. Be sure to enclose any arguments that contain (or might expand to contain) spaces in quotes, for example "argument with spaces" or "<INSTALLDIR>". Any arguments that you enter in this field are added to the existing uninstaller arguments taken from QuietUninstallString or UninstallString. This field is meant in particular to provide the correct arguments for a quiet uninstallation; in fact, if you provide any arguments in this field, Tarma Installer assumes that the uninstaller will be able to run in silent mode (see Uninstall type above). Tip: You do not have to specify additional "silent mode" arguments for the following uninstallers:
|
||||||||||
| Condition |
Enter the conditional expression that determines if the action will be executed, or leave empty for unconditional execution. Important: If you use the Uninstall Product action to uninstall a previous version of the current product, then you should set Condition to NOT Installed. This ensures that the uninstallation only takes place during the first installation of the new version and not each time the installer runs for a "Change" or "Repair" installation. |
||||||||||
| Platforms... |
Click this button to open the Select Installation Platforms dialog box that allows you to select the Windows versions on which the action must be executed. This platform selection acts as an additional condition for the action. |
||||||||||
| Execute |
Select the action's execution mode from the drop-down list. The following choices are available:
|
||||||||||
| Show |
Select the desired visibility of the uninstaller from the drop-down list. The following choices are available:
Note: If the uninstaller runs in silent mode, this option may or may not have effect, depending on the uninstaller's implementation. |
||||||||||
| Process 2 |
Enter the name of a secondary process to wait for, or leave empty to wait only for the uninstaller process. This option only has effect if Time out is checked. It is useful if the uninstaller starts a secondary program that must complete before the installer continues. |
||||||||||
| Exit code |
Select the exit code handling from the drop-down list. The following choices are available:
The effectiveness of this option depends on the way the uninstaller is programmed. It is customary that successful completion of a program is indicated by an exit code of zero, and failure by a nonzero exit code. (This is how Tarma Installer uninstallers behave, for example.) However, not all programs comply with this convention. Furthermore, the Uninstall Product action itself may set a nonzero exit code if it cannot start the uninstaller or if the time-out period expires before the uninstaller terminates (see Exit codes earlier in this topic). Before you use the Exit code option, we recommend that you convince yourself that the uninstaller in question returns an appropriate exit code. If you want to use the uninstaller's exit code to terminate the installation or control the execution of subsequent actions, we suggest that you set the Exit code option to Ignore and use one of the following alternative approaches:
|
||||||||||
| Time out |
Check this box and enter the time-out period in seconds to execute the action synchronously; clear it to execute the action asynchronously. If the action is executed synchronously, the installer will wait for it to complete; for an asynchronous action, the installer starts the action and then immediately continues. Note: If the time-out period expires before the uninstaller terminates, the installer continues with its next action. However, the uninstaller itself is not terminated; it will remain active in the background until it terminates of itself or is forcefully terminated by the user or the system. |
||||||||||
| Not silent |
Check this box to skip the action if the installer is running in silent mode (/q command line option; TsuQuiet > 0); clear it to run the action in all modes. |
||||||||||
| Query uninstall |
Check this box to ask the user for permission before uninstalling the product; clear it to perform the uninstallation without confirmation. This option is ignored if the installer is running in silent mode (/q command line option; TsuQuiet > 0). If checked, the installer will display Localized String #00268 as the confirmation prompt. If the user declines the uninstallation, the installation fails. |