Creating Uninstallation Shortcuts for InstallScript and InstallScript MSI Projects

InstallShield 2024

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

Note:You may not want to create an uninstallation shortcut. An uninstallation shortcut is unnecessary because your application’s uninstaller is in Add or Remove Programs.

You can create an uninstallation shortcut to make it easier for end users to uninstall your product from their systems. When end users launch the shortcut, the uninstallation process automatically starts.

The following InstallScript code creates a shortcut called Uninstall Application on the desktop after file transfer. Launching this shortcut runs your installation in maintenance mode. This code works for both InstallScript and InstallScript MSI projects.

function OnMoved()

begin

   if( !REMOVEALLMODE ) then

      AddFolderIcon( FOLDER_DESKTOP, "Uninstall Application", UNINSTALL_STRING + ADDREMOVE_STRING_REMOVEONLY, "", "", 0, "", REPLACE );

   endif;

end;

Tip:If you include ADDREMOVE_STRING_REMOVEONLY, -removeonly is added to the command line. As a result, REMOVEONLY is set, and the OnMaintUIBefore event handler shows only the uninstallation option. To display the standard maintenance user interface, do not include ADDREMOVE_STRING_REMOVEONLY.

See Also