Registry relevance not working.. Querying "DisplayName" of Uninstall

(imported topic written by tscott91)

All I’m trying to do is find out if a program is installed on a PC…

exists key whose (value “DisplayName” of it as string contains “TestStringHere”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

The above returns false no matter what I put in the “TestStringHere”… I’ve even done a copy / paste of that value directly out of the registry and it still returns false…

What am I doing wrong here?

Thanks!

(imported comment written by cstoneba)

are you running this test on an x64 windows OS? if so, try “of native registry”

(imported comment written by tscott91)

Bingo!!! Thanks so much!

(imported comment written by SystemAdmin)

Knowing you already got it to work, I thought I’d just share our code to handle this:

exists values “DisplayVersion” whose (it as string as version = “1.0.0.0” as version) of keys whose (value “DisplayName” of it as string as lowercase contains “programnamegoeshere”) of keys “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (if x64 of operating system then (x32 registry; x64 registry) else registry)

This returns all systems with the version of the app installed.

(imported comment written by cstoneba)

nice