NSIS:如何检查应用程序是否已安装

NSIS:如何检查应用程序是否已安装,nsis,regedit,Nsis,Regedit,我需要检查是否安装了Microsoft filter pack 2.0应用程序。我找到了答案,但在我的例子中,我没有应用程序名,而是注册表中名为{95140000-2000-0409-1000-0000000 ff1ce}的程序名目录以下是我要检测已安装应用程序的代码: ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${FILTER_PACK_KEY}" "UninstallString" IfEr

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

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

默认情况下,64位Windows上的注册表具有32位权限,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

您是否定义了筛选包密钥?问题是什么,它没有检测到还是你得到了误报?@Anders是的,我有一个密钥,但它没有检测到任何东西,并且此代码在messageBox中返回空字符串:
ReadRegStr$0 HKLM“Software\Microsoft\Windows\CurrentVersion\Uninstall\95140000-2000-0409-1000-0000000 FF1CE”“InstallDate”messageBox MB\u OK“NSIS安装在:$0”
此案例也不起作用:
“Software\Microsoft\Windows\CurrentVersion\Uninstall\{95140000-2000-0409-1000-0000000 ff1ce}”
这是64位的过滤器包吗?@Anders是的,这是64位的!