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

ID: Q216826


The information in this article applies to:


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\<Program name>

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\......""

Additional query words: prodsms installer silent quiet


Keywords          : kbSMS200 kbSMS120 kbAdvertisement kbPackage kbSMSInst kbSoftwareDist 
Version           : WINDOWS:2.0; winnt:2.0
Platform          : WINDOWS winnt 
Issue type        : kbhowto 

Last Reviewed: March 17, 1999