Hey everyone...
I wanted to make Google Chrome a part of my automated deployment process and also be available within Self-Service.
Why? Users can just download from Google on their own. True dat. But hey, one-stop shopping in Self-Service, right?
As we all know, Google deploys Chrome via a DMG file. The Google Chrome.app file must be dragged to the /Applications folder.
You could effectively re-package everything using Composer, but then things get REAL STALE, REAL FAST - Google updates Chrome frequently. So stale software is bad software.
So how can we deploy Google Chrome with the freshest of the fresh so we don't get that not-so-fresh feeling?
Well, lemme share my story, morning glory.
.
THE SCRIPT
I wrote a simple script that does the heavy lifting...
I tossed this script into System Settings > Computer Management > Scripts within the JSS...
NOTE: Yes, I am aware that I don't have any error checking taking place. This is v1.1 - quick and dirty. Feel free to add some if you feel the need.
#!/bin/sh
####################################################################################################
#
# Google Chrome Installation Script
#
####################################################################################################
#
# DESCRIPTION
#
# Automatically download and install Google Chrome
#
####################################################################################################
#
# HISTORY
#
# Created by Caine Hörr on 2016-07-25
#
# v1.1 - 2016-10-11 - Caine Hörr
# Added -nobrowse flag to hdiutil attach /tmp/$VendorDMG command line arguments
# Shout out to Chad Brewer (cbrewer) on JAMFNation for this fix/update
# https://jamfnation.jamfsoftware.com/viewProfile.html?userID=1685
#
# v1.0 - 2016-07-25 - Caine Hörr
# Google Chrome Installation script
# Vendor supplied DMG file
VendorDMG="googlechrome.dmg"
# Download vendor supplied DMG file into /tmp/
curl https://dl.google.com/chrome/mac/stable/GGRO/$VendorDMG -o /tmp/$VendorDMG
# Mount vendor supplied DMG File
hdiutil attach /tmp/$VendorDMG -nobrowse
# Copy contents of vendor supplied DMG file to /Applications/
# Preserve all file attributes and ACLs
cp -pPR /Volumes/Google Chrome/Google Chrome.app /Applications/
# Identify the correct mount point for the vendor supplied DMG file
GoogleChromeDMG="$(hdiutil info | grep "/Volumes/Google Chrome" | awk '{ print $1 }')"
# Unmount the vendor supplied DMG file
hdiutil detach $GoogleChromeDMG
# Remove the downloaded vendor supplied DMG file
rm -f /tmp/$VendorDMG
.
SMART COMPUTER GROUP
We need a Smart Computer Group so Policy #1 has something to work from...
Computer Group
Display Name = "Google Chrome - Not Installed"
Criteria
Application Title] eis not] tGoogle Chrome.app]
.
POLICY #1
This policy makes things happen auto-magically based on the aforementioned Smart Computer Group.
Policy: Options
General
Display Name: "Download & Install Google Chrome"
Enabled = Checked
Triggers = Login, Recurring Check-In, Make Available Offline
Execution Frequency = Ongoing
Make Available Offline = Checked
Scripts
Points to the script in System Settings > Computer Management > Scripts
Priority: After
Maintenance
Update Inventory = Checked
Policy: Scope
Target Computers = Specific Computers
Target Users = Specific Users
Target/Type = "Google Chrome - Not Installed" Smart Computer Group
.
POLICY #2
I wanted a second policy for the sole purpose of Self-Service. I did not want the user's ability to download/install Google Chrome to be hindered within Self-Service by them being out of scope.
Why?
Perhaps the user's version of Chrome isn't updating properly... they can go to Self-Service and download/install at their leisure. There may be other reasons.
Policy: Options
General
Display Name: "Google Chrome (Latest Version)"
Enabled = Checked
Execution Frequency = Ongoing
Make Available Offline = Checked
Scripts
Points to the script in System Settings > Computer Management > Scripts
Priority: After
Maintenance
Update Inventory = Checked
Policy: Scope
Target Computers = All Computers
Target Users = All Users
Policy: Self Service
Make the policy available in Self Service = Checked
Description: Download and install the latest version of Google Chrome
Icon: I ripped the Google Chrome 128x128 icon from the icon file found within the Google Chrome.app
Feature the policy on the main page = Checked
Anyway - That's about it. It's a simple workflow.
- Chrome will auto-install on machines without Chrome
- Chrome can be manually installed via Self-Service
- Chrome will always be fresh when installed
.
Feel free to salt-to-taste - even better if you share your changes.
Cheers!