This Blog is for all people working or related to the MSI and App-V.
There are lots of issues we face in everyday work regarding the technology. The sole purpose of my blog is to help others with whatever I learn. All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends and colleagues but with due credit and acknowledgement to the material posted here with my name and blog url as I still do hold the copyright of the posts here.

Sunday, June 03, 2012

Packaging Google Chrome for Enterprise deployment

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 enterprise wide deployment.

*Edited: The new version has a few differences, please see the end of post on how to tackle this.*

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.
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:

If you add this, change the install sequence of Custom Actions which are already there in the MSI to run before InstallFiles action. That is, move InstallFiles Action after DoInstall. This will make sure your master_preferences file is retained till end.
*Edited
There are are 3 Custom Actions by the name starting from : CallUninstaller
Change their condition to REMOVE="ALL"
This will enable for a clean upgrade else you will face issues while upgrading the application.
*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.

*With the New version 26.0.1410.64, Google has changed the install sequence. do the following:

1) In InstallExecuteSequence Table move InstallFiles action after DoInstall Custom Action. This DoInstall Custom Action is actually installing the Google Chrome from an exe. So if the MSI already had copied the master_preferences file, this exe will replace it with its own. If you place the InstallFile Action after DoInstall, then the file which you have added in your package will overwrite the one which Google provides.2) You might have to write a small script to delete the shortcut from C:\Users\Public\Desktop, if you do not want a desktop shortcut.Place this CA at the end just before InstallFinalize.

That is correct. You can add this to disable the autoupdate. We did want Autoupdate to be enabled so that it is patched and we do not have to upgrade it.Chrome Autoupdates itself even if the users do not have admin privileges.

quote"There are are 3 Custom Actions by the name starting with : CallUninstaller Change their condition to REMOVE="ALL"This will enable for a clean upgrade else you will face issues while upgrading the application."

Currently the installer is set to - 'REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE"'

Don't we want this to be set to - '"REMOVE="ALL" AND UPGRADINGPRODUCTCODE"' or maybe this '"REMOVE="ALL" OR UPGRADINGPRODUCTCODE"'

We want to uninstall through Add/Remove programs and uninstall during upgrade, correct?

This is for future products when you install on top of this one you are creating. Not to handle any previous releases.The quote you mentioned will make sure that when this product is uninstalled by an upgrade code of newer version then it will be a clean uninstall.you do not need to uninstall from Add/Remove Programs, if you add an upgrade code, it will do the task for you.

Hey, I am working on deploying google chrome in an enterprise environmetn using the given .msi accompanied by a generated .mst following your instruction. For the most part I understand how this works but I was just wondering if there is a way to incorporate the master_preferences file into this task. We need to change a few things from the default .msi and I'm not exactly sure what I need to put in the conditions to achieve the proper deployment. Thanks

If any previous version of Chrome is installed through an msi then its uninstall will be taken care by msi through upgrade table, but if it is installed through exe then it creates an uninstall string in HKLM always at a particular key. So I have used that key to uninstall chrome of any previous version.

However I am having trouble with it and wondered if anyone can assist as this is my first MSI manipulation to this degree. I intend to roll out via SCCM 2012.

I used Admin Studio 11.5 SP1 InstallShield (Spring 2012) to edit a copy of the enterprise MSI. Under "Behavior and Logic", "Custom Actions and Sequences", "Sequences", "Installation", "Execute", I drag & dropped "InstallFiles" to just beneath "DoInstall".

I then changed all (3) "CallUninstaller" actions at this location to reflect the proposed changes.

At this point I am confused as to how to handle the master_preferences file. I am not sure if I should follow up install with an xcopy command that takes care of the copy, or if I should include it in the MSI.

I would prefer to have it happen in one smooth shot, so I took the additional step under "Application Data", "Files and Folders", and under the "Destination computer's files" added my master-preferences file, both as an uncompressed file and then afterward, also streamed into the CAB. After adding the file, I went to "Organization", "Components", "AllOtherFiles", and simply changed the shared value from "yes" to "no".

