Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Packaging Google Chrome for Enterprise Deployment

Created: 05 Jun 2012 | 14 comments
Language Translations
piyushnasa's picture
+2 2 Votes
Login to vote

Many times it is an issue with the Administrators to deploy Google Chrome enterprise wide as there are lots of issues like:

1) Many people would have already installed various other versions of Chrome either through MSI or through exe.

2) How to customize Google chrome for enterprize wide deployment.

First, I would like to mention here that Google Chrome Enterprise version can be downloaded from the following location:

http://www.google.com/intl/en/chrome/business/browser/

This site contains an MSI, which is already customized for business as in there are no desktop/Taskbar shortcuts and the application automatically goes to Program files folder.

If you need to customize this, it is best to capture this MSI as it runs a Setup.exe from within. You can use WISE Package Studio or any other tool for doing a Setup Capture for this application.

I would say that, this MSI is good enough to go like this too so not recommended to waste your time in capturing the MSI unless specifically required.

You can add master_preferences file in the Google\Chrome\Application folder with following contents:

{

"homepage" : "http://msiworld.blogspot.com",

"homepage_is_newtabpage" : false,

"browser" : {

"show_home_button" : true,

"check_default_browser" : false,

"window_placement": {

"bottom": 1000,

"left": 10,

"maximized": false,

"right": 904,

"top": 10,

"work_area_bottom": 1010,

"work_area_left": 0,

"work_area_right": 1680,

"work_area_top": 0

}

},

"bookmark_bar" : {

"show_on_all_tabs" : true

},

"distribution" : {

"skip_first_run_ui" : true,

"show_welcome_page" : false,

"import_search_engine" : false,

"import_history" : false,

"create_all_shortcuts" : true,

"do_not_launch_chrome" : true,

"make_chrome_default" : false

}

}

If you add this, change the install sequence of Custom Actions which are already there in the MSI to run before InstallFiles action. This will make sure your master_preferences file is retained till end.

Uninstall Any Previous Version of Chrome:

To Uninstall any previous version of Chrome, I have written this VBScript which can be run before the installation of your MSI.

'==============================================================

'Lines to get the computer Name

Const HKEY_LOCAL_MACHINE = &H80000002

Set wshShell = WScript.CreateObject( "WScript.Shell" )

strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )

dim folder, MyProperties, arrMyProperties, Exe, Param, oReg, strKeyPath, strValueName

'==============================================================

'To check whether the OS is 32 bit or 64 bit of Windows 7

'==============================================================

'Lines to detect whether the OS is 32 bit or 64 bit of Windows 7

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputerName & "\root\default:StdRegProv")

strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"

strValueName = "Identifier"

oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

'==============================================================

'Checking Condition whether the build is 64bit or 32 bit

if (instr(strValue,"64")) then

folder = "C:\Program Files (x86)\Google\Chrome"

RegVal = ReadReg ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")

End If

if (instr(strValue,"x86")) then

folder = "C:\Program Files (x86)\Google\Chrome"

RegVal = ReadReg ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")

End If

'==============================================================

MyProperties = RegVal

arrMyProperties = Split(MyProperties, "-")

Exe = arrMyProperties(0)

Param = "--uninstall --multi-install --chrome --system-level --force-uninstall"

'Uninstall Previous version Chrome

'==============================================================

wshShell.run Exe & Param, 1, True

'Delete leftover folder and files from Previous version Chrome

'==============================================================

dim filesys

Set filesys = CreateObject("Scripting.FileSystemObject")

