Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.

How to update Chrome automatically

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:

https://lew.im/2017/03/auto-update-chrome/

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.

Like Comment
Order by:
SOLVED Posted: by bpavlov

I haven't implemented this, but just reading through the script, it looks like you are literally overwriting the Google Chrome.app on the client already. In my experience having done this with a package in the past, this has the effect of causing issues when new tabs are opened and not being able to navigate to new websites. So in essence if you want to do this, you need to make sure Google Chrome is not opened otherwise the user may run into that issue. Again, I haven't tested your workflow so I'm going off what I'm reading in that script. Curious to hear how long you've been using this workflow and what your experience has been from the end-user side.

Like
SOLVED Posted: by LewisLebentz

We have been using this method (less the automated version part) for around a year now, and haven't had any issues. With a few hundred Macs reporting in, I'd probably have heard a complaint or two if it was causing issues with new tabs!

I tested it when we initially deployed it and all seemed fine, but Chrome has changed a lot since then, so I'll do some further testing when I'm back in the office and will update you.

Like
SOLVED Posted: by LewisLebentz

@bpavlov just did some further testing, ran the script a few times deleting Chrome whilst using it, open new tabs, browsing etc. and didn't notice anything whatsoever.

So can confirm there is still no noticeable effect for the end user if you run this.

Like
SOLVED Posted: by RobertBasil

Saw your post on Reddit about this script. Going to install it today and give it a run.

Thanks for sharing.

Like
SOLVED Posted: by mm2270

@LewisLebentz Thanks for your post, and showing your work. If nothing else, you pointed me to a resource I was previously unaware of. I'm not sure who developed or maintains the omahaproxy pages, but I looked it up to see more on it. It doesn't appear to be something Google maintains, but I'm not completely sure on that.

In any event, I've been looking for a more reliable way to get the Google Chrome current release number, since it seems Google obscurs it to the point of being impossible to get. I also have an "update" script that can update several products on the fly, doing live version checking, and incorporating Google Chrome into it has been a bear, because it was such a moving target to locate the latest version.

I found the team at omahaproxy have a simple plain csv file they host as well and was able to come up with the following very simple bash code to pull the current Mac version release from that. Posting it here so others can benefit.

curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac,stable/{print $3; exit}'

The above prints

56.0.2924.87

which is the current version. I'll need to see if that still works when they release an update.
Hopefully those pages won't up and disappear someday, or go stale from lack of maintenance.

Like
SOLVED Posted: by mm2270

LOL! No sooner did I post the above and Google released an update. Didn't need to wait long! The code above (and I assume your python EA as well) is working to show the new version, 57.0.2987.98, which means those pages get updated simultaneously along with new releases. Wow! Impressive!

Like
SOLVED Posted: by LewisLebentz

@mm2270 just noticed the update too! Most of my Macs have already picked up the update because of the script, which is great!

I believe the OmahaProxy site is officially Google, I've seen it referred to in a few different places by Google. So I think it's safe to rely on, it's been around for a while too.

Just found some code that references it on Google's site: https://chromium.googlesource.com/chromium/chromium/+/trunk/tools/omahaproxy.py

Script is pretty similar to mine!

Thanks for sharing your code too. Much shorter than mine! Need to learn how to use awk at some point.

I did notice that Jamf haven't yet updated their patch reporting, so our pie chart is all red saying that the version number is 'Other' and in the list it reports it as 'Unknown' which isn't great.

Like
SOLVED Posted: by cbrewer

Why use this work flow over Google's own system wide automatic updater? Especially when it can be enabled with a script.

Like
SOLVED Posted: by LewisLebentz

@cbrewer ours users are all admins, so can override settings we push out. Even if they don't they may not restart Chrome.

This script forces an update on check in, without the user even noticing. It runs in the background, and doesn't require a restart of Chrome.

Like
SOLVED Posted: by rayabril

