Skip to content

Instantly share code, notes, and snippets.

@5t111111
Created August 17, 2014 05:26
Show Gist options
  • Save 5t111111/3bcbb628112846e9ca3a to your computer and use it in GitHub Desktop.
Save 5t111111/3bcbb628112846e9ca3a to your computer and use it in GitHub Desktop.
Native Instruments Product Uninstaller
#!/bin/sh
#
# Native Instruments Product Uninstaller
# Note:
# Pro-53: You need to find and manually uninstall Pro-53 because it has odd path and name.
if [ $# -eq 0 ]; then
echo "ERROR: You must specify a product name as a argument."
exit 1
fi
if [ $# -ne 1 ]; then
echo "ERROR: You can specify only one product at once."
exit 1
fi
PRODUCT_NAME=$1
echo "PRODUCT_NAME: ${PRODUCT_NAME}"
echo "\n--- Applications ---"
ls -l "/Applications/${PRODUCT_NAME}" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such product."
fi
echo "\n--- /Library/Preferences ---"
ls -l "/Library/Preferences/com.native-instruments.${PRODUCT_NAME}.plist" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n--- AU Plug-in ---"
ls -l "/Library/Audio/Plug-Ins/Components/${PRODUCT_NAME}.component" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n--- VST Plug-in ---"
ls -l "/Library/Audio/Plug-Ins/VST/${PRODUCT_NAME}.vst" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n--- Digidesign Plug-in ---"
ls -l "/Library/Application Support/Digidesign/Plug-Ins/${PRODUCT_NAME}.dpm" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n--- System Library File ---"
ls -l "/Library/Application Support/Native Instruments/${PRODUCT_NAME}" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n--- User Library plist ---"
ls -l "~/Library/Preferences/com.native-instruments.${PRODUCT_NAME}.plist" 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n--- User Library files ---"
ls -l "~/Library/Application Support/Native Instruments/${PRODUCT_NAME} " 2> /dev/null
if [ $? -ne 0 ]; then
echo "WARN: No such file or directory."
fi
echo "\n================================="
echo "Do you really want to proceed? : "
read answer
if [ $answer = "yes" -o $answer = "y" ]; then
mv "/Applications/${PRODUCT_NAME}" ~/.Trash/
mv "/Library/Preferences/com.native-instruments.${PRODUCT_NAME}.plist" ~/.Trash/
mv "/Library/Audio/Plug-Ins/Components/${PRODUCT_NAME}.component" ~/.Trash/
mv "/Library/Audio/Plug-Ins/VST/${PRODUCT_NAME}.vst" ~/.Trash/
mv "/Library/Application Support/Digidesign/Plug-Ins/${PRODUCT_NAME}.dpm" ~/.Trash/
mv "/Library/Application Support/Native Instruments/${PRODUCT_NAME}" ~/.Trash/
mv "~/Library/Preferences/com.native-instruments.${PRODUCT_NAME}.plist" ~/.Trash/
mv "~/Library/Application Support/Native Instruments/${PRODUCT_NAME} " ~/.Trash/
echo "Done."
exit 0
else
echo "Aborted."
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment