Search registry for existent of application and version

(imported topic written by SystemAdmin)

I’m trying to verify the installation of an application. I known the app is installed on my machine, but I can’t get my relevents to work.

I am searching the registry for the existent of the application “Diskeeper” and it’s version number (see attachment - registry keys)

not working:

if value “DisplayName” of (keys of it) whose (exist name whose (it as string as lowercase contains “Diskeeper”) of it) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{2D4A8333-8461-4601-96F7-D4E6FC1E0FA8}” of registry = “10.0.593.0” then “10.0.593.0” else value “DisplayName” of (keys of it) whose (exist name whose (it as string as lowercase contains “Diskeeper”) of it) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{2D4A8333-8461-4601-96F7-D4E6FC1E0FA8}” of registry as string

(imported comment written by cwmenard)

This should get you want you want.

unique values of
    (
      substring before "%00" of 
        (
          (value "DisplayVersion" of it as string) of keys whose 
                    (
                      exists value "DisplayName" whose (exists match (regex "diskeeper") of (it as string as lowercase)) of it
                    ) 
              of key "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of it
            )
    of 
      (
        if x64 of operating system then
              (x64 registry;x32 registry) else registry
      ) as lowercase
    )

(imported comment written by SystemAdmin)

cwmenard

after flattening your code I received this error:

q:unique values of (substring before “%00” of ((value “DisplayVersion” of it as string) of keys whose (exists value “DisplayName” whose (exists match (regex “diskeeper”) of (it as string as lowercase)) of it) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of it) of (if x64 of operating system then x64 registry;x32 registry) else registry) as lowercase

E: This expression could not be parsed.

(imported comment written by SystemAdmin)

I also tried this - I would think this would work

q:If (Exists keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\2D4A8333-8461-4601-96F7-D4E6FC1E0FA8” of registry) Then Version"DisplayVersion" of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\2D4A8333-8461-4601-96F7-D4E6FC1E0FA8” of registry as string else (“Not Found”)

A: Not Found

(imported comment written by SystemAdmin)

I got this to work - Thanks

working:

q:values “DisplayVersion” of keys whose (name of it contains string “2D4A8333-8461-4601-96F7-D4E6FC1E0FA8”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry

A: 10.0.593