質問

I'm reading a Registry Key in my NSIS Script to detect wether Microsoft Visual 2010 Redistributable is installed or not.

... ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}" "DisplayName" ${If} $R0 != "" Messagebox MB_OK "C++ 2010 Redistributable detected" goto yesCpp2010 ${Else} MessageBox MB_OK "C++ 2010 not found" goto noCpp2010 ${EndIf} ...

I tried it on Windows 7 and it works. But it won't work on other Windows Versions if the Programms have other Keys. Do they have the same Keys? If the Keys are different, is there a way to get them?

役に立ちましたか?

解決

The GUID can probably change with Service Pack's and security updates but this blog claims you can just check the Installed DWORD under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64.

For previous MSVC versions I would also suggest querying SxS but I don't think 2010 uses that technology...

他のヒント

I think you forget "\" character after Uninstall.

ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}" "DisplayName"

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top