【问题标题】:NSIS: How check that application is installedNSIS:如何检查该应用程序已安装
【发布时间】:2019-02-05 05:31:41
【问题描述】:

我需要检查是否安装了 Microsoft filter pack 2.0 应用程序。我找到了this 的答案,但在我的情况下,我没有应用程序名称,而是注册表中名为{95140000-2000-0409-1000-0000000FF1CE} 的程序的名称目录,这是我检测已安装应用程序的代码:

ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${FILTER_PACK_KEY}" "UninstallString"
IfErrors FilterPackNotFound FilterPackFound

【问题讨论】:

  • 你定义了 FILTER_PACK_KEY 吗?问题是什么,是没有检测到还是误报?
  • @Anders 是的,我有一个密钥,但它没有检测到任何内容,并且此代码在 messageBox 中返回空字符串:ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\95140000-2000-0409-1000-0000000FF1CE" "InstallDate" MessageBox MB_OK "NSIS is installed at: $0"
  • 这种情况也不行:"Software\Microsoft\Windows\CurrentVersion\Uninstall\{95140000-2000-0409-1000-0000000FF1CE}"
  • 这个 filterpack 是 64 位的吗?
  • @Anders 是的,它是 64 位的!

标签: nsis regedit


【解决方案1】:

64 位 Windows 上的注册表有 two "views",32 位应用程序默认访问 32 位视图。

NSIS 可以使用SetRegView 指令访问 64 位视图:

Section
SetRegView 64
RegReadStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\{95140000-2000-0409-1000-0000000FF1CE}" "UninstallString"
SetRegView 32
MessageBox mb_ok $0
SectionEnd

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-04
    • 2011-09-24
    • 2011-03-15
    相关资源
    最近更新 更多