I am working on a fixlet that will uninstall Microsoft Security Essentials (MSE). I have the uninstall command in a task, but I would like to make the task relevant to only those machines that have MSE installed. I have:
exists regapp “msseces.exe”
in my relevance. That is an executable in the MSE install directory. Still, no computers are showing up as relevant. I am certain of at least fifty that are out there in my site. What is the best way to check a machine to see whether or not a certain piece of software is installed?
Unfortunately, not all programs are properly registered with the “RegApp” system.
Try adding something like this …
exists key whose (exists value “DisplayName” whose (it as string as lowercase contains “microsoft security essentials” ) of it) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry
This will return TRUE if there is an Uninstall key that has a DisplayName of “Microsoft Security Essentials”
I would add to @TimRice 's reply with some slight changes:
exists keys whose (exists value "DisplayName" whose (it as string as lowercase contains "microsoft security essentials" ) of it) of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries;x32 registries)
Also, you should test the above relevance in the Fixlet Debugger on a system that you know has MSE installed first, then put it in an analysis property to see what all systems return in terms of TRUE/FALSE to see how it works there. Then put it in your uninstallation Fixlet/Task.
This may get better in future releases. It looks like some programs installed horribly and were confusing the scan through the registry which isn’t that dissimilar to the relevance mentioned
Sorry for the delayed reply here. The suggested relevance worked great. Only the computers with MSE installed show up as relevant, which are none in my case.