UninstallApplication

InstallShield 2024 » InstallScript Language Reference

Project: This information applies to InstallScript projects.

The UninstallApplication function launches the uninstallation that is specified by szUninstallKey.

Syntax

UninstallApplication ( szUninstallKey, szAdditionalCmdLine, nOptions );

Parameters

UninstallApplication Parameters

Parameter

Description

szUninstallKey

Specifies the name of a subkey under the target registry's <root key>\Software\Microsoft\Windows\CurrentVersion\Uninstall key; the function first checks for the subkey under the root key HKEY_CURRENT_USER, and if it does not find the subkey there, it checks under HKEY_LOCAL_MACHINE. For setups created with InstallShield Professional 5.53 or earlier, this is typically the name of the application; for setups created with InstallShield Professional 6.0 or later, this is the application's product GUID including the surrounding braces ({}). Do not enter the product GUID of the current setup.

szAdditionalCmdLine

Specifies any additional command line arguments that you want to pass to the uninstallation. You do not need to specify command line arguments that are already specified in szUninstallKey's UninstallString value's data.

nOptions

Specifies additional options. You can specify any option that is supported by LaunchApplication.

Return Values

UninstallApplication Return Values

Return Value

Description

>= ISERR_SUCCESS

Indicates that the function successfully launched the uninstallation.

< ISERR_SUCCESS

Indicates that the function was unable to launch the uninstallation.

You can obtain the error message text associated with a large negative return value—for example, -2147024891 (0x80070005)—by calling FormatMessage.