My favorites | Sign in
Google
Project hosting will be READ-ONLY Wednesday, 7AM PST due to brief network maintenance
                
Search
for
Updated Sep 22, 2009 by ddorwin+...@google.com
Labels: Featured
DeveloperSetupGuide  
Instructions for how to set up a build environment for Omaha

Introduction

These instructions are intended to assist the would-be Omaha developer with setting up an environment in which to successfully build the Omaha source code.

Required Downloads

The following packages are required to build Omaha:

  • Omaha source code
  • Microsoft Visual C++
    • You will need to have at least the Standard Edition of Visual C++ or Visual Studio. (Note: The Express Editions are not sufficient because they do not include ATL/MFC, which Omaha requires.)
    • Omaha builds with both Microsoft Visual Studio 2005 and 2008 versions (Visual C++ 8.0 and 9.0 respectively). To select between development environments, call the vcvarsall.bat script, which is found in the corresponding VC directory. Building with Visual Studio 2008 requires newer versions of Windows SDK. Use either version 6.0A that comes with Visual Studio 2008 or version 6.1.
  • Microsoft Vista SDK
    • Download the SDK here.
  • Microsoft .NET Framework 2.0
    • This is pre-installed on Windows Vista machines and most Windows XP SP2 machines.
    • If you do not see %WINDIR%\Microsoft.NET\Framework\v2.0.50727\csc.exe, you may need to download it here.
  • WTL
  • WiX
    • Download any of the v3 binaries packages here.
  • Python 2.4 (Be sure to use 2.4, other versions have been seen to break the build)
  • SCons
    • Download SCons here.
  • Software Construction Toolkit Source (needs SVN)
    • Get the Software Construction Toolkit Source here.

Details

Installation

  1. Install each of the above software packages that comes with an installer, which is all of them except Omaha source code and the Software Construction Toolkit.
  2. Make sure you add the installed python directory to your path environment variable.
  3. Follow the Software Construction Toolkit installation instructions. Make sure you don't miss the part about setting up the SCONS_DIR environment variable.
  4. Extract or checkout the Omaha source code to a location of your choice, perhaps something like "C:\Omaha"

Environment Variables

Create the following environment variables:

Setup the environment variable for the installed version of Visual Studio

For the build script to pick up the correct version of Visual Studio, it is usually necessary to call a script provided with Visual Studio. For instance, in the case of Visual Studio 2005, the name of the script is vcvarsall.bat.

Build

Once the above setup is complete:

  1. Open a fresh cmd.exe window (if you're running under Vista, make sure cmd.exe is running as Administrator)
  2. Navigate to the 'Omaha' directory, or whatever you called it.
  3. From the above directory, just type hammer to build Omaha! (Note: More advanced build options can be found in HammerOptions.)

Running Unit Tests

In order to pass all of the unit tests, there is one other piece of setup required. You must download Windows SysInternals PsExec (you can get it here) and save psexec.exe somewhere. Then you will need to set an environment variable named OMAHA_PSEXEC_DIR to the directory containing psexec.exe.

The unit tests also expect a value to be set in the registry. Create the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Google\UpdateDev. Then, add a string value named TestSource with the value ossdev.

When running unit tests:

  • You must be connected to the Internet for some tests to pass.
  • We recommend running them with administrator privileges as some tests do not run otherwise.

Some tests do not run by default because they take a long time or are otherwise inconvenient to run all the time. To run these tests, define the OMAHA_RUN_ALL_TESTS environment variable. For example, set OMAHA_RUN_ALL_TESTS=1.


Comment by setiawaniwan575, Apr 10, 2009

saya mau mendapatkan restribusi penuh dari google tapi saya orang bodo yg ingin maju,sukses

Comment by dawitaklilu2000, Apr 13, 2009

WOW am i the first one here who thinks this is cool? Thanks google.....now can we get source code for Google search engine it self...thanks!

Comment by albertoferrer, Apr 13, 2009

Agree with dawita :D

Comment by mailwangkun, Apr 13, 2009

This is cool, thanks.

Comment by rwparris2, Apr 13, 2009

Thanks for opening up the source!

Any chance this will ever be cross platform?

Comment by djn007, Apr 14, 2009

Running Omaha Unit Tests by manually setting Registry Key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Google\UpdateDev]
"TestSource"="dev"
Comment by adi.ya...@gmail.com, Apr 14, 2009

