Skip to main content
Solved

Install latest version of Google Chrome without re-packaging

  • August 17, 2016
  • 94 replies
  • 750 views

Show first post

94 replies

Forum|alt.badge.img+12
  • Valued Contributor
  • January 17, 2020

@MrRoboto im testing on ver 79


MrRoboto
Forum|alt.badge.img+9
  • Valued Contributor
  • January 17, 2020

@Dylan_YYC I tested on a 10.14.6 Mac, deleted Google Chrome.app and /Library/Google folder. Then ran the install and autoupdate scripts via a Self Service policy and it works okay... How are you running the autoupdate script, via Terminal?

[STEP 1 of 5]
Executing Policy Google Chrome
[STEP 2 of 5]
Running script Chrome-Install...
Script exit code: 0
Script result:
[STEP 3 of 5]
Running script chrome-enable-autoupdates-v2...
Script exit code: 0
Script result: Keystone installed
Registered Chrome with Keystone
[STEP 4 of 5]
[STEP 5 of 5]


Forum|alt.badge.img+19
  • Contributor
  • January 17, 2020

By the way, if anybody ever has an issue with the script below, please create an issue or PR. You might see something before I do.
https://github.com/ryangball/chrome-enable-autoupdates/blob/master/chrome-enable-autoupdates.sh


Forum|alt.badge.img+31
  • Honored Contributor
  • January 21, 2020

Just a friendly reminder, AutoPKG can do this and everyone should at least give it a try


Forum|alt.badge.img+2
  • New Contributor
  • January 21, 2020

hey everyone, i am using the 2 scripts mentioned here to download and install chrome and force enable auto updates successfully on most machines. however, it fails on some machines and jamf log shows the following error:

Script result: ditto: can't get real path for source '/tmp/chrome.mpuP/Google Chrome.app'<br/>hdiutil: detach failed - No such file or directory<br/>2020-01-21 13:13:57.034 defaults[5246:31053] <br/>The domain/default pair of (/Applications/Google Chrome.app/Contents/Info.plist, CFBundleShortVersionString) does not exist<br/>2020-01-21 13:13:57.055 defaults[5249:31061] <br/>The domain/default pair of (/Applications/Google Chrome.app/Contents/Info.plist, KSUpdateURL) does not exist<br/>2020-01-21 13:13:57.072 defaults[5250:31065] <br/>The domain/default pair of (/Applications/Google Chrome.app/Contents/Info.plist, KSProductID) does not exist<br/>Error: KeystoneRegistration.framework not found<br/>

Looks like its failing to mount the dmg in the temp directory and so then can't find the expected path when it tries to copy it to Applications. Anyone know why this might happen?


Forum|alt.badge.img+3
  • New Contributor
  • February 14, 2020

Does anyone have any recommendations as to politely nudging the user to quit Chrome so it can update? I'm running a script similar to the one posted by @lbr but it's failing on every single machine because everyone has Chrome open.


Forum|alt.badge.img+3
  • New Contributor
  • February 14, 2020

@lfrances Take a look at https://support.google.com/chrome/a/answer/7679871?hl=en

com.google.Keystone.plist I think is the file to manage.


Forum|alt.badge.img+1

@dancunn - Having the same issue. Wondering if it is related to Catalina. Did you ever figure this out?


Forum|alt.badge.img+2
  • New Contributor
  • November 27, 2020

Change the URL to https://dl.google.com/chrome/mac/universal/stable/GGRO/ to download the Universal that works on both Intel and Apple Silicon


Forum|alt.badge.img+18
  • Author
  • Valued Contributor
  • December 3, 2020

WOW - I haven't checked in on this thread (or this script) in such a very long time. I am... AMAZED... at how much interest and inspiration there's been since my original post so long ago! Very cool!


KyleEricson
Forum|alt.badge.img+17
  • Valued Contributor
  • December 10, 2020

@cainehorr @ellavader Do you all want to add this script to Github so we can track issues and features with it?
I'd be happy to do this too if you want.
Universal App Installer Script
I use this script a lot and would love to see it maintained and updated.


Forum|alt.badge.img+4
  • Contributor
  • December 10, 2020

Hey guys,
Is there a change in URL to download Chrome Enterprise using curl? Here is the old one that I have been using so far. url='https://dl.google.com/chrome/mac/stable/gcem/GoogleChrome.pkg'
/usr/bin/curl -s -o /tmp/${pkgfile} ${url}

Also is there a way to differentiate Chrome Enterprise and legacy browser?

Thanks & Regards
VM


Forum|alt.badge.img+3
  • New Contributor
  • April 27, 2021

Just a small update on my side as I'd been testing this script on some new M1 based machines.
Initially, I was a little confused as it "appeared" to work according to Jamf policy logs in the web portal but I wasn't see Chrome appear in the apps folder.

