Syntax error Registry Relevance Failing

Hello,

I am new to BigFix and am trying to run an action script that looks atboth 64 and 32 bit keys to verify version that’s installed and depending version, the script will run one of the two command switches.

I am doing something wrong as I am getting syntax errors. Would greatly appreciate the help.

This is what it looks like:

prefetch …points to location of installer file

if {exists (keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (registry; native registry)) whose (value “DisplayName” of it as string as lowercase contains “cb protection” and value “DisplayVersion” of it as string as version >= “8.0” as version)} then
waithidden “{pathname of system folder & “\msiexec.exe”}” /fvamus “{(pathname of client folder of current site) & “__Download\ParityHostAgent.msi”}” /L*v c:\ProgramData\bit9\agentupgrade.log

elseif {exists (keys of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (registry; native registry)) whose ((value “DisplayName” of it as string as lowercase contains “cb protection” or value “DisplayName” of it as string as lowercase contains “bit9 agent”) and value “DisplayVersion” of it as string as version < “8.0” as version)} then
waithidden “{pathname of system folder & “\msiexec.exe”}” /i “{(pathname of client folder of current site) & “__Download\ParityHostAgent.msi”}” /L*v c:\ProgramData\bit9\agentupgrade.log
endif

Hello,
I think the problem is using “then” in if statement.
https://developer.bigfix.com/action-script/reference/flow-control/if-elseif-else-endif.html

R.

Thanks so much, Roman! That did it! Really appreciate your help.

Yen