I made a custom fixlet to uninstall an msi package but it does not seem to work. I get a relevance substitution failed on the waithidden part. What am I missing here?
action parameter query "Name" with description "Please enter the Program Name"
action parameter query "Version" with description "Please enter the Program Version"
waithidden msiexec.exe /x {name of keys whose (value "DisplayName" of it as string as lowercase starts with (parameter "Name" of action) AND value "DisplayVersion" of it <= (parameter "Version" of action) AND value "UninstallString" of it contains "msiexec") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries; x32 registries)} /q
Well, there are a few things that could go wrong there. If there are no results, or multiple results, you’d get an error on the parts that use a singular expression. If there are multiple results, you’ll fail to run the commanf because the results would get merged together in the substitution. There’s a part where you are comparing a registry value, but need to cast it as a string. And you should cast the entered parameter to lowercase where you compare it (you are already correctly lowercasing the reg result).
Good job on filtering uninstallstrings containing msiexec, and on searching both x32 and x64 registries.
Try this -
waithidden msiexec.exe /x {names of keys whose (value "DisplayName" of it as string as lowercase starts with (parameter "Name" of action as lowercase) AND value "DisplayVersion" of it as string as version <= (parameter "Version" of action as version) AND value "UninstallString" of it as string as lowercase contains "msiexec") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries; x32 registries)} /q
1 Like
Thanks for the response JasonWalker. Your action script works! 
As I understand, the rule is to always have the same data type when comparing two values.
1 Like