Last active
November 30, 2019 20:35
-
-
Save apizz/5c73836ff956ceec63c6b5ea382319e6 to your computer and use it in GitHub Desktop.
Command line uninstall of MathType 7 license
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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