How to Uninstall Crashplan Pro

rgranholm
Contributor

Hello Admins,

Anyone run through the instance of needing to uninstall Crashplan Pro?

Can you simply use the JSS uninstall after indexing the .pkg ... or do you attempt to use their built in uninstaller, as per their instructions below?

Advice welcome and asked for.

Open the Finder.
Press Command-Shift-G
A dialog box appears: Go to the folder.
Paste this text into the dialog box:
Installed for everyone: /Library/Application Support/CrashPlan/Uninstall.app
Installed per user: ~/Library/Application Support/CrashPlan/Uninstall.app
Click Go.
Double-click Uninstall.
Follow the prompts to complete the uninstall process. <---- PROBLEMATIC IF TRYING TO BE AUTOMATED WHICH I AM
Remove the following directory from your system:
Installed for everyone: /Library/Application Support/CrashPlan
Installed per user: ~/Library/Application Support/CrashPlan​

8 REPLIES 8

kendalljjohnson
Contributor II

I haven't played with it for mass deployment, but there's an uninstall.sh inside the Uninstall.app that you might be able to specifically call or put into your JSS.

Library/Application Support/CrashPlan/Uninstall.app/Contents/Resources/uninstall.sh ~Library/Application Support/CrashPlan/Uninstall.app/Contents/Resources/uninstall.sh

If it's a per user install, you'll have to use "su" to switch to run the command as the logged in user so it will work through that user's home folder rather than your admin/JSS admin account that is issuing the command.

rgranholm
Contributor

Interesting, I guess I'll have to play with that script.

There needs to be a functionality built in for scripts to simply run as logged in user because building scripts to account for that is annoying.

Thanks

peguesrc
New Contributor

I've tried to uninstall via the process listed but nothing happens. Even when you go to the applications folder, the application remains. However, when you try and click the application and manually drag it to the Trash, applications gives the prompt "locked".

Have either of you guys experienced or seen this issue?

kendalljjohnson
Contributor II

@peguesrc

I have not seen that, might be something with permissions or something along those lines when installed?

I currently have CrashPlan installing per user, with the eventual goal of switching to all users. The script I have played with so far has worked for me. Here's the beginning that performs the per user uninstall:

#!/bin/bash

#Define logged in user
user=`ls -la /dev/console | cut -d " " -f 4`

#uninstall CrashPlan from ~/Applications
sudo su $user /Users/$user/Applications/CrashPlan.app/Contents/.Uninstall.app/Contents/Resources/uninstall.sh

The script goes on from there to perform the install for all users and use our custom branding and automatically pull the user's CrashPlan account info over, so it doesn't start a new backup.

dustin_brandt
New Contributor

We recently decided to get rid of CrashPlan ProE, and came here looking for solutions to the same issues:

  • CrashPlan wouldn't uninstall unless you manually clicked through the uninstall app at /Library/Application Support/CrashPlan/uninstall
  • All attempts to remove it via script seemed to fail in some way or another (either not doing anything, leaving leftover cruft, erroring out because of permissions issues, or failing on locked files)

In the end, we sat down and parsed through the uninstall.sh (in our installation, it was located at: /Library/Application Support/CrashPlan/Uninstall.app/Contents/Resources/uninstall.sh) file that the Uninstall.app package seems to use, and found that there were only a handful of actual removal commands that needed to be called to seemingly wipe this out.

We were running CrashPlan client v5.4.1 on Mac OS 10.12.x - 10.14.x

Note: we were so frustrated that we used a bit of a brute force approach to finding/removing files. CrashPlan's uninstall script goes through some elegant dances to determine whether the package was installed as admin in root libraries or whether it was installed in the local user's libraries. We stopped caring after about the 4th hour of failing to wipe everything out, and just deleted everything from all possible locations (we also started sudo-ing everything for the same reason). I'm sure there are elegant ways to check for files or utilize more of the logic from Code42's script (and we may continue to refine), but this is what did it in the end.

#!/bin/bash

# 2018.12.4: DB: America's Test Kitchen
# Script functional items parsed from Code42 uninstall.sh, located on client machine at:
# /Library/Application Support/CrashPlan/Uninstall.app/Contents/Resources/uninstall.sh

