I want to be able to deploy Google Chrome for Business in my organization without any extra shortcuts being created and without any first-run prompts. The Chrome for Business installer is a Windows Installer file (MSI), but it is just a wrapper around an executable installer. It does not have properties such as CreateDesktopShortcut that could be set at the msiexec command line like a lot of MSI installers do. How can I customize my installation? I would prefer not to write and maintain an installation script.
Google Chrome stores the default user preferences in a master_preferences file. This is a text file in JSON format, and it includes a
distribution
object containing settings that will be read during installation. Editing this file in an existing Chrome installation does not solve the problem because the installation has obviously already occurred at that point. The solution is to integrate a customized master_preferences file into the Windows Installer installation process by using a transformation file. Take the following steps to accomplish this.Gather the Required Installers and Tools
I’ll download the 64-bit version to
E:\Chrome for Business 38 (64-bit)
.I’ll download this to
E:\WindowsSDK8.1
.E:\WindowsSDK8.1.\sdksetup.exe
.msiexec /package "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\Orca-x86_en-us.msi"
.Write a customized master_preferences file
distribution
object, which is contained within the anonymous object in the master_preferences file. The following list of settings was compiled by combining two Chromium source files: master_preferences_constants.h and master_preferences_constants.cc in /trunk/src/chrome/installer/util/. Note that the following is not valid JSON because no values are included for the properties. An example is shown further below.distribution
object in the JSON. They are applied to the user profile when a user runs Chrome for the first time. The full list of settings is available in the Chromium source files pref_names.h and pref_names.cc in /trunk/src/chrome/common/. The list is rather lengthy, so only a subset is shown here.You must include all of these properties as shown in your master_preferences file in order for the installer to work correctly. Therefore, you should start with this and add to it. My file is shown below. The only way I found to stop Chrome from asking the user to configure a Google account was to set
first_run_tabs
property.Browse to http://jslint.com/, copy your JSON into the Source box, and click the JSLint button. This will verify that you have good JSON. This is important, because feeding malformed JSON to the installer will yield unexpected and/or undesired results. Save the verified file for future reference.
Make a copy of your verified JSON, and remove all of the spaces and new lines. The Chrome installer cannot handle newlines; including newlines will result in a corrupted installation that has to be removed via registry surgery and manual deletion of files. Removing spaces may not be necessary, but it matches what the setup authors did with the default JSON. Mine is shown below.
Run the new JSON without spaces through JSLint to ensure that you did not introduce any errors.
Copy the verified JSON without spaces or newlines into a URL encoder. I used URL Encode/Decode Online. Save the encoded JSON for use in the installer and for future reference. My encoded JSON is shown below.
Write a Windows Installer Transformation
googlechromestandaloneenterprise64.msi
.MASTER_PREFERENCES
, and set the Value to your URL-encoded JSON. This code will be applied during deployment and saved as the installation’smaster_preferences
file by the installer.installerdata=
and replace it with the new property name in brackets. Be sure to retain the closing quotation mark. It should look like this:installerdata=[MASTER_PREFERENCES]"
E:\Chrome for Business 38 (64-bit)\MasterPreferences.mst
.Note: It is necessary to use a property rather than insert the JSON directly into the custom action because the custom action Target field is only 255 characters long. The schema of that table cannot be changed, and most custom JSON would take the total length of that field over the limit. Using a property avoids the length limitation, as there is no practical limit to the length of a property value.
Install Chrome with your Transformation
TRANSFORMS
property to its filename. Turn on logging to help you find anything wrong. Using my example folders and assuming that you are logged in as Administrator:msiexec /package "E:\Chrome for Business 38 (64-bit)\googlechromestandaloneenterprise64.msi" TRANSFORMS="E:\Chrome for Business 38 (64-bit)\MasterPreferences.mst" /l*v "C:\Users\Administrator\Desktop\ChromeInstallationLog.txt"
msiexec /package "googlechromestandaloneenterprise64.msi" /quiet TRANSFORMS="MasterPreferences.mst" /l*v "%TEMP%\ChromeInstallationLog.txt"
This gives my users an app-store-like experience with Configuration Manager’s Software Center application, leaves control of the desktop and taskbar icons solely with the user, and avoids annoying first-run experiences. This is my preferred user experience generally, but it is especially useful for public-facing computers, such as in a computer lab, where hard drive changes are lost on each restart, and so every logon is the "first" logon.Notes
See also Google's documentation on the master_preferences file, which covers a subset of the available settings, but does not tell you how to get the settings onto the machine during installation.
Thanks to [email protected] for pointing out the MSI customization possibility. My goal here was to expand on that information to provide a comprehensive explanation and example solution. I hope it is helpful.
I don't have enough rep to post a comment. I was using Jay's guide to help with a problem getting a a downloaded file type to run automatically. And this appears to the only way to do it at the moment:
https://bugs.chromium.org/p/chromium/issues/detail?id=476668
-This link refers to a bug which AFAIK isn't fixed. The reporter would like to be able to set specific file types to run automatically on d/l via a GPO. The use case for this is limited given the security implications, but necessary sometimes in enterprise deployments. It can be achieved using Jay's technique in an .mst with master_preferences. (edit in response to Chick's comment)
I agree with you Tomtom, there should be an easier way. In the most part Google's .admx is sufficient.