Error: This expression could not be parsed

Hello, I am new to BigFix platform and trying to run this query on a webui but getting the below error: Can you tell me what I am doing wrong? Thank you in advance.

not exists (values "DisplayName" whose(it as string contains "Notepad++ (64-bit x64)"), values "DisplayVersion" whose(it as string >= "8.4.6") of it) of ( x32 registry; (if exists x64 registry then x64 registry else nothing)

Error: This expression could not be parsed

At minimum there’s a missing close-parenthesis at the end.

Thank you Jason for your prompt suggestion, but I added another ) at the end still getting same result.

This should get you moving in the right direction:

(values "DisplayName" of it, values "DisplayVersion" of it) of keys of key "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 Registry;x64 registry)

Thank you so much for helping me with this.

Try this:

not (disjunction of (it as string as lowercase contains "bigfix client, 10.0.7.52" as lowercase) of ((values "DisplayName" of it, values "DisplayVersion" of it) of keys of key "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 Registry|x64 Registry) as string))

This one will allow you to compare versions:

not (disjunction of (tuple string item 0 of it as string as lowercase contains "bigfix client" as lowercase AND tuple string item 1 of it as version >=  "10.0") of ((values "DisplayName" of it, values "DisplayVersion" of it) of keys of key "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 Registry|x64 Registry) as string))

Here’s another variation:

(not exists value "DisplayVersion" whose (it as string as version >= "8.4.6") of it) of keys whose (value "DisplayName" of it as string = "Notepad++ (64-bit x64)") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)

I’m afraid it’s important to be very clear, especially on error messages. I added a parenthesis on the end, and get a different result; still an error message, but a different one:

q: not exists (values "DisplayName" whose(it as string contains "Notepad++ (64-bit x64)"), values "DisplayVersion" whose(it as string >= "8.4.6") of it) of ( x32 registry; (if exists x64 registry then x64 registry else nothing))
E: The operator "values" is not defined.

The first value you reference, values "DisplayName", doesn’t have a reference "of it" pointing back to the Registry key. In fact on second look, the registry key isn’t listed at all - so you need to reference the registry keys “HKLM\Software.…” and also the first “values” needs a reference to those keys…

q: not exists (values "DisplayName" whose(it as string contains "Notepad++ (64-bit x64)") of it, values "DisplayVersion" whose(it as string >= "8.4.6") of it) of keys of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of ( x32 registry; (if exists x64 registry then x64 registry else nothing))

A: True

Anything beyond that is largely a matter of style. The form I most like to use is

q: not exists keys whose (value "DisplayName" of it as string contains "Notepad++ (64-bit x64)" and value "DisplayVersion" of it as string as version >= "8.4.6") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of ( x32 registries; x64 registries)

A: True
1 Like