Posts Tagged ‘google’

I wrote this up for appdeploy back in March 2007, but reproduce it here:


Installing Google Earth Pro 4 in a corporate environment using SMS using a per-machine based installation.

This solution consists of 5 main steps:

1. Do an installation of Google Earth, including the registration information. This puts down a bunch of files into C:\Documents and Settings\USERNAME\Application Data\Google\GoogleEarth. As well as a whole lotta reg keys under HKEY_CURRENT_USER\Software\Google.

2. Put these files into a safe location. Export the registry keys into a .reg file.

3. I created an msi to dump these files and the .reg file into the Program Files>Google Earth directory. I also created an Active Setup key to run a script when the user next logs in to the machine. It’s located at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\GoogleEarth and
I created ComponentID, StubPath and Version. There are better places to read up on Active Setup…
The last thing I put into the msi was the vbscript referred to in the StubPath key.

4. This script which will be on the local machine and run as the user should create C:\Documents and Settings\USERNAME\Application Data\Google\GoogleEarth where you replace USERNAME with the correct user. Then there are 4 reg keys that contain this path. I created them in vbscript as follows:

Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

' Create the two keys if they don't exist
strKeyPath = "Software\Google\CommonSettings"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strKeyPath = "Software\Google\Google Earth Pro"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath

' All keys have the same strValue
strValue = "C:\Documents and Settings\" & strUser & "\Application Data\Google\GoogleEarth"

strKeyPath = "Software\Google\CommonSettings"
strValueName = "KmlPath"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

' Same strKeyPath from here on
strKeyPath = "Software\Google\Google Earth Pro"
strValueName = "DefaultKMLPath"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "KmlPath"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "CachePath"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

Then, I copy the required user files into their profile..

Const OverWriteFiles = True
objFSO.CopyFolder "C:\Program Files\Google\Google Earth Pro\UserFiles", strDirectory, OverWriteFiles

And then install all the other registry keys into current user. This includes the registration information

strCommand1 = "regedit.exe /s " & Quotes & PWD & "UserFiles\google_current_user.reg" & Quotes
WScript.Echo strCommand1
return = objShell.Run (strCommand1,0,True)

5. To get all this to run through SMS, I wrote a vbscript which performs the install with .iss file
“GoogleEarthWinProSetup.exe /s /SMS /f1setup.iss /f2c:\google.log”. Of course, do what you have to do to correctly point to the setup and iss files. After that I found that googleearth.exe was running, so I kill that process so that it doesn’t go off and create reg keys. Lastly, I install my msi.

Clear as mud!


Read Full Post »