Difference between revisions of "Google Chrome"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(Note for Remote Desktop Services)
(Added section on automating updates for Chrome's WPKG files)
Line 20: Line 20:
 
just in case that doesnt work... I had changed the policy while it was stalling on the please wait... and MAKE SURE noone installed chrome on their profile... you can only see their chrome in add/remove programs on their profile
 
just in case that doesnt work... I had changed the policy while it was stalling on the please wait... and MAKE SURE noone installed chrome on their profile... you can only see their chrome in add/remove programs on their profile
 
This worked for me
 
This worked for me
 +
 +
== Automated Updates of Chrome's WPKG Files ==
 +
 +
This is a VBScript we run on our WPKG server that downloads the current Chrome MSI, renames it according to the Chrome release number, and updates the package XML files accordingly. This greatly simplifies rolling out new versions of Chrome: we watch the [http://googlechromereleases.blogspot.com/atom.xml Google Chrome Releases RSS feed], and anytime we see a stable channel update, we run our VBScript. It's been working since April, for Chrome releases 18 through 21.
 +
 +
=== update-chrome.vbs ===
 +
 +
<source lang='vb'>
 +
' update-chrome.vbs -- stored in %SOFTWARE%\google-chrome
 +
Option Explicit
 +
Dim objFSO, objFile, strFileProperties, objShell, strChromePath, strChromeURL
 +
Dim strVersion, objResult, strChromeFilename, objOleFile, arrComments
 +
Dim strTemplateFilename, ForReading, ForWriting, strText
 +
Dim strNewText
 +
 +
strChromePath = "L:\wpkg\software\google-chrome\"
 +
strChromeFilename = "GoogleChromeStandaloneEnterprise.msi"
 +
strTemplateFilename = "google-chrome-template.xml"
 +
strChromeURL = "https://dl.google.com/edgedl/chrome/install/" & _
 +
strChromeFilename
 +
 +
Set objShell = CreateObject("WScript.Shell")
 +
Set objFSO = CreateObject("Scripting.FileSystemObject")
 +
Set objOleFile = CreateObject("DSOFile.OleDocumentProperties")
 +
 +
objShell.CurrentDirectory = strChromePath
 +
objResult = objShell.Run("wget --no-check-certificate " & strChromeURL, _
 +
1, True)
 +
If objFSO.FileExists(strChromePath & strChromeFilename) Then
 +
' Grab version number. Requires Office installation, or DSOFile.dll
 +
' from http://support.microsoft.com/kb/224351
 +
objOleFile.Open(strChromePath & strChromeFilename)
 +
arrComments = Split(objOleFile.SummaryProperties.Comments, " ", 2)
 +
strVersion = arrComments(0)
 +
objOleFile.Close
 +
 +
' Make a copy of the file
 +
Set objFile = objFSO.GetFile(strChromePath & strChromeFilename)
 +
objFile.Copy strChromePath & "GoogleChromeStandaloneEnterprise-" & _
 +
strVersion & ".msi", True
 +
' Delete the original file
 +
objFile.Delete True
 +
' Update package definitions
 +
updateXML strTemplateFilename, _
 +
"..\..\packages\google-chrome.xml" ' legacy tree
 +
updateXML strTemplateFilename, _
 +
"..\..\dev\packages\google-chrome.xml" ' dev tree
 +
updateXML strTemplateFilename, _
 +
"..\..\stable\packages\google-chrome.xml" ' stable tree
 +
Else
 +
MsgBox "Selected file does not exist!"
 +
End If
 +
 +
Sub updateXML(strTemplateFilename, strPackageFilename)
 +
' Update package definition
 +
ForReading = 1
 +
ForWriting = 2
 +
Set objFile = objFSO.OpenTextFile(strTemplateFilename, ForReading)
 +
strText = objFile.ReadAll
 +
objFile.Close
 +
strNewText = Replace(strText, "__VERSION__", strVersion)
 +
 +
Set objFile = objFSO.OpenTextFile(strPackageFilename, ForWriting)
 +
objFile.WriteLine strNewText
 +
objFile.Close
 +
End Sub
 +
</source>
 +
 +
=== google-chrome-template.xml ===
 +
 +
<source lang='xml'>
 +
<!--
 +
Thie file generated from %SOFTWARE%\google-chrome\update-chrome.vbs and google-chrome-template.xml
 +
Manual edits to packages\google-chrome.xml will be overwritten.
 +
-->
 +
<packages>
 +
<package
 +
  id="google-chrome"
 +
  name="Google Chrome"
 +
  revision="%version%"
 +
  reboot="false">
 +
 +
  <variable name="version" value="__VERSION__" />
 +
  <variable architecture="x86" name="progfiles" value="%PROGRAMFILES%" />
 +
  <variable architecture="x64" name="progfiles" value="%PROGRAMFILES(X86)%" />
 +
 +
  <check
 +
    type="uninstall"
 +
    condition="exists"
 +
    path="Google Chrome" />
 +
  <check
 +
    type="file"
 +
    condition="versionequalto"
 +
    path="%progfiles%\Google\Chrome\Application\chrome.exe"
 +
    value="%version%" />
 +
 +
  <install cmd="taskkill /F /IM chrome.exe">
 +
    <exit code="any" />
 +
  </install>
 +
  <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\google-chrome\GoogleChromeStandaloneEnterprise-%version%.msi"' />
 +
 +
  <upgrade include='install' />
 +
 +
  <remove cmd="taskkill /F /IM chrome.exe">
 +
    <exit code="any" />
 +
  </remove>
 +
  <remove cmd='msiexec /qn /x {54DF35BD-4A36-35DA-B029-A0C083C88614}' />
 +
</package>
 +
</packages>
 +
 +
</source>
 +
 +
--[[User:Mwr|Mwr]] 17:05, 10 August 2012 (CEST)
  
 
== Google Chrome 18 ==
 
== Google Chrome 18 ==

Revision as of 15:05, 10 August 2012

Chrome is a web browser from Google.

Watch the Google Chrome Releases blog for info about new versions.

Download

You can download the current stable version of Google Chrome as an MSI file from http://www.google.com/chrome/eula.html?msi=true&platform=win.

Note for Remote Desktop Services

Windows Server 2008 R2 has a new feature called Windows Installer RDS Compatibility. This feature is enabled by default when using Remote Desktop Services and will cause some MSI installers to hang. When run through WPKG the install process will appear to never finish. When run with the same parameters from a command-line you'll see a Windows Installer dialog that asks you to wait and a progress bar that repeatedly completes and restarts. To successfully install Chrome on an RDS server you need to a registry key to disable this feature: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services\TSAppSrv\TSMSI, add a DWORD called Enable set to zero. The keys TSAppSrv and TSMSI probably won't exist and need to be created.

  • update* If you don't feel safe messing with the registry then you can also change

Start>control panel> search for install application on remote desktop. Browse to the msi file listed above.

Start>run>MMC.exe addin> Group Policy ObjectEditor \Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Application Compatibility – Turn off Windows Installer RDS Compatibility

Turn back on after your done...

just in case that doesnt work... I had changed the policy while it was stalling on the please wait... and MAKE SURE noone installed chrome on their profile... you can only see their chrome in add/remove programs on their profile This worked for me

Automated Updates of Chrome's WPKG Files

This is a VBScript we run on our WPKG server that downloads the current Chrome MSI, renames it according to the Chrome release number, and updates the package XML files accordingly. This greatly simplifies rolling out new versions of Chrome: we watch the Google Chrome Releases RSS feed, and anytime we see a stable channel update, we run our VBScript. It's been working since April, for Chrome releases 18 through 21.

update-chrome.vbs

' update-chrome.vbs -- stored in %SOFTWARE%\google-chrome
Option Explicit
Dim objFSO, objFile, strFileProperties, objShell, strChromePath, strChromeURL
Dim strVersion, objResult, strChromeFilename, objOleFile, arrComments
Dim strTemplateFilename, ForReading, ForWriting, strText
Dim strNewText

strChromePath = "L:\wpkg\software\google-chrome\"
strChromeFilename = "GoogleChromeStandaloneEnterprise.msi"
strTemplateFilename = "google-chrome-template.xml"
strChromeURL = "https://dl.google.com/edgedl/chrome/install/" & _
	strChromeFilename

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOleFile = CreateObject("DSOFile.OleDocumentProperties")

objShell.CurrentDirectory = strChromePath
objResult = objShell.Run("wget --no-check-certificate " & strChromeURL, _
	1, True)
If objFSO.FileExists(strChromePath & strChromeFilename) Then
	' Grab version number. Requires Office installation, or DSOFile.dll
	' from http://support.microsoft.com/kb/224351
	objOleFile.Open(strChromePath & strChromeFilename)
	arrComments = Split(objOleFile.SummaryProperties.Comments, " ", 2)
	strVersion = arrComments(0)
	objOleFile.Close

	' Make a copy of the file
	Set objFile = objFSO.GetFile(strChromePath & strChromeFilename)
	objFile.Copy strChromePath & "GoogleChromeStandaloneEnterprise-" & _
		strVersion & ".msi", True
	' Delete the original file
	objFile.Delete True
	' Update package definitions
	updateXML strTemplateFilename, _
		"..\..\packages\google-chrome.xml" ' legacy tree
	updateXML strTemplateFilename, _
		"..\..\dev\packages\google-chrome.xml" ' dev tree
	updateXML strTemplateFilename, _
		"..\..\stable\packages\google-chrome.xml" ' stable tree
Else
	MsgBox "Selected file does not exist!"
End If

Sub updateXML(strTemplateFilename, strPackageFilename)
	' Update package definition
	ForReading = 1
	ForWriting = 2
	Set objFile = objFSO.OpenTextFile(strTemplateFilename, ForReading)
	strText = objFile.ReadAll
	objFile.Close
	strNewText = Replace(strText, "__VERSION__", strVersion)

	Set objFile = objFSO.OpenTextFile(strPackageFilename, ForWriting)
	objFile.WriteLine strNewText
	objFile.Close
End Sub

google-chrome-template.xml

<!--
Thie file generated from %SOFTWARE%\google-chrome\update-chrome.vbs and google-chrome-template.xml
Manual edits to packages\google-chrome.xml will be overwritten.
-->
<packages>
<package
  id="google-chrome"
  name="Google Chrome"
  revision="%version%"
  reboot="false">
 
  <variable name="version" value="__VERSION__" />
  <variable architecture="x86" name="progfiles" value="%PROGRAMFILES%" />
  <variable architecture="x64" name="progfiles" value="%PROGRAMFILES(X86)%" />
 
  <check
    type="uninstall"
    condition="exists"
    path="Google Chrome" />
  <check
    type="file"
    condition="versionequalto"
    path="%progfiles%\Google\Chrome\Application\chrome.exe"
    value="%version%" />
 
  <install cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </install>
  <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\google-chrome\GoogleChromeStandaloneEnterprise-%version%.msi"' />
 
  <upgrade include='install' />
 
  <remove cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </remove>
  <remove cmd='msiexec /qn /x {54DF35BD-4A36-35DA-B029-A0C083C88614}' />
</package>
</packages>

--Mwr 17:05, 10 August 2012 (CEST)

Google Chrome 18

Chrome shows an unrelated product version in Uninstall Programs, so the package definition checks only that it is present and then checks the actual version against chrome.exe.

Chrome can be updated while it's running, but the changes won't happen until the running process is closed.

<package
  id="chrome"
  name="Chrome"
  revision="%version%"
  reboot="false">
		
  <variable name="version" value="18.0.1025.162" />
  <variable architecture="x86" name="progfiles" value="%PROGRAMFILES%" />
  <variable architecture="x64" name="progfiles" value="%PROGRAMFILES(X86)%" />
		
  <check
    type="uninstall"
    condition="exists"
    path="Google Chrome" />
  <check
    type="file"
    condition="versionequalto"
    path="%progfiles%\Google\Chrome\Application\chrome.exe"
    value="%version%" />

  <install cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </install>
  <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise-%version%.msi"' />

  <upgrade cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </upgrade>
  <upgrade cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise-%version%.msi"' />
		
  <remove cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </remove>
  <remove cmd='msiexec /qn /x {E59AB510-8AEA-36BC-91D5-B25791AD224F}' />
</package>

Older Versions

Google Chrome 16

Chrome shows an unrelated product version in Uninstall Programs, so the package definition checks only that it is present and then checks the actual version against chrome.exe.

Chrome can be updated while it's running, but the changes won't happen until the running process is closed.

Note that Windows Server 2008 R2 has a new feature called Windows Installer RDS Compatibility. This feature is enabled by default when using Remote Desktop Services and will cause some MSI installers to hang. When run through WPKG the install process will appear to never finish. When run with the same parameters from a command-line you'll see a Windows Installer dialog that asks you to wait and a progress bar that repeatedly completes and restarts. To successfully install Chrome on an RDS server you need to a registry key to disable this feature: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services\TSAppSrv\TSMSI, add a DWORD called Enable set to zero. The keys TSAppSrv and TSMSI probably won't exist and need to be created.

<package
  id="chrome"
  name="Chrome"
  revision="%version%"
  reboot="false">
		
  <variable name="version" value="16.0.912.77" />
  <variable architecture="x86" name="progfiles" value="%PROGRAMFILES%" />
  <variable architecture="x64" name="progfiles" value="%PROGRAMFILES(X86)%" />
		
  <check
    type="uninstall"
    condition="exists"
    path="Google Chrome" />
  <check
    type="file"
    condition="versionequalto"
    path="%progfiles%\Google\Chrome\Application\chrome.exe"
    value="%version%" />
		
  <install cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </install>
  <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise-%version%.msi"' />

  <upgrade cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </upgrade>
  <upgrade cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise-%version%.msi"' />
		
  <remove cmd="taskkill /F /IM chrome.exe">
    <exit code="any" />
  </remove>
  <remove cmd='msiexec /qn /x {368673BE-F66E-3BB4-832C-8EAF0B4AF939}' />
</package>

Google Chrome 15

This is a silent installer and uninstaller for Google Chrome with support for 32-bit and 64-bit systems.

 <package id="chrome" name="Google Chrome" revision="%version%" priority="20" reboot="false">

        <variable name="version" value="15.0.874.120" />

        <check type="uninstall" condition="exists" path="Google Chrome" />

        <check type="logical" condition="or">
            <check type="file" condition="exists" path="%PROGRAMFILES%\Google\Chrome\Application\11.0.696.57\nacl64.exe" />
            <check type="file" condition="exists" path="%PROGRAMFILES(x86)%\Google\Chrome\Application\11.0.696.57\nacl64.exe" />
        </check>

        <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise.msi"' />

        <upgrade cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise.msi"' />

        <remove cmd="msiexec /qn /x {54DF35BD-4A36-35DA-B029-A0C083C88614}" />
 </package>


Google Chrome 11

This is a silent installer and uninstaller for Google Chrome with support for 32-bit and 64-bit systems.

<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package id="chrome" name="Google Chrome 11" revision="11.0.696.57" priority="20" reboot="false">

        <check type="uninstall" condition="exists" path="Google Chrome" />

        <check type="logical" condition="or">
            <check type="file" condition="exists" path="%PROGRAMFILES%\Google\Chrome\Application\11.0.696.57\nacl64.exe" />
            <check type="file" condition="exists" path="%PROGRAMFILES(x86)%\Google\Chrome\Application\11.0.696.57\nacl64.exe" />
        </check>

        <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise.msi"' />

        <upgrade cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChromeStandaloneEnterprise.msi"' />

        <remove cmd="msiexec /qn /x {54DF35BD-4A36-35DA-B029-A0C083C88614}" />
    </package>
</packages>


Google Chrome 10

<?xml version="1.0" encoding="UTF-8"?>

<packages>
   <package id="chrome" name="Google Chrome" revision="10.0.648.205" reboot="false" priority="2" >

    <check type="uninstall" condition="exists" path="Google Chrome"/>

    <check type="file" condition="exists" path="%PROGRAMFILES%\Google\Chrome\Application\10.0.648.205\nacl64.exe" />

    <install cmd='%SOFTWARE%\chrome\chrome_installer.exe --system-level --do-not-launch-chrome'/>

    <upgrade cmd='%SOFTWARE%\chrome\chrome_installer.exe --system-level --do-not-launch-chrome'/>

    <remove cmd='%SOFTWARE%\chrome\chrome_installer.exe --uninstall --force-uninstall --system-level'/>
   </package>
</packages>


Google Chrome 9

<?xml version="1.0" encoding="UTF-8"?>
<packages>

  <package id="chrome" name="Google Chrome 9" revision="9.2.21854" reboot="false" priority="20">

    <check type="uninstall" condition="exists" path="Google Chrome"/>

    <check type="file" condition="exists" path="%PROGRAMFILES%\Google\Chrome\Application\9.0.597.94\nacl64.exe" />
 
    <install cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChrome.msi"' />

    <upgrade cmd='msiexec /qn /norestart /i "%SOFTWARE%\chrome\GoogleChrome.msi"' />

    <remove  cmd='msiexec /qn /x {54DF35BD-4A36-35DA-B029-A0C083C88614}' />
  </package>
</packages>


Google Chrome 7.0

<?xml version="1.0" encoding="UTF-8"?>

<packages>
   <package id="chrome" name="Google Chrome" revision="1" reboot="false" priority="2" >

    <check type="uninstall" condition="exists" path="Google Chrome"/>

    <check type="file" condition="exists" path="%PROGRAMFILES%\Google\Chrome\Application\7.0.517.41\nacl64.exe" />

    <install cmd='%SOFTWARE%\chrome\chrome_installer.exe --system-level --do-not-launch-chrome'/>

    <upgrade cmd='%SOFTWARE%\chrome\chrome_installer.exe --system-level --do-not-launch-chrome'/>

    <remove cmd='%SOFTWARE%\chrome\chrome_installer.exe --uninstall --force-uninstall --system-level'/>
   </package>
</packages>


Google Chrome 5.0

<?xml version="1.0" encoding="UTF-8"?>

<packages
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../xsd/packages.xsd" >

   <package id="chrome" name="Google Chrome" revision="1" reboot="false" priority="2" >

    <check type="uninstall" condition="exists" path="Google Chrome"/>

    <check type="file" condition="exists" path="%PROGRAMFILES%\Google\Chrome\Application\5.0.375.70\nacl64.exe" />

    <install cmd='%SOFTWARE%\chrome\chrome_installer.exe --system-level --do-not-launch-chrome'/>

    <upgrade cmd='%SOFTWARE%\chrome\chrome_installer.exe --system-level --do-not-launch-chrome'/>

    <remove cmd='%SOFTWARE%\chrome\chrome_installer.exe --uninstall --force-uninstall --system-level'/>
   </package>
</packages>


Per-user Installation

This is a silent installer and uninstaller for Google Chrome. This will install Google Chrome only for the user running WPKG.

Normally, Google Chrome installs per-user. To install it system-wide into the %PROGRAMFILES% directory, use the chrome_installer.exe installer and the --system-level option. Note that the regular Chrome standalone installer (ChromeStandaloneSetup.exe) does not seem to accept any command-line switches and can't be made to install silently.

Interesting side note: even though you can't make ChromeStandaloneSetup.exe install silently, you can get a version of it that will install system-wide. To get this, download the regular version of ChromeStandaloneSetup.exe. Make a note of the URL of the file (in Firefox, right-click on the hyperlink and select "copy download link"). This URL will include the string 'needadmin%3Dfalse'. Replace 'needadmin%3Dfalse' with 'needadmin%3Dtrue' and download again from this modified URL. This will give you an installer for system-wide installation.

<package
	id="chrome"
	name="Google Chrome"
	revision="18"
	reboot="postponed"
	priority="5">

	<!--<check type="uninstall" condition="exists" path="Google Chrome" /> This doesn't work for per-user appliations... -->
	<check type="file" condition="exists" path="%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" />
	
	<install cmd="%SOFTWARE%\chrome\chrome_installer.exe"/> 

	<install cmd="PING LOCALHOST -n 5"/>

	<install cmd="taskkill /IM chrome.exe">
           <exit code="any"/>
        </install>	

	<install cmd='cmd /c mkdir "%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application"'>
           <exit code="any"/>
        </install >

        <install cmd='cmd /c echo hello > "%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\First Run"'/>

	<upgrade cmd="%SOFTWARE%\chrome\chrome_installer.exe"/> 

	<upgrade cmd="PING LOCALHOST -n 5"/> 

	<upgrade cmd="taskkill /IM chrome.exe">
          <exit code="any"/>
        </upgrade>	

        <!-- CHANGE PATH WHENEVER THERE IS A NEW VERSION -->
	<remove cmd='"%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\1.0.154.59\Installer\setup.exe" --uninstall --force-uninstall'/>
</package>


Disabling Updates

See [1].

    <package id="google-chrome-pol-no.update"
            name="Google Chrome (Policy) - Disable updates"
            revision="1"
            reboot="false"
            priority="1">

        <depends package-id="google-chrome"/>

        <variable name="PKG_KEY"           value="HKLM\SOFTWARE\Policies\Google\Update"/>
        <variable name="PKG_VALUE"         value="Update{4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D}"/>
        <variable name="PKG_DATA"          value="0"/>

        <check type="registry" condition="equals" path="%PKG_KEY%\%PKG_VALUE%" value="%PKG_DATA%" />

        <install cmd='reg add %PKG_KEY% /v %PKG_VALUE% /d %PKG_DATA% /t REG_DWORD /f'/>

        <upgrade include="install" />

        <remove cmd='reg delete %PKG_KEY% /v %PKG_VALUE% /f'/>
    </package>


External Links