Cross platform relevance statement fails if including a check against the Windows registry

I am trying to write a set of fixlets to enable and disable an agent that can support multiple operating systems. Individually, all of the relevance statements work fine. The workflow in the action scripts all work perfectly. The issue I have is that if I check for the value of the winlogon shell in the part of the statement for Windows, my Linux and Mac agents will no longer show up.

For example, the below statement only shows Windows agents as relevant:

(exists file "/etc/res/resauthd.conf" and line (1) of file "/etc/res/resauthd.conf" = "LearningMode=yes") or (windows of operating system and exists service "RESPESVC" and exists value "Shell" whose (it as string as lowercase contains "explorer.exe") of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" of native registry)

This statement though shows all of the agents as relevant:

(exists file "/etc/res/resauthd.conf" and line (1) of file "/etc/res/resauthd.conf" = "LearningMode=yes") or (windows of operating system and exists service "RESPESVC")

I thought that it might have been an issue with the number of statements (I originally did all the checks for explicit operating systems), but even cutting it all down to two statements fails to show the non-windows agents if I check for the Shell registry value. If I try to check other registry items, I see the same results.

Is there perhaps a different method I should use to get the shell value?

You will need to protect the platform specific items in an if condition.

For example I’m on a Mac here and the registry commands aren’t available.

Q: if (windows of operating system) then (keys of "HKLM\Software" of registry) else (name of operating system)
A: Mac OS X

Thanks for the reply AlanM! I thought that you could only use the if statement in the action script, not the relevance for the fixlet, but it looks like as long as the answer is boolean, it works fine.

The final statement that I am using is the following:

(unix of operating system and line (1) of file "/etc/res/resauthd.conf" = "LearningMode=yes") or (mac of operating system and line (1) of file "/etc/res/resauthd.conf" = "LearningMode=yes") or (if (windows of operating system and exists service "RESPESVC") then exists values "Shell" whose (it as string as lowercase contains "explorer.exe") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" of native registry else false)

Cheers!