Previous | Contents | Next

## D.2 Add uninstall information to Add/Remove Programs

Create a key with your product name under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall to add entries to the "Add/Remove Programs" section in the Control Panel. For Windows NT (NT4/2000/XP), it's also possible to create the key in the HKCU hive, so it will only appear for the current user. There are several values you can write to key to give information about your application and the uninstaller. Write a value using the WriteRegStr command (for strings) or WriteRegDWORD command (for DWORD values). Example:

    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Product" "DisplayName" "Application Name"

Required values

DisplayName (string) - Name of the application
UninstallString (string) - Path and filename of the uninstaller. You should always quote the path to make sure spaces in the path will not disrupt Windows to find the uninstaller.

Optional values

Some of the following values will not be used by older Windows versions.

InstallLocation (string) - Installation directory ($INSTDIR)
DisplayIcon (string) - Path, filename and index of the icon that will be displayed next to your application name

Publisher (string) - (Company) name of the publisher

ModifyPath (string) - Path and filename of the application modify program
InstallSource (string) - Location where the application was installed from

ProductID (string) - Product ID of the application
RegOwner (string) - Registered owner of the application
RegCompany (string) - Registered company of the application

HelpLink (string) - Link to the support website
HelpTelephone (string) - Telephone number for support

URLUpdateInfo (string) - Link to the website for application updates
URLInfoAbout (string) - Link to the application home page

DisplayVersion (string) - Displayed version of the application
VersionMajor (DWORD) - Major version number of the application
VersionMinor (DWORD) - Minor version number of the application

NoModify (DWORD) - 1 if uninstaller has no option to modify the installed application
NoRepair (DWORD) - 1 if the uninstaller has no option to repair the installation

If both NoModify and NoRepair are set to 1, the button displays "Remove" instead of "Modify/Remove".

Previous | Contents | Next