Skip to content

Instantly share code, notes, and snippets.

@apizz
Last active November 30, 2019 20:35
Show Gist options
  • Select an option

  • Save apizz/5c73836ff956ceec63c6b5ea382319e6 to your computer and use it in GitHub Desktop.

Select an option

Save apizz/5c73836ff956ceec63c6b5ea382319e6 to your computer and use it in GitHub Desktop.
Command line uninstall of MathType 7 license
#!/bin/bash
# MathType 7 license uninstall
APP_DIR="/Applications/MathType"
APP="${APP_DIR}/MathType.app"
EXE_PATH="${APP_DIR}/System/MathTypeLib"
PLIST="${APP}/Contents/Info.plist"
# Dummy receipt
RECEIPT="/Library/Receipts/.MathType7"
VERSION=$(/usr/bin/defaults read "$PLIST" CFBundleVersion)
# License removal dependent on version 7.4.4 or later
if [ "$VERSION" = "7.4.4" ] || [ "$VERSION" > "7.4.4" ]; then
/bin/echo "Uninstalling MathType 7 license ..."
"$EXE_PATH" -d
exitcode=$(/bin/echo $?)
fi
if [ -f "$RECEIPT" ]; then
/bin/echo "Removing license receipt ..."
/bin/rm "$RECEIPT"
fi
exit $exitcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment