MacKeeper Uninstaller

gskibum
Contributor III

I'm trying to make a policy to uninstall MacKeeper, but I'm not gaining full success.

I have a Smart Group for Criteria/Application Title/Is/MacKeeper.app. I use this as the scope for the policy.

Using Composer in Casper 9.4 I have created a .dmg, indexed it and checked the "Allow package to be uninstalled" box. I also checked "FEU."

I am leaving the following items in the package:

/Applications/MacKeeper.app.

/Library/Preferences/Invisible document"

~/Library/Application Support/MacKeeper Helper/NoticeEngine.plugin
~/Library/LaunchAgents/com.zeobit.MacKeeper.Helper.plist
~/Library/Logs/MacKeeper.log
~/Library/Logs/MacKeeper.log.signed.
~/Library/Logs/SparkleUpdateLog.log
~/Library/Preferences/*another invisible document"
~/Library/Preferences/com.zeobit.MacKeeper.Helper.plist
~/Library/Preferences/com.zeobit.MacKeeper.plist

However when the policy executes not all of the items are removed. I am left with:
1. Some items inside the MacKeeper.app bundle remain. Others are removed. I can elaborate if needed.
2. ~/Library/Application Support/MacKeeper Helper/NoticeEngine.plugin

So I am getting a partial removal of MacKeeper. Since part of the application bundle remains the devices never fall out of scope.

Has anyone had any luck creating such an uninstaller? What a I missing?

Thanks!

43 REPLIES 43

mjhersh
Contributor

@howie_isaacks I think there's a mistake in your script's rm commands like this:

rm -rf $currentuser $HOME/"MacKeeper Backups";

This is deleting a folder called $currentuser in the current working directory, then also deleting $HOME/MacKeeper Backups. I don't think you intend to delete (repeatedly!) a mystery folder named after the current logged in user, but that's what it's doing. You might want to do something like this instead:

eval 'rm -rf "~$currentuser/MacKeeper Backups"'

Or possibly

rm -rf "$HOME/MacKeeper Backups"

I don't remember off the top of my head whether $HOME works in the context of a Casper script. I think it will return root's home, not the logged in user's, which is not especially useful.

You might want to go a step further and also do this:

rm -rf /Users/*/"MacKeeper Backups"

BeBu
New Contributor

I found a quite good solution for me looking at clients with more than one users working on it.

I tested it successfully in a VM therefore try it yourself.

#!/bin/sh

#stopping MacKeeper 
killall "MacKeeper Helper"
killall MKCleanService
killall MacKeeper

#stopping the daemons
launchctl unload com.mackeeper.MacKeeper.MacKeeperPrivilegedHelper
launchctl unload com.mackeeper.AdwareAnalyzer.AdwareAnalyzerPrivilegedHelper
launchctl unload com.mackeeper.Cerberus

#remove main app
rm -Rf /Applications/MacKeeper.app

# remove mackeeper from HomeDirectories
rm -Rf /Users/*/Library/Application Support/*mackeeper*
rm -Rf /Users/*/Library/Application Support/*MacKeeper*
rm -Rf /Users/*/Library/LaunchAgents/com.mackeeper*
rm -Rf /Users/*/Library/Logs/MacKeeper*
rm -Rf /Users/*/Library/Preferences/com.mackeeper*
rm -Rf /Users/*/MacKeeper*
rm -Rf /Users/*/Library/Saved Application State/com.zeobit.MacKeeper.savedState
rm -Rf /Users/*/Library/Preferences/com.zeobit.MacKeeper*
rm -Rf /Users/*/Library/Preferences/.3FAD0F65-FC6E-4889-B975-B96CBF807B78

#remove mackeeper from systemdirectories
rm -Rf /Library/LaunchDaemons/com.mackeeper*
rm -Rf /Library/PrivilegedHelperTools/com.mackeeper*
rm -Rf /Library/Preferences/.3FAD0F65-FC6E-4889-B975-B96CBF807B78

larry_barrett
Valued Contributor

