我有 NSI 脚本和编译安装程序,其中包含以下代码:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayName" "${NAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "UninstallString " "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "Publisher" "${COMPANY}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "URLInfoAbout" "${WEBSITE}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayVersion" "3.0.0"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "NoRepair" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "EstimatedSize" "400"
这会在安装时编译并创建所有 key 。我可以在 RegEdit 中看到它们。但是它们没有显示在添加/删除程序列表中。无论我删除或添加什么参数。
我尝试创建具有完全相同值的新键,它确实显示在列表中。两个 key 的权限完全相同。
编辑:
这不适用于 Windows Vista 和 7,包括 x64 和 x86。 文件未经过数字签名。 路径包含空格,但它被封装在双括号中。 键名又名 ${NAME} 包含两个空格。
最佳答案
这是由于“UninstallString”在名称后有一个意外的空格引起的,因此 Windows 没有将其识别为正确的条目。
关于windows - 添加/删除程序条目丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13869372/