卸载程序的基本注册表项是什么?



简单安装程序的NSIS示例提供了一堆要写入注册表的条目。 真的所有这些都有必要吗?什么是"最低限度"?

# Registry information for add/remove programs
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "UninstallString" "$"$INSTDIRuninstall.exe$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$"$INSTDIRuninstall.exe$" /S"
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "InstallLocation" "$"$INSTDIR$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$"$INSTDIRlogo.ico$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "Publisher" "$"${COMPANYNAME}$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "HelpLink" "$"${HELPURL}$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$"${UPDATEURL}$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$"${ABOUTURL}$""
WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "DisplayVersion" "$"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$""
WriteRegDWORD HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
WriteRegDWORD HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "VersionMinor" ${VERSIONMINOR}
# There is no option for modifying or repairing the install
WriteRegDWORD HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "NoModify" 1
WriteRegDWORD HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "NoRepair" 1
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
WriteRegDWORD HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${INSTALLSIZE}

与 http://nsis.sourceforge.net/A_simple_installer_with_start_menu_shortcut_and_uninstaller 相比

顺便说一句:当询问此关键字时,Google搜索仅提供有关如何在卸载程序后清理注册表的提示。

需要DisplayNameUninstallString

其他所有内容都是可选的,但如果缺少其他某些条目,Windows 应用认证工具包会给你一些警告。

可选条目显示在 Windows 2000 及更高版本的 UI 中。

最新更新