Add uninstall information to Add/Remove Programs: Difference between revisions
m (→Required values: - missing highlighting tags added) |
|||
Line 22: | Line 22: | ||
Consider this example. Your company is called 'Great Northern Software Co' and you are installing their latest super software 'Image Maker'. What you want to do is to have a new key created in the Software\Microsoft\Windows\CurrentVersion\Uninstall section of HKLM. The key will be the name of the software, and it will have two subkeys, one with the display name of the software and the other the location of the uninstall program. | Consider this example. Your company is called 'Great Northern Software Co' and you are installing their latest super software 'Image Maker'. What you want to do is to have a new key created in the Software\Microsoft\Windows\CurrentVersion\Uninstall section of HKLM. The key will be the name of the software, and it will have two subkeys, one with the display name of the software and the other the location of the uninstall program. | ||
<highlight-nsis> | |||
WriteRegStr HKLM \ | WriteRegStr HKLM \ | ||
"Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" \ | "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" \ | ||
Line 28: | Line 29: | ||
"Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" \ | "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" \ | ||
"UninstallString" "$INSTDIR\uninstall.exe" | "UninstallString" "$INSTDIR\uninstall.exe" | ||
</highlight-nsis> | |||
Once these are executed you will see the display name appear in the Add/Remove programs section of control panel. | Once these are executed you will see the display name appear in the Add/Remove programs section of control panel. | ||
Line 33: | Line 35: | ||
Two things to point out. First, you must use backslashes. I do a lot of Java/Unix work, so I need to make this clear. And second, you should add a delete key command to your uninstaller section, so the name will be removed from the list when your uninstaller completes. If you don't do this your name will still be there, but windows will see this as a problem (ie it will say the entry is corrupt). | Two things to point out. First, you must use backslashes. I do a lot of Java/Unix work, so I need to make this clear. And second, you should add a delete key command to your uninstaller section, so the name will be removed from the list when your uninstaller completes. If you don't do this your name will still be there, but windows will see this as a problem (ie it will say the entry is corrupt). | ||
<highlight-nsis> | |||
DeleteRegKey HKLM \ | DeleteRegKey HKLM \ | ||
"Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" | "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" | ||
</highlight-nsis> | |||
== Optional values == | == Optional values == |
Revision as of 12:48, 14 September 2005
Author: Konrad (talk, contrib) |
How To Use
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 serval 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.
Consider this example. Your company is called 'Great Northern Software Co' and you are installing their latest super software 'Image Maker'. What you want to do is to have a new key created in the Software\Microsoft\Windows\CurrentVersion\Uninstall section of HKLM. The key will be the name of the software, and it will have two subkeys, one with the display name of the software and the other the location of the uninstall program.
WriteRegStr HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" \ "DisplayName" "Image Maker -- super software from Great Northern" WriteRegStr HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" \ "UninstallString" "$INSTDIR\uninstall.exe"
Once these are executed you will see the display name appear in the Add/Remove programs section of control panel.
Two things to point out. First, you must use backslashes. I do a lot of Java/Unix work, so I need to make this clear. And second, you should add a delete key command to your uninstaller section, so the name will be removed from the list when your uninstaller completes. If you don't do this your name will still be there, but windows will see this as a problem (ie it will say the entry is corrupt).
DeleteRegKey HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker"
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").