This will automate the install of Chrome, as well as provide information on customizing the default user experience for your environment.
Updated 12/4 to included PowerShell Script (Load_Chrome.ps1) – Script adds popup box if user has Chrome Open before installing. (Included in the Download Zip File) – Thanks @Geodesicz
Note – Updated 12/4, Version 47.0.2526.73 fixed the MSI detection issue, you can now use the MSI as detection, which is even easier than the way I originally posted.
Create your Folder Structure:
\\ConfigMgrSourceServer\Apps\Google\Chrome\VersionNumber\![]()
![]()
Download Google Chrome for Business here:https://www.google.com/work/chrome/browser/
Scripts & Files available here: http://garytown.com/Downloads/Chrome.zip
Replace the blank MSI file with the ones you download from Google.
Create your Install & Uninstall Scripts:
Load_Chrome.cmd Script:
—————————–
REM Kill Chrome If Open
TASKKILL /IM chrome.exe /T /F
REM Install Google Chrome Business Version (MSI)
msiexec /i “GoogleChromeStandaloneEnterprise.msi” /qn
REM Lock down settings using customer master_preferences file.
REM Sets Homepage to Corporate Page
REM Skips Welcome Message, and suppresses other annoying stuff
XCOPY master_preferences c:\Program Files (x86)\Google\Chrome\Application” /E /V /H /Y
——————————
Load_Chrome.ps1 Script
Note, this also checks if user is logged on and provide a popup if Chrome is open. If chrome is not open, it just silently installs. When OK is clicked, Chrome closes and upgrade / install continues.![]()
——————————
# Install Google Chrome
# Check if User is Logged In
$Session = gwmi win32_computersystem | select -ExpandProperty UserName
# User is Logged In
If ($Session -ne $null){
# Check if Chrome is Open
If (Get-Process Chrome -ErrorAction SilentlyContinue){$Chrome_Open = $true} else {$Chrome_Open = $false}
If($Chrome_Open -eq $true){
# Notify User
$Popup = New-Object -ComObject wscript.shell
$Approval = $Popup.Popup(“Google Chrome is about to be installed/updated. Please save and close your work in Chrome and click OK to continue.”,”0″,”Pending Install Warning”,”1″)
}
}
If ($session -eq $null -or $Chrome_Open -eq $false -or $Approval -eq ‘1’){
# Kill Chrome If Open
Stop-Process -Name Chrome -Force -ErrorAction SilentlyContinue
Set-Location $PSScriptRoot
# Install Chrome
Start-Process msiexec.exe -ArgumentList “/i”,”GoogleChromeStandaloneEnterprise.msi”,”/qn” -Wait
# Copy Master Preferences file
Copy-Item .\master_preferences -Destination “${env:ProgramFiles(x86)}\Google\Chrome\Application” -Force
——————————
Uninstall_Chrome.cmd
——————————
REM Kill Chrome If Open
TASKKILL /IM chrome.exe /T /F
REM Uninstall Google Chrome Business Version (MSI)
msiexec /X “GoogleChromeStandaloneEnterprise.msi” /qn
REM Uninstall Google Junk
WMIC product where (name like “Google Talk Plugin%%”) Call Uninstall
WMIC product where (name like “Google Update Helper%%”) Call Uninstall
WMIC product where (name like “Google Chrome%%”) Call Uninstall
rmdir c:\Program Files (x86)\Google\Chrome\Application” /S /Q
————————-
master_preferences file (This will set specific settings for your environment)
Read more about it here: More info about that file here: https://support.google.com/chrome/a/answer/187948?hl=en
————————–
{
“homepage” : “http://viamonstra.com/”,
“homepage_is_newtabpage” : true,
“browser” : {
“show_home_button” : true,
“check_default_browser” : false
},
“session” : {
“restore_on_startup” : 4,
“urls_to_restore_on_startup” : [
“http://viamonstra.com/”
]
},
“bookmark_bar” : {
“show_on_all_tabs” : true
},
“distribution” : {
“alternate_shortcut_text”: “alternate text for the shortcut”,
“auto_launch_chrome”: true,
“chrome”: true,
“app_host”: true,
“chrome_frame”: true,
“ready_mode”: true,
“chrome_shortcut_icon_index”: 1,
“disable_logging”: true,
“import_bookmarks”: false,
“import_bookmarks_from_file”: “bookmarks.html”,
“import_history”: false,
“import_home_page”: false,
“import_search_engine”: false,
“ping_delay”: 60,
“show_welcome_page”: false,
“skip_first_run_ui”: true,
“suppress_first_run_bubble”: true,
“do_not_create_desktop_shortcut”: true,
“do_not_create_quick_launch_shortcut”: true,
“do_not_launch_chrome”: true,
“do_not_register_for_update_launch”: true,
“log_file”: “log.txt”,
“make_chrome_default”: false,
“make_chrome_default_for_user”: false,
“suppress_first_run_default_browser_prompt”: true,
“msi”: true,
“multi_install”: true,
“require_eula”: false,
“system_level”: true,
“verbose_logging”: true
},
“first_run_tabs” : [
“http://viamonstra.com/”,
“welcome_page”,
“new_tab_page”
]
}
—————————
I also recommend using the Group Policy Templates they provide, I’ve been able to disable Extensions / Store, etc. We whitelist only approved Extensions. We’ve been able to really lockdown / secure Chrome using the provided Group Policy Templates: https://www.chromium.org/administrators/policy-templates
Here is a look at our default install of Chrome. We’ve set the Home Page, added the “Home Button”, removed the “Apps” button and use Group Policy to manage Extensions.![]()
Now that we have our Content created, in ConfigMgr![]()
In the Content Tab, make sure it is pointing to your ConfigMgr Content Source.
Change Load_Chrome.cmd to powershell –executionpolicy bypass –file “Load_Chrome.ps1” if you want to use the PowerShell Script instead of the Command File.
For Detection Method, currently I’m using the file & version, I used to use MSI code, but have had issues recently, so I’ve switched to the file detection.
– 12/4 – Google Fixed the MSI, so it now detects properly, use the MSI Code as the detection method, it’s easier then using the File, and you only need 1 “clause” instead of 2, and it will work for both x86 and x64.
That should do it.
Happy Deployments!