Dear Team,
Instead of pulling installed application from registry, Is there any possibility to pull from control panel(add or remove programs) with installed date & version.
Dear Team,
Instead of pulling installed application from registry, Is there any possibility to pull from control panel(add or remove programs) with installed date & version.
if (name of operating system does not contain “Win”) then “N/A” else (if it = “” then “Unknown” else it) of unique values of ((if (exists value “DisplayName” of it AND exists value “DisplayVersion” of it AND exists value “Publisher” of it) then (value “Publisher” of it as string) else (“Unknown”)) & (if (exists value “DisplayName” of it) then ("" & value “DisplayName” of it as string) else (“Unknown”)) & (if (exists value “DisplayVersion” of it) then ("" & value “DisplayVersion” of it as string) else ("\Unknown")) & (if (exists value “InstallDate” of it) then ("" & value “InstallDate” of it as string) else ("\Unknown") ) ) of keys whose (exists value “UninstallString” of it AND ((not exists value “SystemComponent” of it) OR (exists value “SystemComponent” of it AND name of it starts with “{” AND name of it contains “}” )) AND (it as lowercase does not contain “Hotfix” as lowercase AND it as lowercase does not contain “Security Update for” as lowercase AND it as lowercase does not contain “Update for” as lowercase AND it as lowercase does not contain “Security Update for Windows” as lowercase AND it as lowercase does not contain “Update for Windows” as lowercase AND it as lowercase does not contain “Security Update for Microsoft” as lowercase AND (length of it > 0) AND (number of substrings " " of it < length of it)) of (value “DisplayName” of it as string)) of keys “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (if x64 of operating system then (x32 registry; x64 registry) else registry)
Take a look at this post:
According to that, you will need to pull the data from registry key KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
.
The values displayed in Add/Remove Programs is simply what Microsoft’s applet is pulling from the registry. Values that appear in Add/Remove Programs are taken from two registry keys - “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” and (for 32-bit applications on 64-bit hosts) from “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” Be sure to query both keys.
Values under this key are shown (with some filtering). If the key has a value “UninstallString” and does not have a value “SystemComponent” value set to 1, then it is displayed.
There are several interesting values under each of these keys. Only “DisplayName” and “UninstallString” are necessary for it to appear in Add/Remove Programs; while most programs supply other values, they are not required. So be sure to check for missing values when querying.
“InstallDate”, where provided, is a simple string, not formatted to BigFix “time” property.
Here’s an example query you can start with -
((if exists value "DisplayName" of it then value "DisplayName" of it else "<no name>"),(value "DisplayVersion" of it |"<no version>),(value "InstallDate" of it | "<no install date>")) of keys whose (not exists value "SystemComponent" whose (it as integer = 1) of it) of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)
I intentionally used two different error-checking methods there. You can use “if/then”, or the pipe operator “|” as an error handler.
Ref:
https://msdn.microsoft.com/en-us/library/ms954376.aspx
Thanks for your valuable help @JasonWalker and with the help of this code i meet my requirements.
Thanks a lot @nicksberger
Yup in that registry key i get two versions of same Software.