Main app is in /Users/*/Applications on the ones I've done.

larry_barrett
Valued Contributor

I've actually started to see some success on this one. I had 4 computers report back in that its completely gone (we'll see). This is a combo of a few different scripts above. Right now i'm at a 50% success rate (sometimes it takes two tries).

#!/bin/sh

#Determine User
user=`ls -l /dev/console | cut -d " " -f 4`

if [ -d /Applications/MacKeeper.app/ ];then
    rm -r /Applications/MacKeeper.app/
    echo "Removed MacKeeper from Applications"
else
    echo "MacKeeper not found"
fi


#stopping MacKeeper 
killall "MacKeeper Helper"
killall MKCleanService
killall MacKeeper

#stopping the daemons
launchctl unload com.mackeeper.MacKeeper.MacKeeperPrivilegedHelper
launchctl unload com.mackeeper.AdwareAnalyzer.AdwareAnalyzerPrivilegedHelper
launchctl unload com.mackeeper.Cerberus

#remove main app
rm -Rf /Applications/MacKeeper.app

# remove mackeeper from HomeDirectories
rm -Rf /Users/$user/Library/Application Support/*mackeeper*
rm -Rf /Users/$user/Library/Application Support/*MacKeeper*
rm -Rf /Users/$user/Library/LaunchAgents/com.mackeeper*
rm -Rf /Users/$user/Library/Logs/MacKeeper*
rm -Rf /Users/$user/Library/Preferences/com.mackeeper*
rm -Rf /Users/$user/MacKeeper*
rm -Rf /Users/$user/Library/Saved Application State/com.zeobit.MacKeeper.savedState
rm -Rf /Users/$user/Library/Preferences/com.zeobit.MacKeeper*
rm -Rf /Users/$user/Library/Preferences/.3FAD0F65-FC6E-4889-B975-B96CBF807B78

# Files Outside Home Folder

rm -rf /Applications/MacKeeper.app
rm -rf /Library/Preferences/.3FAD0F65-FC6E-4889-B975-B96CBF807B78
rm -rf /private/var/folders/mh/yprf0vxs3mx_n2lg3tjgqddm0000gn/T/MacKeeper*
rm -rf /private/tmp/MacKeeper*

# Files inside home folder
rm -rf /Users/$user/Library/Application Support/MacKeeper Helper
rm -rf /Users/$user/Library/Launch Agents/com.zeobit.MacKeeper.Helper.plist
rm -rf /Users/$user/Library/Logs/MacKeeper.log
rm -rf /Users/$user/Library/Logs/MacKeeper.log.signed
rm -rf /Users/$user/Library/Logs/SparkleUpdateLog.log
rm -rf /Users/$user/Library/Preferences/.3246584E-0CF8-4153-835D-C7D952862F9D
rm -rf /Users/$user/Library/Preferences/com.zeobit.MacKeeper.Helper.plist
rm -rf /Users/$user/Library/Preferences/com.zeobit.MacKeeper.plist
rm -rf /Users/$user/Library/Saved Application State/com.zeobit.MacKeeper.savedState
rm -rf /Users/$user/Downloads/MacKeeper*
rm -rf /Users/$user/Documents/MacKeeper*

#remove mackeeper from systemdirectories
rm -Rf /Users/$user/Library/LaunchDaemons/com.mackeeper*
rm -Rf /Users/$user/Library/PrivilegedHelperTools/com.mackeeper*
rm -Rf /Users/$user/Library/Preferences/.3FAD0F65-FC6E-4889-B975-B96CBF807B78

killall "MacKeeper Helper";
rm -rf /Users/$user/Applications/MacKeeper.app;
rm -rf /Users/$user/Library/LaunchDaemons/com.mackeeper.AdwareAnalyzer.AdwareAnalyzerPrivilegedHelper.plist;
rm -rf /Users/$user/Library/LaunchDaemons/com.mackeeper.MacKeeper.MacKeeperPrivilegedHelper.plist;
rm -rf /Users/$user/Library/PrivilegedHelperTools/com.mackeeper.AdwareAnalyzer.AdwareAnalyzerPrivilegedHelper;
rm -rf /Users/$user/Library/PrivilegedHelperTools/com.mackeeper.MacKeeper.MacKeeperPrivilegedHelper;
rm -rf /Users/$user/Library/Application Support/com.mackeeper.AdwareAnalyzer;
rm -rf /Users/$user/Library/Application Support/com.mackeeper.MacKeeper;
rm -rf /Users/$user/Library/Application Support/com.mackeeper.MacKeeper.Helper;
rm -rf /Users/$user/Library/Application Support/com.mackeeper.MacKeeper.MKCleanService;
rm -rf /Users/$user/Library/Application Support/MacKeeper;
rm -rf /Users/$user/Library/Application Support/MacKeeper 3;
rm -rf /Users/$user/Library/LaunchAgents/com.mackeeper.AdwareAnalyzer.plist;
rm -rf /Users/$user/Library/LaunchAgents/com.mackeeper.MacKeeper.Helper.plist;
rm -rf /Users/$user/"MacKeeper Backups";