Tuesday, September 14, 2010

Creating an Uninstall Shortcut for an InstallScript MSI Project

Hi All, Today I need to share how we can create shortcuts in our installshield projects for uninstalling existing installed product. When we use the below information, we were able to install a shortcut along with our application. This shortcut will trigger the uninstallation process.

A Basic MSI installation package can be uninstalled using this command line:
[SystemFolder]Msiexec.exe /x{PRODUCT_CODE}

However, using the same command line for an InstallScript MSI will not uninstall some registry entries, nor would the entry in the Add/Remove Programs applet be removed. This article explains the proper command line to execute the uninstall for an InstallScript MSI project via a shortcut.



Discussion:
InstallShield 12 and newer
Uninstall shortcuts for InstallScript MSI projects are launched through a cached version of the setup.exe. This file is cached in the InstallShield Installation Information folder when the installation has completed. Below are the steps to add a shortcut to launch the cached setup.exe for an uninstall shortcut:


1. Browse to the Shortcuts view or the Shortcuts view of a component.
2. Right-click the desired folder location for the shortcut and select New Shortcut to Preexisting File.
3. In the Browse for Shortcut Target dialog, select the [ProgramFilesFolder] folder. Click OK. Name the shortcut created.
4. Fill in the Target field for the new shortcut as follows:
[ProgramFilesFolder]InstallShield Installation Information\[ProductCode]\setup.exe
Note: Quotes are not required for the shortcut target, they will automatically be placed around the filename and path by Windows Installer at runtime. [ProductCode] will also be replaced at runtime with the Product Code of the MSI package being installed.
5. Fill in the Arguments field for the shortcut as follows:
/runfromtemp /x

For InstallShield 11.5 and earlier
When adding an uninstallation shortcut for an InstallScript MSI project, the file that would be launched is IDriver.exe rather than Msiexec.exe. IDriver.exe is installed automatically, and there is no need to manually install this file. Below are the steps to add a shortcut to launch IDriver and uninstall the InstallScript MSI project:


1. Browse to the Shortcuts view or the Shortcuts view of a component.
2. Right-click and select New Shortcut to Preexisting File.
3. In the Browse for Shortcut Target dialog, the directories that will point to 
    Idriver.exe should be made. The subfolders InstallShield\Driver\ x \Intel 32
    should be added under the [CommonFilesFolder]. The x is where the
    appropriate version of IDriver.exe should be indicated; that being a 7 or 8
    for Developer 7 or 8 projects respectively, or 9 or 10 for DevStudio 9 or X
    projects respectively.

4. Fill in the Arguments field as follows:
    
Arguments: /M{Product Code}
    
{Product Code} would be replaced with your actual product code. It might
    look similar to the following:

    Arguments: /M{7C071035-F334-11D5-818A-00C04F288311}


To find the Product Code for a particular project, follow these steps:
1. Open project in the InstallShield IDE.
2. Select the General Information view.
3. Select Product Properties.
4. Note the value of the Product Code field in the right panel

2 comments:

  1. Thanks to Amit Yadav! This post is very helpful to Uninstall Shortcut for an InstallScript MSI Project. I will visit your blog to get more updates.

    ReplyDelete
  2. wow.... your site fulfil my all requirements..thanks for this amazing information.... InstallShield 2018 Premier Edition

    ReplyDelete