This relevance is very baffling. I’ve used it before and it is not doing the evaluation correctly.
exists ((if (x64 of operating system) then ((values “DisplayVersion” of it) of keys whose (exists value “DisplayName” whose (it as string contains “Name of Product” of it) of it of it) of key “HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” of native registry) else (nothing))) whose (it as string as lowercase < “10.6.2” as lowercase)
This evaluates to false when it should evaluate to true. The version is 9.2.1.8. Last time I checked 10 was bigger than 9.
Any ideas?
When you’re comparing versions you want to cast the strings to versions otherwise you’re doing a string comparison where:
Q: “9” < “10”
A: False
Q: “9” as version < “10” as version
A: True
2 Likes
As a Version, 10 is indeed larger than 9.
As a String, 1 is less than 9, so the string comparison of “10” and “9” will evaluate that “9” is larger. Same as “A” is smaller than “B” in string comparison.
Try casting comparing it instead as as
it as string as version < "10.6.2" as version
2 Likes
This will work on both x32 and x64 systems:
keys whose (exists value "DisplayName" whose (it as string contains "Name of Product" of it) of it) of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries;x32 registries)
Thanks guys I have been looking at this for 2 days and racking my brain.