Getting installed applications from the registry

(imported topic written by dmoore21)

I was wondering how I might concatenate the following two relevance statements so that I get a listing of ALL installed/registered applications:

((values “DisplayName” of it, values “DisplayVersion” of it) whose (it as string as lowercase does not contain “Update for Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (registry))

((values “DisplayName” of it, values “DisplayVersion” of it) whose (it as string as lowercase does not contain “Update for Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))

(imported comment written by jgstew)

I think this is what you are looking for:

(x32 registry; if(x64 of operating system) then (x64 registry) else nothing)

((values “DisplayName” of it, values “DisplayVersion” of it) whose (it as string as lowercase does not contain “Update for Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; if(x64 of operating system) then (x64 registry) else nothing)

(imported comment written by dmoore21)

When I run your revised relevance through the fixlet debugger, I get the following syntax error:
A literal value or parenthesized expression was expected before ‘if’

Also, to help clarify, I’m looking to get the information from the Uninstall key for both the x32 AND x64 registry keys, not just one or the other.

(imported comment written by dmoore21)

Resolved the error, and it looks like your relevance is producing the results I was hoping for.

Here’s the corrected relevance for this interested:

((values “DisplayName” of it, values “DisplayVersion” of it) whose (it as string as lowercase does not contain “Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; (if (x64 of operating system) then (x64 registry) else nothing)))

As an aside, is there a way to add the “unique” property to the relevance? The unintentional benefit of ordering the results alphabetically would help…

(imported comment written by jgstew)

Sorry about that, I was not running this through the debugger.

Try this:

unique values of ((value “DisplayName” of it as string & " - " & value “DisplayVersion” of it as string) whose (it as string as lowercase does not contain “Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; (if (x64 of operating system) then (x64 registry) else nothing)))

If you don’t need DisplayVersion, you could also do it this way:

unique values of ((value “DisplayName” of it as string) whose (it as string as lowercase does not contain “Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; (if (x64 of operating system) then (x64 registry) else nothing)))

(imported comment written by dmoore21)

Unfortunately, I’m getting the following:

Q: unique values of ((value “DisplayName” of it as string & " - " & value “DisplayVersion” of it as string) whose (it as string as lowercase does not contain “Microsoft Office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; (if (x64 of operating system) then (x64 registry) else nothing)))

E: Singular expression refers to nonexistent object.

(imported comment written by jgstew)

unique values of ((value “DisplayName” of it as string & " - " & value “DisplayVersion” of it as string) whose (it as string as lowercase does not contain “microsoft office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys whose(exists value “DisplayName” of it AND exists value “DisplayVersion” of it) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; (if (x64 of operating system) then (x64 registry) else nothing)))

(imported comment written by jgstew)

alternatively:

unique values of ((value “DisplayName” of it as string & " - " & (if (exists value “DisplayVersion” of it) then (value “DisplayVersion” of it as string) else “NoVersion”)) whose (it as string as lowercase does not contain “microsoft office” AND it as string as lowercase does not contain “security update” AND it as string as lowercase does not contain “update for windows xp” AND it as string as lowercase does not contain “hotfix” AND it as string as lowercase does not contain “redistributable” AND it as string as lowercase does not contain “.net”) of keys whose(exists value “DisplayName” of it) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registry; (if (x64 of operating system) then (x64 registry) else nothing)))