如何在Windows的添加/删除程序列表中添加程序以便列出它(因此我可以点击它来卸载)?如何在Windows添加/删除程序列表中添加程序
9
A
回答
11
卸载注册存储在注册表中,在注册表中的你应该保存它取决于如果你的安装程序安装为所有用户或单个用户的程序(即你的RequestExecutionLevel设置):
- 用户= HKCU
- 管理= HKLM
- 最高= SHCTX(这意味着你必须使用SetShellVarC ontext正确,并在卸载程序中正确还原)
只有两个值是必需的:DisplayName和UninstallString。
!define REGUNINSTKEY "MyApplication" ;Using a GUID here is not a bad idea
!define REGHKEY HKLM ;Assuming RequestExecutionLevel admin AKA all user/machine install
!define REGPATH_WINUNINST "Software\Microsoft\Windows\CurrentVersion\Uninstall"
Section
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGUNINSTKEY}" "DisplayName" "My application"
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGUNINSTKEY}" "UninstallString" '"$INSTDIR\uninstaller.exe"'
SectionEnd
有可以设置几个可选值,MSDN并没有真正提供能够证明值的列表,但NSIS Wiki has a decent list和this page有一个更完整的列表...
3
用法示例:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"DisplayName" "<Name>" ;The Name shown in the dialog
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"UninstallString" "$INSTDIR\<Path to uninstaller>"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"Publisher" "<Your Name>"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"HelpLink" "<URL>"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"DisplayVersion" "<Version>"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"NoModify" 1 ; The installers does not offer a possibility to modify the installation
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"NoRepair" 1 ; The installers does not offer a possibility to repair the installation
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"ParentDisplayName" "<Parent>" ;
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"ParentKeyName" "<ParentKey>" ; The last two reg keys allow the mod to be shown as an update to another software. Leave them out if you don't like this behaviour
相关问题
- 1. 如何添加我的程序来添加/删除程序? VB.NET
- 2. 如何将程序添加到Windows 7程序列表?
- 3. 安装后删除程序从添加/删除程序列表Wix
- 4. Windows安装程序 - 强制用户通过添加删除?删除程序
- 5. 在Windows'添加/删除程序中显示正确的大小
- 6. 在添加/删除程序中更改Windows窗体应用程序图标
- 7. 添加/删除程序项丢失
- 8. 添加删除程序图标
- 9. 是否可以将Silverlight 3浏览器外应用程序添加到添加/删除程序列表中?
- 10. 添加/删除程序中的引导程序和设置
- 11. Wix安装程序添加单独版本的应用程序升级,而不是在添加删除程序中删除和添加新条目
- 12. 如何将Windows 7跳转列表添加到应用程序
- 13. C#Windows从添加/删除列表
- 14. 添加在程序
- 15. 如何添加程序
- 16. 如何添加程序
- 17. 从添加/删除程序中删除不良安装
- 18. 如何在运行时添加和删除扩展程序?
- 19. 如何在kotlin程序中添加库?
- 20. 如何在java程序中添加.class?
- 21. 重复数据删除和过滤添加/删除程序列表(VBScript)
- 22. 如果从“添加/删除程序”中删除服务应用程序(如果它不再列为服务)?
- 23. MSI安装程序不删除以前版本的添加/删除程序
- 24. 添加/删除列表
- 25. 添加和删除元素序列
- 26. 如何将项目添加到线程列表中并保持添加顺序?
- 27. WiX:旧版本不会在“添加/删除程序”列表中消失
- 28. 应用程序未显示在其他用户的添加/删除列表中
- 29. 在运行时在Java(Swings)程序中添加并删除JTextField
- 30. 无法删除添加/删除链接程序
注:在64位机器上有32位安装的单独位置:https://superuser.com/a/293896/41494 – icc97 2018-02-23 16:13:24