(imported comment written by brolly3391)
Hey Bjowah,
It is a common error when I teach the action script part of the Custom Content class to try to use relevance substitution inside of relevance substitution. This is what Tyler was pointing out to you in his post above.
wait {some relevance}
The part inside of the curly brackets will be evaluated as relevance and the result substituted into the action script.
wait {some relevance {some other relevance} }
The inner {} characters are redundant and cause an error because you are already in relevance because of the outer {}. You might want to trade out those internal curly braces {} for parenthesis ().
wait {some relevance (some other relevance) }
I hope that I have explained that clearly. Now let’s apply that to your action script.
wait {(value “uninstallstring” of it as string as lowercase) of key whose (value “displayname” of it as string as lowercase contains (parameter “sKeyword” of action)) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
Now, if there is more than one registry key that meets the relevance, then you have a plural result trying to go into the wait command, which also fails. This is what Jesse was pointing out. The best way to handle that, assuming that you want all the programs that meet your relevance to be uninstalled, is to build a .BAT file with the appendfile command and then run the .BAT file. This works because appendfile will handle plural results by adding a line for each result into the file.
delete __appendfile
appendfile {(value “uninstallstring” of it as string as lowercase) of keys whose (value “displayname” of it as string as lowercase contains (parameter “sKeyword” of action)) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
delete temp.bat
copy __appendfile temp.bat
wait temp.bat
delete temp.bat
Additional note: Sometimes you need to put a curly brace into relevance that will be in an action script, such as if you need to have a GUID as part of a registry key. You can use these hex substitutions; “%7b” for { and “%7d” for } when this becomes necessary. This is not the case in the issue above; I just wanted you to be aware.
And finally, we have been asking for an action script debugger for as long as I have been using BigFix - 3 years now. It is not likely. There are security context issues. The best way to debug your actions is to use a custom action and paste your action script in and let a real client on a test box run your script.
Cheers,
Brolly