Updating Chrome on Macs

mikelinde
New Contributor

I am trying to add a new Chrome pkg to Self Service. I have seen 2 different issues. One is that it still brings the KSADMIN error. The other is that is sometimes does not overwrite the old version of Chrome. I am ok with allowing auto updates, but curious how to do that properly. I thought just allowing applications to run from the ~/Library/Google would work, but that was not the case. Suggestions and ideas. Not real strong in scripting, but would appreciate some assistance.

1 REPLY 1

MAD0oM
Contributor
I use this with a policy:


####################################################################################################
# Script to download and install Google.
# Only works on Intel systems.

dmgfile="googlechrome.dmg"
volname="Google Chrome"
logfile="/Library/Logs/GoogleChromeInstallScript.log"

url='https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg'

# Are we running on Intel?
if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
        /bin/echo "--" >> ${logfile}
        /bin/echo "`date`: Downloading latest version." >> ${logfile}
        /usr/bin/curl -s -o /tmp/${dmgfile} ${url}
        /bin/echo "`date`: Mounting installer disk image." >> ${logfile}
        /usr/bin/hdiutil attach /tmp/${dmgfile} -nobrowse -quiet
        /bin/echo "`date`: Installing..." >> ${logfile}
        ditto -rsrc "/Volumes/${volname}/Google Chrome.app" "/Applications/Google Chrome.app"
        /bin/sleep 10
        /bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
        /usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep "${volname}" | awk '{print $1}') -quiet
        /bin/sleep 10
        /bin/echo "`date`: Deleting disk image." >> ${logfile}
        /bin/rm /tmp/"${dmgfile}"
else
    /bin/echo "`date`: ERROR: This script is for Intel Macs only." >> ${logfile}
fi

exit 0