# Call the stop script to stop the crashplan service
sudo /Applications/Crashplan.app/Contents/Resources/Code42/bin/stop.sh
# Use pkill to kill anything named "CrashPlan"
sudo pkill -a CrashPlan
# Force verbose remove plist files (from root AND local user locations)
sudo rm -fv /Library/LaunchDaemons/com.crashplan.engine.plist
sudo rm -fv ~/Library/LaunchDaemons/com.crashplan.engine.plist
sudo rm -fv /Library/LaunchAgents/com.code42.menubar.plist
sudo rm -fv ~/Library/LaunchAgents/com.code42.menubar.plist

# Change the flags on the CrashPlan.app in Applications (to get rid of the app lock)
sudo chflags noschg /Applications/CrashPlan.app

# Recursive Force verbose remove the Crashplan app, Logs, Caches, and Receipts
sudo rm -rfv /Applications/CrashPlan.app
sudo rm -rfv /Library/Logs/CrashPlan
sudo rm -rfv /Library/Caches/CrashPlan
sudo rm -rfv /Library/Receipts/*CrashPlan*

# Recursive force verbose remove the Library items (from root AND local user locations)
sudo rm -rfv /Library/CrashPlan
sudo rm -rfv ~/Library/CrashPlan
sudo rm -rfv /Library/Application Support/CrashPlan
sudo rm -rfv ~/Library/Application Support/CrashPlan
sudo rm -rfv /Library/Application Support/CrashPlan
sudo rm -rfv ~/Library/Application Support/CrashPlan

#The Code42 uninstall script has this pkgutil clean up, but it seems to be for the uninstall.app. It throws an error when included.
#sudo pkgutil --forget com.crashplan

# Since the above throws an error, we just brute force cleaned up the /var/db/receipts
sudo rm -fv /private/var/db/receipts/com.crashplan.app.pkg.bom
sudo rm -fv /private/var/db/receipts/com.crashplan.app.pkg.plist

# Just for fun
sudo osascript -e 'say "trash plan!"'

We're still refining a bit, and running from Remote, currently, indicates that an error is thrown, but despite that, everything is gone.

gachowski
Valued Contributor II

@dustin.brandt

What is your replacement backup utility/plan?

C

mario
New Contributor III

Could also build an uninstaller from this template:

https://github.com/palantir/mac-jamf/tree/master/scripts/script-templates/uninstaller-template

$vendorUninstallerPaths=(
  "/Library/Application Support/CrashPlan/Uninstall.app/Contents/Resources/uninstall.sh"
)

$processNames=(
  "Code42 CrashPlan"
  "CrashPlan"
)

$resourceFiles=(
  "/Applications/CrashPlan.app"
  "/Library/Application Support/CrashPlan/"
  "/Library/CrashPlan/"
  "$loggedInUserHome/Library/Application Support/CrashPlan/"
)

Should catch everything that Code42 CrashPlan installs. It'll run the vendor uninstaller script first to catch a lot of things, and then pick up any stragglers.

macguitarman
New Contributor III

This does work, tested and tested regarding an install of Code42.

Code42 and CrashPlan are separate/distinct now?

You quickly find out, Code42's Uninstaller is an app, which is essentially useless in an MDM...

And then you also realize, their uninstaller script does not really work... hence a brute force stop and remove stuff...

#!/bin/bash

# removes code42 / crash plan

if [[ -e /Library/Application\ Support/CrashPlan/ ]]; then
echo "Code42/CrashPlan found..."
echo "Unloading and deleting code42/crashplan launchdaemons, if present/running..."
launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist
launchctl unload /Library/LaunchDaemons/com.code42.service.plist
rm -rf /Library/LaunchDaemons/com.code42.service.plist
echo "Unlocking and Deleting Code42/CrashPlan..."
sudo chflags -R noschg /Applications/Code42.app
rm -rf /Library/Application\ Support/CrashPlan/
rm -rf /Applications/Code42.app
rm -rf /Library/Caches/CrashPlan/
echo "Code42/CrashPlan Deleted, Yeah!"
else
echo "No Code42 or CrashPlan found, nothing to remove!"
fi