windows - 添加/删除程序条目丢失

标签 windows installation registry nsis

我有 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/

相关文章:

c# - .NET Core : TcpClient. GetStream 在使用异步时崩溃

python - 安装包到 Canopy

winforms - 如何在安装项目结束时运行可执行文件?

c# - 如何在 C# 中捕获 Shell 命令输出?

windows - 如何从命令行使用 REG_EXPAND_SZ?

c - 有没有办法在 C 中使用/调用 COM 接口(interface)?

windows - C++/CX 捕获异常 - 如何打印完整堆栈?

php - 如何修复 yum install php-mysqli 错误

Windows shell 在单击文件夹的空白部分时将项目添加到上下文菜单

C++ 搜索 Windows 注册表