SMSINST: How to Create a Silent Uninstall for SMS Installer Program (216826)



The information in this article applies to:

  • Microsoft Systems Management Server Installer 2.0
  • Microsoft Systems Management Server 2.0

This article was previously published under Q216826

SUMMARY

In Systems Management Server 2.0, you can uninstall a program when it is no longer advertised.

In SMS Installer programs created with uninstall support, the uninstall process brings up a dialog box that prompts the user to select an Automatic or a Custom uninstall. In some cases, it might be necessary to have a silent uninstall that does not bring up any dialog boxes.

MORE INFORMATION

You can create a silent uninstall in one of the following ways:

Method 1

Modify the UNINSTAL.IPF before compiling your program. SMS Installer includes UNINSTAL.IPF (located in Program files\Microsoft SMS Installer\Include) when uninstall support is selected. You can modify this file with the script editor view of SMS Installer. Modify the registry statement highlighted below with '=> <='
If APPTITLE Not Equal "" then
   If System has Windows 95 Shell
      Registry Key Software\Microsoft\.....
=>    Registry Key Software\Microsoft\......   <=
   Else
      .
      .
   End Block
End Block
				

Change the value from:
"%UNINSTALL_PATH%" "%_LOGFILE_PATH_%" "%APPTITLE% Uninstall"
				

to:
"%UNINSTALL_PATH%" /S "%_LOGFILE_PATH_%" "%APPTITLE% Uninstall"
				

Save the script but do not compile it. All programs compiled after the modification of uninstal.ipf will have quiet uninstall automatically enabled.

Method 2

Modify the uninstall string in the client's registry after the program is installed. All programs with uninstall support create the following registry key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\&lt;Program name&amp;g

A string value 'UninstallString' is also created and its data is the path to uninstal.exe + install log file + application name.
For example, the key would be the following for a program called Bogo Games:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Bogo Games

and the UninstallString Data would be similar to "C:\Program Files\Bogo Games\UNINSTAL.EXE "C:\Program Files\Bogo Games\INSTALL.LOG"

To make the uninstall silent, you need to add a /S after UNINSTAL.EXE. The UninstallString would become "C:\Program Files\Bogo Games\UNINSTAL.EXE /S "C:\Program Files\......""

Modification Type:MinorLast Reviewed:6/14/2005
Keywords:kbAdvertisement kbhowto kbPackage kbSoftwareDist KB216826