If filesys.FolderExists(folder & "\") Then

filesys.DeleteFolder folder

End If

Function ReadReg(RegPath)

Dim objRegistry, Key

Set objRegistry = CreateObject("Wscript.shell")

Key = objRegistry.RegRead(RegPath)

ReadReg = Key

End Function

Hope these steps will reduce your efforts in deployment of Chrome.

Comments 14 CommentsJump to latest comment

wancsho's picture

Just to add:

Yes its true that handling upgrade for Google Chrome becomes troublesome in those cases when the application is deployed using an EXE, so upgrade is handled using the script, which first fetches the uninstall string info and then passing the commandline parameters along completes the uninstallation.

BUT

Its always better to repackage the Google Chrome installer by using the Setup.exe.

Steps:

1. The Setup.exe extracts a .7Z file

2. Extract the .7Z file using winzip/winrar/7zip

3. Which will again extract a .7Z file and perform Step 2 again

4. At the end you will get a Chrome-bin folder, consisting of all those files which are installed by Chrome Installer(Setup.exe)

5.  Move the chrome.exe present at .\Chrome-bin\chrome.exe to .\Chrome-bin\18.0.1025.168\ or .\Chrome-bin\xx.xxx.xxx.xx folder

6. Launch the chrome.exe from .\Chrome-bin\18.0.1025.168\ or .\Chrome-bin\xx.xxx.xxx.xx location.

7. Google chrome is launched.

8. Dump the folder Chrome-bin into the .WSI template file.

9. Create the shortcut using the chrome.exe at StartMenu location.

10. Complie the .WSI to generate .MSI file.

Hope it helps!!!

-wancsho

+1
Login to vote
CnK's picture

Nice info Wancsho, but if you have to create MSI like this, why not capture it? Why to take so much pain?

+1
Login to vote
wancsho's picture

@CnK: Its upto you to choose capture or place files manually in a template. As per my experience capturing Google Chrome puts more pain as you need to exclude the pack of unwanted registeries and other resources. BUT in case of placing the files manually, no need to recheck whether i have captured the rights resources or not?(which is usually a pain in case of CAPTURE).

Thanks- wancsho

0
Login to vote
CnK's picture

Thanks for your post. It is very informative. I like the uninstall script.

+1
Login to vote
CableGuy41's picture

nice post

Thanks,

CableGuy
Do not forget to mark a SOLUTION

+1
Login to vote
firozkhan's picture

Scenario :  when u launch shortcut , it will show one welcome dailogue window that has one check box in it, if u select this check box, next time it will not show any dailogue window when u launch the same shortcut.

could please tell me solution for this scenario how i can so this.

0
Login to vote
piyushnasa's picture

Are you talking about the default browser.. If not could you please tell which pop up are you talking about?

Piyush Nasa Altiris Certified Professional (ACP)

http://msiworld.blogspot.com/

+1
Login to vote
firozkhan's picture

Not browser, any application, for example like adobe reader, if u click on short cut one welcome window will opened, in that u have one check box, if u select that check box, next time when u launch same short cut that welcome window screen disappears.

0
Login to vote
piyushnasa's picture

Well, it is suggested to keep the discussion here limited to the article which is for Google Chrome. For other applications you can write in the Forum and discuss any issues.

Since you have asked, I will answer it here that for other applications you can take a snapshot capture of the launch of shortcut and any customizations beyond. Add all the changed entries to your package and you should have all your customizations in it.

Piyush Nasa Altiris Certified Professional (ACP)

http://msiworld.blogspot.com/

+1
Login to vote
jfrasier's picture

Is it possible to put bookmarks somewhere for the enterprise installation so all users have the same ones? I can get a bookmarks file from another computer but is it possible to add it to this package somehow?

Thanks.

Jane

0
Login to vote
Davinci_uk's picture

Hi Guys,

have tried to use the unisntall script against (saved it as a vbs) the latest Chrome (v25), but it doesn;t work.  Get Error regarding line 5 ("set wfshell").

Am I being a numpty?

0
Login to vote
MrL0gistiX's picture

In the vbs, the folder path for x86 is the same as for x64:

Currently written:

if (instr(strValue,"x86")) then

folder = "C:\Program Files (x86)\Google\Chrome"

Should be(?):

if (instr(strValue,"x86")) then

folder = "C:\Program Files\Google\Chrome"

0
Login to vote
JosephMoody's picture

Very good write up! I wasn't aware that you could set the homepage that way. I have always used Google's ADMX files and group policy to do that : http://deployhappiness.com/deploy-google-chrome-for-work-with-group-policy/

0
Login to vote