I am trying to write relevance that will check an application to see if it was installed over 90 days ago. I think I got it. Is there a better way?
(current date - ((date (last 2 of it & " " & (month (last 2 of first 6 of it as integer) as three letters) & " " & first 4 of it)) of first 8 of (value "InstallDate" of it as string)) > 90*day) of key whose (value "DisplayName" of it as string contains "Rocket") of key "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall" of registry
What you have is what I would use as it will be the quickest. One note though - they way you have it “registry” would point to x32 registry when you plug it for the client since it runs as 32bit app. Might want to make it: … of (x32 registry; x64 registry), so that it scans both reg branches.
That said, you can also use wmi query to Win32_Product to get the same info but note that this would be slow. Also, Win32_Product class does sometimes contain “hotfixes”, service packs and whatnot, that you may need to filter out (it’s not exactly the same as the reg key).
I’d reformat for readability, and coverage of plurals and registries as @ageorgiev mentions:
(/* Rocket installation date */ it > 90*day) of ((current date - ((date (last 2 of it & " " & (month (last 2 of first 6 of it as integer) as three letters) & " " & first 4 of it)) of first 8 of (values "InstallDate" of it as string))) of (keys whose (value "DisplayName" of it as string contains "Rocket") of keys "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)))
3 Likes