sounds good people....:) @rwparris2 ..dude this why do we need it cross platform... update-engine is thr for mac/osx and linux has a zillion more options...apt/yum/pacman..why waste effort in replacing them when they are already mature enough..

Comment by pgathogo, Apr 15, 2009

I wonder why you have to install lots of supporting applications just to compile this updater, why not work from one environment e.g. visual c++ or Python, better still Delphi...but both, to me this an overkill.

Somebody explain to me why we need all this pieces!

Comment by sorinj, Apr 15, 2009

There are quite a few of prerequisites indeed.

A few are needed to support the build system. We've found Visual Studio-style solutions do not scale well and integrate with automated build farms. That's why we have dependencies on Python, Scons, and SCT are for. Wix is needed to generate the MSI/MSP artifacts. The rest of the depencencies are the development tools for Windows.

Comment by weinjared, Apr 15, 2009

If you have both VS2005 and VS2008 installed, you should run "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" to set your environment variables for VS2005. This can save you some headaches.

Comment by pgathogo, Apr 15, 2009

sorinj, For christ sake why python 2.4? why not 2.5! which is widely used! And can it compile on XP? Is it possible to get some sort of a SR documentation for the updater, i would want to read how the updater works. Thanks

Comment by Cadenza.Yu, May 04, 2009

mi.res : fatal error LNK1103: debugging information corrupt; recompile module scons: building terminated because of errors.

;-(

VISTA + VS2005 + WINSDKV6.1

Comment by sorinj, May 05, 2009

Would it help deleting the whole scons-out and starting over?

Comment by djnavi, May 14, 2009

I have a question Omaha use WIX for create installers, I can use any? for example Inno Setup?

Thanks for the answer :)

Comment by ddorwin+...@google.com, May 14, 2009

Omaha supports .msi and .exe installers. Applications can create their installers however they want as long as they are valid MSI or EXE installers and run silently.

As part of the build, Omaha uses WiX to generate MSIs for use in testing.

Comment by michael.r.caron, Jul 02, 2009

Hammer pukes on me after I go through the setup:

  E:\Development\Projects\Omaha>hammer
  scons: Reading SConscript files ...
  Using precompiled headers.
  Working on versions: 1.2.177.0 
  AttributeError: SConsEnvironment instance has no attribute 'WiX':
    File "E:\Development\Projects\Omaha\main.scons", line 736:
    windows_coverage_env

Envt:

OMAHA_NET_DIR=C:\Windows\Microsoft.NET\Framework\v2.0.50727
OMAHA_PYTHON_DIR=C:\Python25
OMAHA_VISTASDK_DIR="C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A"
OMAHA_WIX_DIR=E:\Development\Tools\Windows Installer XML v3
OMAHA_WTL_DIR=E:\Development\Tools\WTL80
SCONS_DIR=C:\Python25\Lib\site-packages\scons-1.2.0
SCT_DIR=E:\Development\Tools\swtoolkit
WIX=E:\Development\Tools\Windows Installer XML v3\

Vista 64, Win SDK 6.0A, Visual Studio 2008

:( thoughts?

Comment by ddorwin+...@google.com, Jul 02, 2009

The WiX tool is added at line 566 of main.scons, so 'WiX' should be found. It looks like you are using Python 2.5. As noted above, Python 2.4 is required as other versions have been seen to break the build. There appear to be incompatibilities with SCons and other versions of Python. It's possible that this is what is causing this problem.

Another possibility is that something is not correctly handling the spaces in your OMAHA_WIX_DIR value. Maybe try using a path without spaces. The environment variable WIX should not be necessary.

Comment by 2828628, Jul 12, 2009

where is the server source code?

Comment by ddorwin+...@google.com, Jul 13, 2009

The server is not open source. I've added some information about the protocol to the wiki: http://code.google.com/p/omaha/wiki/ServerProtocol.


Sign in to add a comment