Relevance Help with Conversion to String

Can anyone help with this please? I’ve spent way too long looking at it and my eyes are going together now hahaha

I have to admit that registry keys in relevance is my biggest pit fall - I’m rubbish at them

Q: (it as string as version) of values “Version” of keys “Full” of keys of keys “HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP” of native registry
A: 4.7.3062
T: 1884

Q: if (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP” of registry) then (value “Version” of (key “Full” of it) of (key ((maximum of (names of keys of it as integer))as string) of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP” of registry)as string
E: This expression could not be parsed.

Q: ((“4.5” > value “Version” of it as string as version ) of key “Full” of key ((it as string) of maximum of (it as integer) of names of keys of key “HKLM\SOFTWARE\Microsoft\Net Framework Setup\NDP” of registry) of key “HKLM\SOFTWARE\Microsoft\Net Framework Setup\NDP” of registry)
E: Singular expression refers to nonexistent object.
T: 2038

Ultimately, I’m trying to get an analysis to say Yes if the version is lower than 4.5

here you go -
Q: (it < “4.5” as string) of (values “Version” of keys “Full” of keys of key “HKLM\Software\Microsoft\NET Framework Setup\NDP” of native registry)
A: False
T: 0.198 ms

You sometime need to be careful using strings as 4.5.0 as a string is higher than 4.5.

Q: "4.5.0" > "4.5"
A: True
T: 0.716 ms
I: singular boolean

Q: "4.5.0" as version > "4.5" as version
A: False
T: 0.688 ms
I: singular boolean

I would tend to favour an approach more like

Q: (it < "4.5" as version) of (value "Version" of keys "Full" of keys of keys "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP" of native registry as string as version | "0.0" as version)
A: False
T: 0.657 ms
I: singular boolean
3 Likes