Before attempting to compare the source and modded MSIs to create and apply the transform, which is how I intend to do it, I first just ran each modified MSI with logging and neither placed my modified master_preferences file. With both installs, I had only the default master prefs. I'm not sure if "TARGETDIR" is the correct path to use, but either way it doesn't seem to be placing it anywhere on the system. I ran the installs via command line by "opening command window here" on the source directory, hence the drive letter assignment.

The only other concern at this point is it doesn't seem to lay down a shortcut in the Start Menu. I don't want a desktop shortcut, or anything pinned. Installing as elevated user I only seem to get a per user desktop shortcut.

I see the current MSI ver of the install (65.x) does not create the start menu shortcuts any longer. Is there a trick to running the MSI and having it add the start menu shortcuts. Like a Public Property on the command line?

Hi AR,I am not sure why are you making it so complicated. You can open the MSI you have downloaded and save it as an MST. This will create an MST file. you can go to files section and add the master_preferences file there and save the MST. It will do everything for you.For changing the install sequence, i would suggest you to do it from InstallExecuteSequence table. Sort it with the sequence and change the sequence number as you want it to install.For shortcut, go to Shortcut section and change the shortcut install location there.Let me know if you face any more issue.

Thanks for the reply Piyush. My issue, due to inexperience with InstallShield, is I can't get it to accept the %ProgramFiles% variable as it won't place the file at all unless I specify either "Program Files" or "Program Files (x86)" requiring two separate installers.

Also, if I have a local Q: drive for App-V, it will always place the file there instead of C:.

I have opened an incident with Flexera that has been escalated and they have been working on it for over 2 weeks, so maybe there is something to it...not sure.

You can have it in two different components in the same MSI. could you also write some more on your issue. also please give a name or any symbol so I understand and relate issues. there are just so many Anonymous.

Sorry, I meant to add my initials as I did in my previous posts, but forgot to in my last reply. Here are the details that I sent to Flexera:

"Basically I am wanting to add a master_preferences file (no extension) to a Google Chrome enterprise MSI, then create a transform by comparing the modified and original MSIs. I have figured out how to add directories and components to the project via direct editor and in the files and folders section. (streaming it into the MSI's cab) However I am seeing two problems with this. The first one is with our Q: drive for App-V deployments. Typically this drive cannot be browsed by the end user, but in my VMs (test environment) it can be browsed. As long as it is accessible, my modified MSI will place the directories and components in the Q: drive rather than drive C:. Not a big deal, except I want to understand why this is.

I also don't quite understand how [TARGETDIR] plays into things, as when I try to use it instead of [INSTALLDIR], none of my additional directories / components gets copied.

Secondly, if I set Q: to offline, then it will install to the C: drive as expected, however I can not get it to run if I use the %ProgramFiles% variable to support both x86 and x64 clients. I could call up the appropriate architecture specific MSI in a batch file, or have two separate deployments in SCCM 2012 with processor requirements, but I would much prefer to utilize my resources to do this in the MSI if at all possible.

So far, I have only tested by calling the modified MSI, but eventually I wish to call the original MSI and apply my transform to it."

Are you saying that I should add two components to the project, one to "Program Files" and one to "Program Files (x86)"? I just want to know the best practice. Thanks again Piyush.

This sounds so easy, ("you can go to files section and add the master_preferences file there and save the MST") but I am using Orca to create the .mst and there are no rows in the table now and am unsure what all I need to include. Is this the only change besides the sequence in the .mst?

There is a bookmarks file in chrome at this location:C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\DefaultYou need to add bookmarks to your clean machine and then copy this file to all users at this location. The USERNAME will be different for all so might be you can use Active Setup and a script.

I finally figured out how to add the master_prefs file to the MSI. After adding the file, I was changing the path from the files & folders area and not the setup design or components area. Also, I was trying to use "Program Files\Google\Chrome\Application" as a destination, or even trying to use the %ProgramFiles% variable. To properly add the file the path needs to be "[ProgramFilesFolder]\Google\Chrome\Application". You are supposed to use the pre-defined property names as found here: http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q105880

