IntroductionThese 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 DownloadsThe following packages are required to build Omaha: - Omaha source code
- You can either:
- Download a full source package from the Downloads area.
- See source checkout for setting up access to the subversion repository. This will also require SVN itself.
- However you get the source code, it must be checked out or extracted to a directory named omaha exactly.
- 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
- 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
- Software Construction Toolkit Source (needs SVN)
- Get the Software Construction Toolkit Source here.
DetailsInstallation- 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.
- Make sure you add the installed python directory to your path environment variable.
- Follow the Software Construction Toolkit installation instructions. Make sure you don't miss the part about setting up the SCONS_DIR environment variable.
- Extract or checkout the Omaha source code to a location of your choice, perhaps something like "C:\Omaha"
Environment VariablesCreate the following environment variables: - SCT_DIR - set to the directory of the Software Construction Toolkit (eg. C:\swtoolkit)
- OMAHA_NET_DIR - This will depend on your OS:
- On Windows Vista or if it was pre-installed on Windows XP, set it to the framework directory (something like C:\Windows\Microsoft.NET\Framework\v2.0.50727).
- Otherwise, set it to the directory where the .NET framework is installed. (eg. C:\Program Files\Microsoft.NET\Framework\v2.0.50727)
- OMAHA_PYTHON_DIR - set to the directory where python was installed. This directory should contain python.exe. (eg. C:\python_24)
- OMAHA_VISTASDK_DIR - set to the directory where the Vista SDK was installed (e.g. C:\Program Files\Microsoft SDKs\Windows\v6.0)
- OMAHA_WIX_DIR - set to the directory in WiX where 'candle.exe' and 'light.exe' are installed. This may be something like (eg. C:\Program Files\Windows Installer XML v3\bin)
- OMAHA_WTL_DIR - set to the include directory in the WTL installation (eg. C:\Program Files\WTL\include)
Setup the environment variable for the installed version of Visual StudioFor 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. BuildOnce the above setup is complete: - Open a fresh cmd.exe window (if you're running under Vista, make sure cmd.exe is running as Administrator)
- Navigate to the 'Omaha' directory, or whatever you called it.
- From the above directory, just type hammer to build Omaha! (Note: More advanced build options can be found in HammerOptions.)
Running Unit TestsIn 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.
|
saya mau mendapatkan restribusi penuh dari google tapi saya orang bodo yg ingin maju,sukses
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!
Agree with dawita :D
This is cool, thanks.
Thanks for opening up the source!
Any chance this will ever be cross platform?
Running Omaha Unit Tests by manually setting Registry Key:
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..
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!
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.
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.
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
mi.res : fatal error LNK1103: debugging information corrupt; recompile module scons: building terminated because of errors.
;-(
VISTA + VS2005 + WINSDKV6.1
Would it help deleting the whole scons-out and starting over?
I have a question Omaha use WIX for create installers, I can use any? for example Inno Setup?
Thanks for the answer :)
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.
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_envEnvt:
Vista 64, Win SDK 6.0A, Visual Studio 2008
:( thoughts?
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.
where is the server source code?
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.