0

I need to check if Microsoft filter pack 2.0 application is installed. I found this answer, but in my case I haven't the Application name, instead the name directory with program in registry named as {95140000-2000-0409-1000-0000000FF1CE} Here is my code to detect for installed app:

ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${FILTER_PACK_KEY}" "UninstallString"
IfErrors FilterPackNotFound FilterPackFound
user2455111
  • 234
  • 1
  • 9
  • Have you defined FILTER_PACK_KEY? What is the problem, is it not detecting or are you getting false positives? – Anders Feb 05 '19 at 12:10
  • @Anders Yes I have a key, but it's not detecting anithing and this code return empty string in messageBox: `ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\95140000-2000-0409-1000-0000000FF1CE" "InstallDate" MessageBox MB_OK "NSIS is installed at: $0"` – user2455111 Feb 06 '19 at 03:27
  • this case also doesn't work: `"Software\Microsoft\Windows\CurrentVersion\Uninstall\{95140000-2000-0409-1000-0000000FF1CE}"` – user2455111 Feb 06 '19 at 03:31
  • Is this filterpack 64-bit? – Anders Feb 06 '19 at 03:48
  • @Anders yes it is 64-bit! – user2455111 Feb 06 '19 at 03:50

1 Answers1

1

The registry on 64-bit Windows has two "views" and 32-bit applications access the 32-bit view by default.

NSIS can access the 64-bit view by using the SetRegView instruction:

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
  • 97,548
  • 12
  • 110
  • 164