Then you can also define the new directories, as is best practice, from Directory_1, Directory_2, etc. to GOOGLE, CHROME, APPLICATION, etc.

Hi there. Just want to be sure that when using the master_preferences file in an enterprise install (following an uninstall with your script) that it actually works. I've place a sample master_preferences file in the location after running the install, and it does not seem to reference it (this is on a machine that had Chrome before uninstalling). I tested by changing the home page, and it still comes up with the Chrome default home page.

Yes, it should work. The uninstall script deletes any folder of previous version and the MSI will create a new Chrome folder and will reference the master_preferences file in there.In your case can you check if the install is referring from %appdata%. As chrome could have been installed there as well.And could you please explain experimental flags.. I mean what exactly you mean by it.

Experimental flags can be accessed live via chrome://flags (this lets you list and modify the experimental flags/setting).

You can also open the app activating an experimental flag by changing the target of the icon to include the command string for the flag. All of this is great for one-off deployments, but I need to deploy 100 seats of Chrome with an experimental flag enabled and was hoping it could be set in the master_preference file.

Try it. The master_preferences file is completely ignored. copied the template file and followed the instructions (path) and it simply does not work. Instructions here: http://support.google.com/chrome/a/bin/answer.py?hl=en&answer=187948

Ok, so here is the thing with the latest version. I just did it myself and I will edit my post as well.With the New version 26.0.1410.64, Google has changed the install sequence. do the follwing:

1) In InstallExecuteSequence Table move InstallFiles action after DoInstall Custom Action. This DoInstall Custom Action is actually installing the Google Chrome from an exe. So if the MSI already had copied the master_preferences file, this exe will replace it with its own. If you place the InstallFile Action after DoInstall, then the file which you have added in your package will overwrite the one which Google provides.2) You might have to write a small script to delete the shortcut from C:\Users\Public\Desktop, if you do not want a desktop shortcut.Place this CA at the end just before InstallFinalize.

Is there no way just to copy the master_preferences file into the folder after the install (before opening Chrome)? I assumed an new user on the PC would then use that file, is this not correct? Appreciate the help.

Thats the bit that does not work for me. I Install Chrome, copy master_preferences file (via script) into the Chrome.exe folder. Its there, I confirmed it. Any new user that gets added to the PC should use that file on first run, but non of the settings are applied. Its simply ignored. I was trying not top hack the MSI, am I missing something?

I have read your blog and the offical pages. The offical http://support.google.com/chrome/a/bin/answer.py?hl=en&answer=187948 document. Bullet point 2 which states same folder as Chome.exe

Your blog says "Google\Chome\Application". The offical docs say "C:\Program Files\Google\Chrome\Application". Both of which ARE where chrome.exe sits on my PC. Chrome_launcher.exe is in a subfolder called "26.0.1410.64" along with numerous other files.

hi m new to packaging team ,m assigned wid google chrome msi in which i hav to set home page url which is provided by my company n i hav to enable n disable following properties : PasswordManagerEnabled - enabledRestoreOnStartup - disableEnableOnlineRevocationChecks -disable

Hi,Could you suggest me..how to suppress the google sign in tab in chrome...so that i can stop sync in chrome.....Reason: i have changed the master_prefernce file so that i could set WWW.*****.com as home page.....but after install, when i launch chrome..first tab comes up to sign in and in the next tab my home page opens...i want to supress the sign in page

Boss, I am happy to help and guide you but not obligated to hurry and give you a response. You need to understand that this blog is not for solving individual problems as a P1 urgency..Anyways, I would suggest you to make your homepage manually in your browser and see if there is a difference in the master_prferences file. If there is then use that preferences file.

Thansk for a lovely post.However, I am new to Packaging and din understand how to change the custom actions for 3 calluninstaller things to remove all and how to do a customa action to delete the shortcut fromt he desktop and also the sequence change.I am using Wise and have create a MST but just need to do the following modificaitons.can you please elaborate.

Go to Tables in WISE and then to InstallExecuteSequence table. Sort the actions with Sequence number.You will see 3 actions there which would be starting with CallUninstaller, add the condition to them as I have suggested.Sequence change you can do by just changing the sequence number in the above mentioned table.Search for a vbscript to delete file and you can use that script as a Custom Action. Use CallVBScript from embedded code custom action.

when using the uninstall VBS it works perfect if i run it locally. However, when i remotely execute it on a pc it removes chrome but it leaves the pinned icon in the toolbar. when you click on the icon in the toolbar it asks if you want to delete it.

I am checking the existance of chrome in the script through registry. check if that registry is present in your machine where chrome is installed or not. You can change that part in the script according to your needs.Hope it helps.

Hi can anyone tell me how to remove desktop and taskbar shortcut...I am edited master_preferences till also my package is installing desktop and taskbar shortcuts ????It's very urgent issue some one help me to find it out ?????

Hi Piyush, I was fiddling with the Chrome package for version 34.0.1847.131. I am having an issue finding that registry key to disable autoupdates as posted. I am thinking I have to create that key and I'll give that a try, but it doesn't seem to be there after the Enterprise install. BTW - thanks for this thread. The package is almost there.

Hi Piyush,I am working to build a install script(vbs or batch) that installs chrome and sets a custom url, something like https://prod.ge.com as a default homepage.. also install the extension legacy browser support? can you help me how we achieve that?

In master_prefrences file, change the homepage to what you want. I have mentioned it as my website. You can change it to yours.what type of extension is it. Can you capture it and add to your MSI through MST?

Few machine accepting the installer without error . few machine not installing the msi.

Product: Google Chrome -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action DoInstall, location: C:\Windows\Installer\MSID933.tmp, command: /silent /install "appguid={8A69D345-D564-463c-AFF1-A69D9E530F96}&appname=Google Chrome&needsAdmin=True&brand=GGRV" /installsource enterprisemsi /appargs "appguid={8A69D345-D564-463c-AFF1-A69D9E530F96}&installerdata=%7B%22distribution%22%3A%7B%22msi%22%3Atrue%2C%22system_level%22%3Atrue%2C%22verbose_logging%22%3Atrue%7D%7D"

I'm trying to improve my Chef cookbook recipe that installs Chrome on Windows. I need to know during provisioning of a server, what version of Chrome would be installed. Is there a way to do this? I tried to use the registry, but it is not available during installation. It also looks like I'm installing only 32 bit version. Do you know a url to a 64bit version? The cookbook can be found here: https://github.com/dhoer/chef-chrome. Any help to make this cookbook better would be awesome.

I never allow comments which have links to other sites, but I must say that you are doing an awesome job so had to post your comment. But really sorry to say that I cannot help you much on what you have asked for. But I keep it in this forum if someone else reads it and can answer this.

Hi Piyush I am packaging Google chrome 38.0.2125.11 enterprise edition i.e an MSI which i have downloaded. I have requirement to disable the option of adding the users i.e setting --> users--> This tab should be completely disabled for me , Let me know any suggestions to achieve this

Hi, I have a script for uninstalling any application which relies on reading and executing the Uninstallstring from registry. It works for HKLM, HKCU and HKU. It loops through all users and is looking for user installed applications and tries to remove them. For case of google chrome user based installation, I am facing errors 15 & 19. Looks like I cannot uninstall the app from different context than the user's who initially installed it. I am looking to uninstall it from the SYSTEM context as my agent will do the trick. There is not much written about it on the internet since everyone omits this eventuality, so I was wondering if you would know.

I need to uninstall all userbased chromes from %userprofile% and install an enterprise version which will go to %Programfiles%.

Hi Petr,Did you try active setup?Copy the script somewhere in the system drive which is accessible by all users and then create Active Setup key, which will run your uninstall script in user context when the user logs off and logs back in.Cheers,Piyush

Haven't tried this yet, however, it looks to me there is nothing else I could do (apart of variety of options on this particular method).I was really hoping I could remove it while running in SYSTEM context.Are you sure it cannot be done ?