Check for installed application and version

Hi,
I am trying to write a relevance to return true if an application is not installed or if installed, the version is lower than certain value.

not exists keys whose (exists value “DisplayName” whose (it as string as lowercase contains “appname” ) of it and value “DisplayVersion” of it as string as version < “1.0.0.0”) of keys “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x64 registries; x32 registries)

pls advise

thanks
eng keat

Hello, you have it almost right but if you are negating the entire key statement you need to reverse the version comparison too. Give this a try:

not exists keys whose (exists value “DisplayName” whose (it as string as lowercase contains “appname” ) of it and value “DisplayVersion” of it as string as version >= “1.0.0.0”) of keys “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (x64 registries; x32 registries)

2 Likes

thanks so much, it works

1 Like