Value of a registry value

(imported topic written by nwisman91)

Hi,

I need to find the value of a registry value named “Version”. Specifically, we need to find all machines whose value of this value is >= 1.4.

I’ve tried many variations of the below:

q: exists value whose (name of it = “Version” AND whose (value of it >= “1.4”)) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Image Version” of registry

None work.

The debugger doesn’t seem to like it when I ask for a value of a value. How do I do this?

Thanks,

NW

(imported comment written by nwisman91)

I think I got it:

value “Version” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Image Version” of the registry >= “1.4”

(imported comment written by Steve91)

Try:

exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Image Version” whose (exists value “Version” whose (it >= “1.4”) of it) of registry

The reason to check for existence of the key and the value means it will return False if either the key or value doesn’t exist or the value is not >= 1.4

If you just check for the value from a key, if the key or value doesn’t exists the relevance will error.

Cheers

Steve

(imported comment written by nwisman91)

I arrived at that conclusion…and started using this:

exists value “Version” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Image Version” of the registry AND value “Version” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Image Version” of the registry >= “1.4”

Is this relevance equivalent to what you posted?

(imported comment written by jessewk)

Your solution will only work sometimes. The reason being you are comparing strings when you really want to be comparing versions.

I’d use this:

exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Image Version” whose (exists value “Version” whose (it as string as version >= “1.4” as version) of it) of registry

(imported comment written by nwisman91)

Got it. Thank you for your help.