I had a request to add the Google Chrome web browser to our builds. This brought about a little challenge in that Google Chrome does not fully utilise MCX / Config profiles to control all of its settings, so its not quite as easy to manage as Safari.
With Firefox, we use the CCK to generate autoconfig files. We then have AutoPKG automatically download the latest ESR and add the CCK autoconfig files to the app bundle before wrapping it up in a nice installer package that is then imported directly into Munki which makes my life very easy. Hat tip to Greg Neagle for his AutoPKG recipes.
I was hoping to find something to make my life easier with Google Chrome but alas my Google-Fu failed me.
Here is what I have come up with that gets the job done for my environment.
So the first thing was to work out what we actually wanted to manage or setup for the user.
Items to manage
- Disable Google Auto Updates
- Set default home page
- Set the home page to open on launch, but not on new creation of new tabs or pages
- Disable default browser check
- Disable first run welcome screen
- Skip import history/bookmarks ect ect
- Disable saving of passwords
So it turns out that one item is able to be managed via a config profile. Disabling of the Google Auto Update. This is disabled by simply setting the
This then causes the Google Keystone auto update mechanism to never check for updates.
To create a profile for this, I first created the plist with the setting i wanted with the following command
defaults write com.google.Keystone.Agent checkInterval 0
Then I used MCX to Profile to generate a config profile from this plist. I won’t go into the details on how to create a profile from a plist with MCX to Profile because Tim has already written good documentation on his site.
Check it out at https://github.com/timsutton/mcxToProfile
Chrome Master Preferences
To manage pretty much everything else we will have to create some text files.
Google uses a file called “
Google Chrome Master Preferences” This file can contain some basic preference settings that will be applied. It should be stored in
/Library/Google/Google Chrome Master Preferences
Below is the content of my Master Preferences file, its just plain JSON
Chrome also requires some files to be placed in
These files set the rest of our preferences and also prevent the welcome screen/ first run screen from being shown at first launch
So first create a file called Preferences, this is in the same JSON format and looks similar to the Google Chrome Master Preferences file however some of the settings in this file can not be made in the Google Master Preferences file for some reason.
My file looks like this:
Now create a folder called Default inside ~/Library/Application Support/Google/Chrome and place the Preferences file inside this Default folder.
That will set up the default preferences.
Now to disable the first run / welcome screen, we have to create an empty file called First Run inside the ~/Library/Application Support/Google/Chrome folder. This can easily be achieved by simply using the
touch command ie.
touch "First Run"
Putting it all together
So now we have all the pieces we need, how do we deploy it to client machines?
Package it all up and craft some pre/post flight scripts.
Creating the package
First create a package that deploys our Google Chrome Master Preferences file into /Library/Google
We also need to store the other files that need to go into the users home folder. What I like to do is to store those items in the Scripts folder in /Library. Then I can copy them from there with a script later.
I like using Whitebox Packages to create my pkg’s
This is what my package looks like:
Now we get to the scripting part.
First we will start with a pre-install script that will remove any pre-existing content, so that if we need to update these preferences later we can be sure that our package will remove any items before installing the new items.
Once our package has placed our google preference files onto the machine, we will now run our post install script which will then install these files into the
System User Template, as well as go through any existing home folders on the machine and add them to their home directories.
This is basically what Casper users refer to as
FUT (Fill User Template) and
FEU (Fill Existing Users (Folders))
Add the two scripts as
postinstall scripts to the package and build it.
Now we have an installer package and a config profile.
I import both these items into Munki and make them an
update_for Google Chrome which gets imported automatically by AutoPKG. Now when Munki installs Google Chrome it also installs the Config profile and our preferences package and the user gets a nice experience with no nagging screens.