v1.0 = New Acrobat Uninstall Script

+ This script handles all Acrobat Versions going forward
 - Removed previous version specific scripts
This commit is contained in:
Zack T
2018-07-06 13:52:44 -07:00
parent fd2504d739
commit 3680c88b58
3 changed files with 84 additions and 46 deletions

View File

@@ -0,0 +1,84 @@
#!/bin/bash
###################################################################################################
# Script Name: uninstall_Acrobat.sh
# By: Zack Thompson / Created: 6/30/2017
# Version: 1.0 / Updated: 7/6/2018 / By: ZT
#
# Description: This script uninstalls Acrobat DC versions.
#
###################################################################################################
echo "***** Uninstall Adobe Acrobat process: START *****"
##################################################
# Define Variables
exit="0"
# Turn on case-insensitive pattern matching
shopt -s nocasematch
# Determine what was requested to uninstall
for arg in "$@"; do
case $arg in
"2015" | "v12" )
toRemove+=("12")
;;
"2017" | "v17" )
toRemove+=("17")
;;
"2018" | "v18" )
toRemove+=("18")
;;
"All" )
toRemove+=("12")
toRemove+=("17")
toRemove+=("18")
;;
esac
done
# Turn off case-insensitive pattern matching
shopt -u nocasematch
echo "Provided versions to remove: ${toRemove[@]}"
##################################################
# Bits staged...
echo "Searching for existing Adobe Acrobat instances..."
appPaths=$(/usr/bin/find -E /Applications -iregex ".*[/]Adobe Acrobat[.]app" -type d -prune)
# Verify that a Adobe Acrobat version was found.
if [[ -z "${appPaths}" ]]; then
echo "Did not find an instance of Adobe Acrobat!"
else
# If the machine has multiple Adobe Acrobat Applications, loop through them...
while IFS="\n" read -r appPath; do
# Get the Acrobat version string
appVersion=$(/usr/bin/defaults read "${appPath}/Contents/Info.plist" CFBundleShortVersionString | /usr/bin/awk -F '.' '{print $1}')
if [[ "${toRemove[@]}" =~ "${appVersion}" ]]; then
echo "Uninstalling: Adobe Acrobat v${appVersion}"
case $appVersion in
"12" )
exitOutput=$("${appPath}/Contents/Helpers/Acrobat Uninstaller.app/Contents/MacOS/RemoverTool" "${appPath}/Contents/Helpers/Acrobat Uninstaller.app/Contents/MacOS/RemoverTool" "${appPath}")
;;
"17" | "18" )
exitOutput=$("${appPath}/Contents/Helpers/Acrobat Uninstaller.app/Contents/Library/LaunchServices/com.adobe.Acrobat.RemoverTool" "${appPath}")
;;
esac
if [[ $exitOutput != *"because you dont have permission to access"* ]]; then
echo " -> Success"
else
echo " -> Failed"
exit="1"
fi
fi
done < <(echo "${appPaths}")
fi
echo "***** Uninstall Adobe Acrobat process: COMPLETE *****"
exit $exit

View File

@@ -1,23 +0,0 @@
#!/bin/bash
###################################################################################################
# Script Name: uninstall_AcrobatDC2015.sh
# By: Zack Thompson / Created: 6/30/2017
# Version: 1.0 / Updated: 6/30/2017 / By: ZT
#
# Description: This script uninstalls Acrobat DC v2015.
#
###################################################################################################
# Call the built-in uninstall mechanism if the application is currently installed.
/bin/echo "Checking if Acrobat DC v2015 is currently installed..."
if [[ -e "/Applications/Adobe Acrobat DC/Adobe Acrobat.app" ]]; then
/bin/echo "Uninstalling Acrobat DC v2015..."
"/Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/MacOS/RemoverTool" "/Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/MacOS/RemoverTool" "/Applications/Adobe Acrobat DC/Adobe Acrobat.app"
/bin/echo "Uninstall Complete!"
else
/bin/echo "Acrobat DC v2015 is not installed."
fi
exit 0

View File

@@ -1,23 +0,0 @@
#!/bin/bash
###################################################################################################
# Script Name: uninstall_AcrobatPro2017.sh
# By: Zack Thompson / Created: 6/30/2017
# Version: 1.0 / Updated: 6/30/2017 / By: ZT
#
# Description: This script uninstalls Acrobat Pro v2017.
#
###################################################################################################
# Call the built-in uninstall mechanism if the application is currently installed.
/bin/echo "Checking if Acrobat Pro v2017 is currently installed..."
if [[ -e "/Applications/Adobe Acrobat 2017/Adobe Acrobat.app" ]]; then
/bin/echo "Uninstalling Acrobat Pro v2017..."
"/Applications/Adobe Acrobat 2017/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/MacOS/RemoverTool" "/Applications/Adobe Acrobat 2017/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/MacOS/RemoverTool" "/Applications/Adobe Acrobat 2017/Adobe Acrobat.app"
/bin/echo "Uninstall Complete!"
else
/bin/echo "Acrobat Pro v2017 is not installed."
fi
exit 0