So with @mm2270 new script, what should final Extension Attribute code look like? Sorry i'm new to this and pretty green when it comes to coding.

Like
SOLVED Posted: by bpavlov

@cbrewer what's the script you're referring to use the internal update tool from Google?

Like
SOLVED Posted: by cdenoia

Hey @LewisLebentz

Excellent post!

Like
SOLVED Posted: by May

Thanks ! @LewisLebentz @mm2270

What a time saver! i've seen no issues using it whilst Chrome is open,
it will also install the latest Chrome if it's not installed, here's the EA i'm using to report,

#!/bin/sh

if [ ! -f "/Applications/Google Chrome.app/Contents/Info.plist" ] ; then
echo "<result>Chrome isn't installed</result>"
exit 0
fi

INSTALLEDVERSION=$( defaults read "/Applications/Google Chrome.app/Contents/Info.plist" CFBundleShortVersionString )
CURRENTVERSION=$( curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac,stable/{print $3; exit}' )

if [[ "$INSTALLEDVERSION" == "$CURRENTVERSION" ]]; then

echo "<result>latest - $CURRENTVERSION</result>"

else

echo "<result>old</result>"

fi
Like
SOLVED Posted: by Kyuubi

@mm2270 @LewisLebentz pardon my ignorance but I would love to get this working at my site. I saw the curl command that @mm2270 put above and i saw it incorporated into the EA that @May wrote. What I don't understand is how that curl command pulls down the latest version and installs it. What am I missing.

Thanks,

Like
SOLVED Posted: by mm2270

@Kyuubi The script above from @May is an Extension Attribute, not the script that updates Chrome. The EA is part of the whole workflow put together by @LewisLebentz in his original post up top. You would use an EA similar, or identical to the one May posted above to gather Macs that are out of date according to what is noted on the omahaproxy pages for the latest Chrome version. This can then be used to gather out of date Macs in a Smart Group, which can in turn be scoped to the policy that would update them. Refer to Lewis' OP at top for his script that updates Chrome. There are others posted on the forums here as well. Essentially any script that would pull Google Chrome down, mount the DMG, copy over the app (overwriting the old one) and so on and so forth.

Hope that helps.

Like
SOLVED Posted: by Kyuubi

@mm2270 Thanks for the response. I understand all you wrote above, I'm just having trouble finding the actual script that does the pulling and installing. I've checked @LewisLebentz blog and github pages but can't find the script. Making me feel stupid.

Like
SOLVED Posted: by Kyuubi

.......found it

Like
SOLVED Posted: by mm2270

@Kyuubi OK, good! Was just about to post a more direct link to the script if I could for you. :)

Like
SOLVED Posted: by ryan.ball

I actually incorporate the chrome_enable_autoupdates.py as a postinstall in my AutoPKG Chrome recipe now and this seems to be working well.

Like
SOLVED Posted: by tld75000

@LewisLebentz Not working for me, maybe missing a step or something. When Lewis says " I made a Smart Group targeting all Macs where Chrome Version = Old" how does that translate into the Smart Group, how do you create it.
Thanks

Like
SOLVED Posted: by JeffA

@LewisLebentz Any update on creating the Smart Group? This would be great to implement but I am in the position as @tld75000. How do you create a Smart Group with the Criteria of "Chrome = Old"? Any help would be appreciated. Thanks.

Like
SOLVED Posted: by tep

@JeffA you can do a smart group with the criteria "Chrome like old"

Like
SOLVED Posted: by mackjohn

The windows pop up message when the new version of chrome launch. I don't think so you need to go for automatic chrome update.

Like
SOLVED Posted: by Andy_W

@JeffA You've probably figured this out already. For anyone who creates the Extension Attribute, you would create a Smart Group and there will be a "New Criteria" with whatever you named the EA. For example, I named mine Chrome Version, so I have a new criteria option called Chrome Version, then I just use the value is "old".

Like