How to update Chrome automatically

New Contributor II

I have just written a blog post on how to automatically update Google Chrome using Jamf if anyone is interested. You can find my blog post here:

I have seen a few different methods posted here, but most require some admin intervention (uploading new packages, changing version numbers etc.) but this method is fully automated. Create the Extension Attribute, Smart Group and Policy and you're good to go! Every time Google release a new version of Chrome, this script will automatically grab it and install it on your Macs.

132 REPLIES 132

Contributor III

thanks @msw-sa Im going to get this script on my macs this weekend . i appreciate the help

New Contributor II


New Contributor II

@msw-sa This is awesome! I tried it out on a test unit, and it worked perfectly. If you don't mind me asking, what is your execution frequency set to and what is toggled on your maintenance tab?

Contributor III

@ryan.ball I have not got any errors on this script but it should still be working well, that Python script works I tested that one very nice!

chromeVersion=$(/usr/bin/defaults read "$chromePath/Contents/Info.plist" CFBundleShortVersionString)
chromeMajorVersion=$(/usr/bin/awk -F '.' '{print $1}' <<< "$chromeVersion")
updateURL=$(/usr/bin/defaults read "$chromePath/Contents/Info.plist" KSUpdateURL)
productID=$(/usr/bin/defaults read "$chromePath/Contents/Info.plist" KSProductID)

# Check if Chrome is installed
if [[ ! -e "$chromePath" ]]; then
    echo "Error: $chromePath not found"
    exit 1

# Determine KeystoneRegistration.framework path
if [[ $chromeMajorVersion -ge 75 ]] ; then
    frameworkPath="$chromePath/Contents/Frameworks/Google Chrome Framework.framework/Versions/$chromeVersion/Frameworks/KeystoneRegistration.framework"
    resourcesPath="$chromePath/Contents/Frameworks/Google Chrome Framework.framework/Versions/$chromeVersion/Resources"
    frameworkPath="$chromePath/Contents/Versions/$chromeVersion/Google Chrome Framework.framework/Versions/A/Frameworks/KeystoneRegistration.framework"
    resourcesPath="$chromePath/Contents/Versions/$chromeVersion/Google Chrome Framework.framework/Versions/A/Resources"

# Check if framework exists
if [[ ! -e "$frameworkPath" ]]; then
    echo "Error: KeystoneRegistration.framework not found"
    exit 1

# Run preflight script to ensure suitable environment for Keystone installation
if ! "$resourcesPath/" > /dev/null ; then
    echo "Error: failed with code $exitCode"
    exit "$exitCode"

# Install the current Keystone
if ! "$frameworkPath/Resources/ksinstall" --install "$frameworkPath/Resources/Keystone.tbz" --force 2>/dev/null ; then
    echo "Error: Keystone install failed with code $exitCode"
    exit "$exitCode"
    echo "Keystone installed"

# Registers Chrome with Keystone
if ! /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin 
    --productid "$productID" 
    --version "$chromeVersion" 
    --xcpath "$chromePath" 
    --url "$updateURL" 
    --tag-path "$chromePath/Contents/Info.plist" 
    --tag-key "KSChannelID" 
    --brand-path "/Library/Google/Google Chrome Brand.plist" 
    --brand-key "KSBrandID" 
    --version-path "$chromePath/Contents/Info.plist" 
    --version-key "KSVersion"
    echo "Error: Failed to register Chrome with Keystone - code $exitCode"
    exit "$exitCode"
    echo "Registered Chrome with Keystone"

# Run postflight script to change owner, group, and permissions on the Chrome application
if ! "$resourcesPath/" "$chromePath" > /dev/null ; then
    echo "Error: failed with code $exitCode"

exit 0

Esteemed Contributor II

It looks like Google now offers their own .pkg installer for Chrome. Better yet, the postinstall script in the official .pkg sets up automatic updates. See the thread Updates to Google Chrome deployment for macOS for more information.

Contributor II

@LewisLebentz Out of curiosity, what criteria did you use for your smart group? I don't see it outlined in your blog.

New Contributor

@LewisLebentz Thank you!!!! Any tips on Zero touch deploy?

Valued Contributor

the script still looks to be working well.

Dumb question, this script will enable a device running chrome and is an older version to update.

I understand the smart group and the extension attribute inclusion to achieve this. 

I just wanted to verify my thinking. 

Thank you for all the hard work!

New Contributor II

Does anyone have an updated download link for Chrome? is downloading 98.0.4758.102 instead of the current version (106.0.5249.61 at the time of this post).

Contributor III

Will this work with the m1 devices? Also I see it is python below the shebang but I thought macs used python3. No?

Contributor III

I found that when I ran the following script on an M1 device I was able to attain the chrome version 106.x.x.x and not downgraded to v98.x.x.x

I have not tested it on an Intel Mac yet but will. Tonight I tested this on 2 devices, wiping them and letting them instal version 104... then ran this script about a dozen times with great results each time!


volname="Google Chrome"


#url=' url goes to a downgraded chrome version 98.x.x.x, so it is commented out.

/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" "/Applications/Google"
/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}"

exit 0

New Contributor II

Do you know if will continue to have the latest Chrome version or will the link need to be updated everytime?

@kbednar  I found that link url='' works, however it said that it could not update. 
But it does work after the user selects Enable Automatic updates in the Pop-up (drop-Down) window that appears.