Posted on 10-30-2017 11:54 AM
Hi all,
A client of mine would like to have a script, or series of scripts, created to uninstall Box Sync from all computers in preparation of switching to Box Drive. Here are the uninstall instructions per Box
Follow the steps on how to uninstall Box sync in Mac.
Does anyone have input on how to best achieve this? Thanks in advance!
Posted on 10-30-2017 12:17 PM
Please test this as we don't use the application so I don't have a way to test it.
#!/bin/bash
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
#quit box sync
sudo pkill boxsync
#Copy old data
cp "/Users/$loggedInUser/Box Sync" "/Users/$loggedInUser/Desktop/Box Sync (OLD)"
# Remove old Files
rm -rf "/Users/$loggedInUser/Library/Logs/Box/Box Sync/"
rm -rf "/users/$loggedInUser/Library/Application Support/Box/Box Sync/"
rm -rf "/Library/PrivilegedHelperTools/com.box.sync.bootstrapper"
rm -rf "/Library/PrivilegedHelperTools/com.box.sync.iconhelper"
Posted on 10-30-2017 12:42 PM
Executing Policy Uninstall Box Sync
Running script Uninstall Box Sync...
Script exit code: 0
Script result: cp: /Users/royjovero/Box Sync is a directory (not copied).
Posted on 10-31-2017 05:49 AM
@royjovero change that one to cp -R instead of just cp
Posted on 11-01-2017 10:40 AM
Executing Policy Uninstall Box Sync
Running script Uninstall Box Sync...
Script exit code: 0
Script result:
Submitting log to https://casper.itjones.com:8443/
Posted on 11-01-2017 10:58 AM
@royjovero Looks like it worked then. Just make sure everything happened on the client machine that should have.
Posted on 05-09-2018 12:34 PM
In light of Box Drive slowly becoming the de facto client software, I wanted to add a bit to this thread.
Box Drive throws up a warning if Box Sync is installed, even when deployed via Self Service/Jamf. I made some modifications to the above script to completely kill and remove Box Sync because some things appear to have changed since it was created. For my environment, we don't touch the Box Sync folder to prevent any data loss or panicking, but I left it to keep things consistent
#!/bin/bash
#Set the variable for the currently logged in user
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
#Quit Box Sync
killall "Box Sync"
#Copy old user data. Change cp to mv if you prefer to move it
cp "/Users/$loggedInUser/Box Sync" "/Users/$loggedInUser/Desktop/Box Sync (OLD)"
# Remove old Box Sync application data
rm -rf "/Applications/Box Sync.app"
rm -rf "/Users/$loggedInUser/Library/Logs/Box/Box Sync/"
rm -rf "/users/$loggedInUser/Library/Application Support/Box/Box Sync/"
rm -rf "/Library/PrivilegedHelperTools/com.box.sync.bootstrapper"
rm -rf "/Library/PrivilegedHelperTools/com.box.sync.iconhelper"
In my testing/pilot, the Box Drive app is deployed through Self Service with the script running before. No errors from the uninstall/install, and data is intact.
Posted on 02-27-2019 10:12 AM
@dcgagne might want to dump the receipts, by adding to your script something like:
boxReceipts=$(pkgutil --pkgs=<receiptName>*)
for r in $boxReceipts;
do
pkgutil --forget "$r"
done
Posted on 02-27-2019 10:36 AM
The next version of Box Drive's installer will include a way to automatically uninstall Box Sync. Info here: https://community.box.com/t5/Getting-Started-with-Box-Drive/Uninstalling-Box-Sync-Using-the-Box-Drive-Installer/ta-p/66249?
Posted on 02-27-2019 11:04 AM
@float0n wow thanks for the heads up, looks like they're thinking like enterprise folks. :)