Installed Applications Property

(imported topic written by John_Masters91)

I’ve just looked at the “Installed Applications - Windows” Property: -

(if (exists value “DisplayName” of it AND (length of (value “DisplayName” of it as string) > 0) AND (number of substrings " " of (value “DisplayName” of it as string) < (length of (value “DisplayName” of it as string)))) then (value “DisplayName” of it as string & (if (exists value “DisplayVersion” of it) then (" - " & value “DisplayVersion” of it as string) else (""))) else (name of it & (if (exists value “DisplayVersion” of it) then (" - " & value “DisplayVersion” of it as string) else ("")))) of keys whose (exists value “UninstallString” of it) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

However… SOME of our apps do not have an UninstallString in the registry key mentioned but DO show in the add/remove programs list (this is by design!)

I can return JUST these easily enough by changing the above to read: -

(if (exists value “DisplayName” of it AND (length of (value “DisplayName” of it as string) > 0) AND (number of substrings " " of (value “DisplayName” of it as string) < (length of (value “DisplayName” of it as string)))) then (value “DisplayName” of it as string & (if (exists value “DisplayVersion” of it) then (" - " & value “DisplayVersion” of it as string) else (""))) else (name of it & (if (exists value “DisplayVersion” of it) then (" - " & value “DisplayVersion” of it as string) else ("")))) of keys whose (

NOT

exists value “UninstallString” of it) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

But, this is not ideal… I would like both types of entry returned. If I remove “of keys whose (exists value “UninstallString” of it)” altogether, the only result I get it the text “Uninstall”

What do I need to do to get both? - aside from get myself on a rel language course!

(imported comment written by brolly3391)

Welcome John,

You can simply remove the part of the whose clause that is checking for the UninstallString value:

(if (exists value “DisplayName” of it AND (length of (value “DisplayName” of it as string) > 0) AND (number of substrings " " of (value “DisplayName” of it as string) < (length of (value “DisplayName” of it as string)))) then (value “DisplayName” of it as string & (if (exists value “DisplayVersion” of it) then (" - " & value “DisplayVersion” of it as string) else (""))) else (name of it & (if (exists value “DisplayVersion” of it) then (" - " & value “DisplayVersion” of it as string) else ("")))) of keys of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

Cheers,

Brolly