I tested the commands on my own machine and it appeared to download OK and the expected files appeared as per the set variables.

I then tried following more of the steps on my actual test machine and noticed that when I executed the step to copy the .app file from the mounted dmg > Applications folder it was taking a bit longer than the sleep period of 10 in this script so I bumped it to 15 and that seems to have helped.

I can only assume the app is getting a bit bigger and 10s isn't quite long enough to copy it now :)


Forum|alt.badge.img+2
  • New Contributor
  • May 14, 2021
#!/bin/sh

pkgfile="googlechrome.pkg"
logfile="/Library/Logs/GoogleChromeInstallScript.log"

url='https://dl.google.com/chrome/mac/universal/stable/gcem/GoogleChrome.pkg'


/bin/echo "--" >> ${logfile}
/bin/echo "`date`: Downloading latest version." >> ${logfile}
/usr/bin/curl -s -o /tmp/${pkgfile} ${url}
/bin/echo "`date`: Installing pkg." >> ${logfile}
installer -pkg /tmp/${pkgfile} -target /


exit 0

Small changes I made for an Apple Silicon version of the script. Main problem is that the universalbinary installer is a pkg, or at least the url I was using was a pkg. I just removed the dmg related lines and replaced them with an installer command.


Forum|alt.badge.img+7
  • Contributor
  • October 27, 2021

Just made this script that looks for Architecture and grabs the appropriate install, and Removes the "This was downloaded from the internet warning":

 

#!/bin/zsh # make temp folder for downloads mkdir "/tmp/googlechrome" # change working directory cd "/tmp/googlechrome" # Download Correct Google Chrome based on Architecture arch_name="$(uname -m)" if [ "${arch_name}" = "x86_64" ]; then curl -L -o "/tmp/googlechrome/Googlechrome.dmg" "https://dl.google.com/chrome/mac/stable/GGRO/Googlechrome.dmg" elif [ "${arch_name}" = "arm64" ]; then curl -L -o "/tmp/googlechrome/Googlechrome.dmg" "https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg" fi # Mount the DMG hdiutil attach Googlechrome.dmg -nobrowse # Install Google Chrome cp -r /Volumes/Google\\ Chrome/*app /Applications #Tidy Up hdiutil unmount "/Volumes/Google Chrome" sleep 5 sudo rm -rf "/tmp/googlechrome" sleep 5 #Bless Google Chrome app xattr -rc "/Applications/Google Chrome.app"

 

 


Forum|alt.badge.img+4
  • Contributor
  • July 12, 2022

This still grabs the old 98.0 version


Forum|alt.badge.img+4
  • Contributor
  • July 12, 2022

All of these scrips grab an extremely old version


JasonAtCSUMB
Forum|alt.badge.img+6
  • Contributor
  • July 12, 2022

I prefer this method, which uses Google's signed pkg to install, thus avoiding a lot of other pitfalls.

https://github.com/jfiliceatcsumb/Scripts/blob/19ea2a7a27a89f4eed6944acfa3db093aab66239/Google_Chrome_Enterprise_Installation_Script.sh

As of today, it installs version 103.0.5060.114 (5060.114).

 


JasonAtCSUMB
Forum|alt.badge.img+6
  • Contributor
  • July 12, 2022

I prefer this method, which uses Google's signed pkg to install, thus avoiding a lot of other pitfalls.

https://github.com/jfiliceatcsumb/Scripts/blob/19ea2a7a27a89f4eed6944acfa3db093aab66239/Google_Chrome_Enterprise_Installation_Script.sh

As of today, it installs version 103.0.5060.114 (5060.114).

 


As shown in Suspicious Package, this also includes the universal binary version of Chrome.


Forum|alt.badge.img+3
  • New Contributor
  • August 31, 2022

The correct way to get the most current Google Chrome pkg file, is to follow the directions from this Google KB directly. https://support.google.com/chrome/a/answer/9915669?hl=en


Forum|alt.badge.img+3
  • New Contributor
  • August 31, 2022

