Skip to content

Instantly share code, notes, and snippets.

@opragel
Last active March 6, 2018 02:38
Show Gist options
  • Save opragel/271b684ec53ba299d112 to your computer and use it in GitHub Desktop.
Save opragel/271b684ec53ba299d112 to your computer and use it in GitHub Desktop.
uninstall_microsoft_office_2011.sh
#!/bin/bash
# ¯\_(ツ)_/¯
REMOVE_PATHS=( "/Applications/Microsoft Office 2011/" \
"/Library/Preferences/com.microsoft.office.licensing.plist" \
"/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist" \
"/Library/PrivlegedHelperTools/com.microsoft.office.licensing.helper" \
#"/Users/*/Library/Application Support/Microsoft/Office/" \
#"/Users/*/Library/Preferences/com.microsoft*" \
#"/Users/*/Library/Preferences/ByHost/com.microsoft*" \
"/Library/Receipts/Office2011_*" )
for removePath in "${REMOVE_PATHS[@]}"
do
if [ -e "$removePath" ]; then
printf "Deleting: %s\n" "$removePath"
rm -rf "$removePath"
else
printf "Not found: %s\n" "$removePath"
fi
done
for pkg in $(pkgutil --pkgs | grep com.microsoft.*14*);do
pkgutil --forget "$pkg"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment