Fixlet & Relevance give different results for the same check

Hello All,

I am working on finding Java and removing old versions (thanks dakota for providing the removal solution side), but if the latest Java does not exists I need to install it.
I worked on the bellow.

The Computer Relevance gives a True result (as expected) but the Fixlett gives a False result (the fixlett creates “C:\windows\temp\JAVA-FALSE4” folder) and I do not know why?

Please can any one shed some light on this, or point where I have gone wrong?

The Computer Relevance (that seems to work as expteced) :-

exists keys whose (value “DisplayName” of it as string equals “Java 8 Update 231” ) of keys “HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\uninstall” of (x64 registries;x32 registries)

Value retuned is TRUE

A Fixlett using the same code returns False :-

if (exists keys whose (value “DisplayName” of it as string equals “Java 8 Update 231” ) of keys “HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\uninstall” of (x64 registries;x32 registries)) then

folder create C:\windows\temp\JAVA-TRUE4

else

folder create C:\windows\temp\JAVA-FALSE4

On the machine that the relevance works on (True result), the fixlett creates “C:\windows\temp\JAVA-FALSE4” folder and I do not know why?

Many Thanks
Paul

Hello,

Is that the exact text of your fixlet? I see some syntax errors which may be leading to unexpected behavior. Could you please paste the entire script of your fixlet (and as an added bonus, put it between ``` tags on the top and bottom so it formats it nicely?)

Hello alinder,
Yes this is the basic “if” code I have to verify against machines.
Please let me know where I have gone wrong.

Many Thanks
Paul

There are a couple of things wrong here. The first is that if clauses in Action Script are formatted differently than in relevance. They should follow this basic pattern:

if {relevance clause}
action to perform
else 
action to perform
endif 

You will need to put the relevance you’re evaluating into curly braces to indicate that it is relevance, get rid of “then,” and end it with “endif.” See if this works:

if {exists keys whose (value "DisplayName" of it as string equals "Java 8 Update 231" ) of keys "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\uninstall" of (x64 registries;x32 registries)}

folder create C:\windows\temp\JAVA-TRUE4

else

folder create C:\windows\temp\JAVA-FALSE4

endif
1 Like

Hello alinder,

Perfect. Much appreciated.

Many Thanks for your help

Paul

1 Like