Hi, I’m trying to create a Fixlet / Task to uninstall all instances of MS Silverlight and MS Silverlight SDK from workstations. This is what i have so far:
//Comment
parameter "baseFolder" = "__Download/"
parameter "logFolder" = "{parent folder of client folder of current site | data folder of client}/__Global/PGWLogs"
folder create "{parameter "logFolder"}"
parameter "logFile" = "PGW.log"
delete __createfile
delete run.bat
createfile until _end_
@ECHO OFF
cd "{parameter "baseFolder"}"
mkdir "{parameter "logFolder"}"
echo %DATE:~10,4%_%DATE:~4,2%_%DATE:~7,2% %time% - Action ID: {id of active action as string | "Debugger" as string} - Silverlight >> "{parameter "logFolder"}/{parameter "logFile"}"
MsiExec.exe /X {(names of keys whose (value "DisplayName" of it is "Microsoft Silverlight") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of x64 registries)} /qn >> "{parameter "logFolder"}/{parameter "logFile"}" 2>&1
echo Return code: %errorlevel% >> "{parameter "logFolder"}/{parameter "logFile"}"
echo. >> "{parameter "logFolder"}/{parameter "logFile"}"
_end_
move __createfile run.bat
override wait
hidden=true
completion=job
wait run.bat
As soon as I modify the clause’ {(names of keys whose (value “DisplayName” of it is “Microsoft Silverlight”)’ to ‘contains’ or ‘starts with’ anything else, it throws an error at the line ‘createfile untill end end’
Thank you very much for the quick reply! This has resolved the Action. I’m still having issues with the Relevance. When I add of it as string, the number of Applicable device goes down. Not up as i would expect
(windows of operating system) and (version of operating system >= "6.1") and (x64 of
operating system) and (if exists property "in proxy agent context" then ( not in proxy agent
context ) else true) and (exists keys whose (value "DisplayName" of it as string contains
"Microsoft Silverlight") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of x64 registries)
This should work with basically no changes for 90% of MSI installed applications. For non-MSI installed applications it is much more complicated and careful testing and custom changes are likely required.
The script requires creation of 2 BigFix properties, which it will tell you if it finds them or not. They are here:
If you do not currently have these properties, you would need to create them and then wait a while for systems to report into them before running the generator script.
This does not currently handle per-user installed applications.