I have also refined the script that @ellavader  originally released for installing from any available download location. (https://www.jamf.com/jamf-nation/discussions/20894) But note that from my testing, I had to change it from just a download link, to the whole curl command in order to work in certain scenarios, giving a little added flexibility. 

#!/bin/sh # ------------------------------------------------------------------------------------- # # Universal App Installer Script # # ------------------------------------------------------------------------------------- # # DESCRIPTION # # Automatically download and install nearly any app from a direct download link # App can be packaged as .dmg, .pkg, or .zip, and have either the .app or a .pkg inside # # ------------------------------------------------------------------------------------- # # HISTORY # # Created by Ella Hansen on 10/30/2018 # # v2.0 - 08/31/2022 - Scott Leonard # Created script based on Caine Hörr's script for Google Chrome: # https://www.jamf.com/jamf-nation/discussions/20894 # # ------------------------------------------------------------------------------------- # ADD THE DIRECT DOWNLOAD LINK FOR YOUR APP HERE INCLUDING THE Curl COMMAND, WITH OPTIONS: # Example: curl --location DownloadURL="https://dl.google.com/chrome/mac/stable/googlechrome.dmg" --output Chrome.dmg DownloadURL="$4" # ------------------------------------------------------------------------------------- # LEAVE THIS CODE ALONE: # Create directory /tmp/jamf, continue if directory already exists mkdir /tmp/jamf || : # Change directory to /tmp/jamf cd /tmp/jamf #Download installer container into /tmp/jamf $DownloadURL # Make directory to move and copy .app from mkdir /tmp/jamf/mount # Unzip installer container and place contents into /tmp/jamf/mount, continue on error find /tmp/jamf -name "*.zip" -exec unzip {} -d /tmp/jamf/mount \\; || # Uncompress or Extract Tar file find /tmp/jamf -name "*.bz2" -exec tar -xf {} -C /tmp/jamf/mount \\; || : # If container is a .dmg: # Mount installer container # -nobrowse to hide the mounted .dmg # -noverify to skip .dmg verification # -mountpoint to specify mount point find /tmp/jamf -name "*.dmg" -exec sh -c "yes | hdiutil attach {} -nobrowse -noverify -mountpoint /tmp/jamf/mount" \\; || : # Copy the .app file from the installer container to /Applications # Preserve all file attributes and ACLs cp -a /tmp/jamf/mount/*.app /Applications || : # If container is a .pkg # Run installer package with the boot drive as the destination find /tmp/jamf -name "*.pkg" -exec installer -pkg {} -target / \\; || : # Unmount the secondary installation folder, continue on error hdiutil detach /tmp/jamf/mount || : # Delete the main installation folder rm -r /tmp/jamf

Forum|alt.badge.img+3
  • New Contributor
  • December 5, 2022

#!/bin/zsh

# Changed the installer from .dmg to .pkg and took out the bit for choosing an architecture.

# make temp folder for downloads

mkdir "/tmp/googlechrome"

# change working directory

cd "/tmp/googlechrome"

# Download Google Chrome

 

curl -L -o "/tmp/googlechrome/googlechrome.pkg" "https://dl.google.com/chrome/mac/universal/stable/gcem/GoogleChrome.pkg"

 

# Install Google Chrome

sudo /usr/sbin/installer -pkg googlechrome.pkg -target /

#Tidy Up

sudo rm -rf "/tmp/googlechrome"

#Bless Google Chrome app

xattr -rc "/Applications/Google Chrome.app"


Forum|alt.badge.img+6
  • Contributor
  • December 6, 2022

@ellavader @cainehorr 

I've been using this script for over a year, with much success, but now I've come across a URL that breaks it.

The URL for the Apple Silicon zoom client is this:

https://zoom.us/client/latest/Zoom.pkg?archType=arm64

The script expects the downloaded file to end in .pkg, and since this one doesn't. it fails to install.

I could modify the script to treat this URL as a special case, but I'd prefer to modify it to work with any pkg download where the filename doesn't end in .pkg.

Any suggestions?

 


Forum|alt.badge.img+10
  • Valued Contributor
  • December 6, 2022

@ellavader @cainehorr 

I've been using this script for over a year, with much success, but now I've come across a URL that breaks it.

The URL for the Apple Silicon zoom client is this:

https://zoom.us/client/latest/Zoom.pkg?archType=arm64

The script expects the downloaded file to end in .pkg, and since this one doesn't. it fails to install.

I could modify the script to treat this URL as a special case, but I'd prefer to modify it to work with any pkg download where the filename doesn't end in .pkg.

Any suggestions?

 


Instead of using curl on endpoints which can easily be used maliciously by spoofing DNS, might I suggest using something like autopkg? or Installomator? That have security measures in place to help verify what's being downloaded.


Forum|alt.badge.img+3
  • New Contributor
  • December 6, 2022

@ellavader @cainehorr 

I've been using this script for over a year, with much success, but now I've come across a URL that breaks it.

The URL for the Apple Silicon zoom client is this:

https://zoom.us/client/latest/Zoom.pkg?archType=arm64

The script expects the downloaded file to end in .pkg, and since this one doesn't. it fails to install.

I could modify the script to treat this URL as a special case, but I'd prefer to modify it to work with any pkg download where the filename doesn't end in .pkg.

Any suggestions?

 


Downloads a pkg for me. If you have a look at the script I modified, near the bottom of this thread, I re-engineered it to accept pretty much any file, to include pkg, dmg, zip, etc.