How to create an uninstall shortcut for .MSI

book

Article ID: 180598

calendar_today

Updated On:

Products

Symantec Products

Issue/Introduction

 

Resolution

Question

How do I create a shortcut that uninstalls my .MSI-based application and include it in my installation?

Answer

Create a command line shortcut to uninstall your application and include the shortcut in your installation. Windows Installer uses the following command line to uninstall an .MSI package: msiexec.exe /x {12345678-1234-1234-1234-123456789012}. The GUID enclosed in the curly brackets represents the product code for your application. The product code can be found on the Product Details page in Installation Expert under the Package Meta Data.

To create a command line shortcut that uninstalls your .MSI-based application:

  1. On the Shortcuts page in Installation Expert, click Add. The New Shortcut Wizard appears.
  2. Mark the Command Line option on the Shortcut Type dialogue to enable the Command Line and Shortcut Name fields.
  3. Input "[SystemFolder]msiexec.exe /x [ProductCode]" in the Command Line field, input a name (for example, Uninstall) for the shortcut in the Shortcut Name field and click Next. [SystemFolder] refers to the pre-defined Windows Installer property holding the path to the Windows\System32 folder. [ProductCode] refers to the ProductCode property for the installation.
  4. Select the destination location for the shortcut. Click New Folder to create a new directory for the shortcut if desired.
  5. Click Finish. The Shortcut Details dialog appears.
  6. Make any desired changes in the fields on the Shortcut Details dialog. Note that the Command Line field contains only the path and name of the executable. The Arguments field contains the remainder of the command line.
  7. Click OK to close the Shortcut Details dialog.
  8. Save and compile your installation.

After installing your product, a shortcut appears in the location specified with the proper command line to uninstall your application.