add/remove program registry info
By Justin Silverton
For people that write windows applications, the following info will allow you to add your application to the add/remove programs menu.
Create a key with your app name 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 the key to give additional information about your application and the uninstaller.
Write a value using the WriteRegStr command (for strings) or WriteRegDWORD command (for DWORD values).
Example:
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.
HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\myapp" "DisplayName" "This is my cool application"
HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\myapp" "UninstallString" "$INSTDIR\uninstall.exe"
Optional values
Supported on: Windows XP.
* InstallLocation (string) - Installation directory ($INSTDIR)
* DisplayIcon (string) - Path, filename and index of 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".
Supported on: Windows XP Service Pack 2.
* ParentKeyName (string) - If the program is an update of a parent program, specify the parent program subkey name. If "OperatingSystem", it's an update for Windows.
* ParentDisplayName (string) - If the program is an update of a parent program, specify the parent program name (as specified on the parent's "DisplayName").
For people that write windows applications, the following info will allow you to add your application to the add/remove programs menu.
Create a key with your app name 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 the key to give additional information about your application and the uninstaller.
Write a value using the WriteRegStr command (for strings) or WriteRegDWORD command (for DWORD values).
Example:
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.
HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\myapp" "DisplayName" "This is my cool application"
HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\myapp" "UninstallString" "$INSTDIR\uninstall.exe"
Optional values
Supported on: Windows XP.
* InstallLocation (string) - Installation directory ($INSTDIR)
* DisplayIcon (string) - Path, filename and index of 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".
Supported on: Windows XP Service Pack 2.
* ParentKeyName (string) - If the program is an update of a parent program, specify the parent program subkey name. If "OperatingSystem", it's an update for Windows.
* ParentDisplayName (string) - If the program is an update of a parent program, specify the parent program name (as specified on the parent's "DisplayName").

6 Comments:
I had no idea this was possible, thanks for the quick how to! I have a question though: how do you ACTUALLY remove or add a program? These are just registry keys.
Thanks for your expertise.
By
Anonymous, at 8:24 PM
you can use these keys in the installer for your application. A great free one (which I find better than almost all of the commerial ones out there) can be found here: http://nsis.sourceforge.net/Main_Page
By
justin silverton, at 8:28 PM
But how do you actually uninstall something?
By
Anonymous, at 10:53 AM
go here: http://www.intelliadmin.com/blog/2006/01/programs-that-you-cannot-uninstall.html
it's a free utility that will let you un-install a program manually.
By
justin silverton, at 8:31 PM
I use NSIS to deploy an application. I set the registry entries as recommanded to get entries in Add\Remove programs, and I get them. So my application can be uninstalled from the control pannel, BUT after it is uninstalled the "Add\Remove" does not refresh and until I close it it looks like my application is still there (I did erase the registry keys).
By
Anonymous, at 2:19 PM
Why don't you email me your .nsi file to justin@whenpenguinsattack.com and I can take a look at it.
By
justin silverton, at 2:28 PM
Post a Comment
Links to this post:
Create a Link
<< Home