Just wanted to share something I got working today in my Friday afternoon Google Time.
This is stolen "adapted" from Joe Farage's Reader updating script, but designed to update Acrobat Pro DC.
#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# AdobeAcrobatUpdate.sh -- Installs or updates Adobe Acrobat Pro DC
#
# SYNOPSIS
# sudo AdobeAcrobatUpdate.sh
#
####################################################################################################
#
# HISTORY
#
# Version: 1.2
#
# - v.1.0 Joe Farage, 23.01.2015
# - v.1.1 Joe Farage, 08.04.2015 : support for new Adobe Acrobat DC
# - v.1.2 Deej, 10.11.2017: fork Reader script for Adobe Acrobat DC
#
####################################################################################################
# Script to download and install Adobe Acrobat Updates.
# Only works on Intel systems.
dmgfile="acrobat.dmg"
logfile="/Library/Logs/AdobeAcrobatDCUpdateScript.log"
# Are we running on Intel?
if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
## Get OS version and adjust for use with the URL string
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' )
## Set the User Agent string for use with curl
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"
# Get the latest Update available from Adobe's Acrobat Support page.
latestver=``
while [ -z "$latestver" ]
do
latestver=`/usr/bin/curl -s -L -A "$userAgent" "http://supportdownloads.adobe.com/product.jsp?platform=macintosh&product=1" | grep '"data-sectionHead">Version' -m 1 | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $2}'`
done
echo "Latest Version is: $latestver"
latestvernorm=`echo ${latestver} | sed -e 's/20//'`
# Get the version number of the currently-installed Adobe Acrobat, if any.
if [ -e "/Applications/Adobe Acrobat DC/Adobe Acrobat.app" ]; then
currentinstalledver=`/usr/bin/defaults read /Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Info CFBundleShortVersionString`
echo "Current installed version is: $currentinstalledver"
if [ ${latestvernorm} = ${currentinstalledver} ]; then
echo "Adobe Acrobat DC is current. Exiting"
exit 0
fi
else
currentinstalledver="none"
echo "Adobe Acrobat DC is not installed"
fi
ARCurrVersNormalized=$( echo $latestver | sed -e 's/[.]//g' -e 's/20//' )
echo "ARCurrVersNormalized: $ARCurrVersNormalized"
url=""
url1="http://ardownload.adobe.com/pub/adobe/acrobat/mac/AcrobatDC/${ARCurrVersNormalized}/AcrobatDCUpd${ARCurrVersNormalized}.dmg"
url2=""
#Build URL
url=`echo "${url1}${url2}"`
echo "Latest version of the URL is: $url"
# Compare the two versions, if they are different or Adobe Acrobat is not present then download and install the new version.
if [ "${currentinstalledver}" != "${latestvernorm}" ]; then
/bin/echo "`date`: Current Acrobat DC version: ${currentinstalledver}" >> ${logfile}
/bin/echo "`date`: Available Acrobat DC version: ${latestver} => ${latestvernorm}" >> ${logfile}
/bin/echo "`date`: Downloading newer version." >> ${logfile}
/usr/bin/curl -s -o /tmp/acrobat.dmg ${url}
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
/usr/bin/hdiutil attach /tmp/acrobat.dmg -nobrowse -quiet
/bin/echo "`date`: Installing..." >> ${logfile}
/usr/sbin/installer -pkg /Volumes/AcrobatDCUpd${ARCurrVersNormalized}/AcrobatDCUpd${ARCurrVersNormalized}.pkg -target / > /dev/null
/bin/sleep 10
/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
/usr/bin/hdiutil detach /Volumes/AcrobatDCUpd${ARCurrVersNormalized} -quiet
/bin/sleep 10
/bin/echo "`date`: Deleting disk image." >> ${logfile}
/bin/rm /tmp/${dmgfile}
#double check to see if the new version got updated
newlyinstalledver=`/usr/bin/defaults read /Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Info CFBundleShortVersionString`
if [ "${latestvernorm}" = "${newlyinstalledver}" ]; then
/bin/echo "`date`: SUCCESS: Adobe Acrobat has been updated to version ${newlyinstalledver}" >> ${logfile}
# /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "Adobe Acrobat Updated" -description "Adobe Acrobat has been updated." &
else
/bin/echo "`date`: ERROR: Adobe Acrobat update unsuccessful, version remains at ${currentinstalledver}." >> ${logfile}
/bin/echo "--" >> ${logfile}
exit 1
fi
# If Adobe Acrobat is up to date already, just log it and exit.
else
/bin/echo "`date`: Adobe Acrobat is already up to date, running ${currentinstalledver}." >> ${logfile}
/bin/echo "--" >> ${logfile}
fi
else
/bin/echo "`date`: ERROR: This script is for Intel Macs only." >> ${logfile}
fi
exit 0