Compiling and Installing Nightly Builds of Firefox on Windows 7

14Nov

Compiling and Installing Nightly Builds of Firefox on Windows 7

by Craig Mayhew on Sat 14th Nov 2009 under Guides/Fixes
This article details how to download and compile the latest bleeding edge build of Firefox on Microsoft Windows 7. The firefox build will be full of bugs because it is bleeding edge, so don't use this for anything important :) On the upside you will get to play with new features long before anyone that waits for "stable" versions to be released. Here we go:

Install MozillaBuild, a package of additional build tools. Make sure you install this with a directory path that does not contain any spaces (e.g. c:\mozilla-build\). If you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. After that all should be well.

If you don't already have Visual C++ 2008 then download and install the express edition from http://www.microsoft.com/Express/vc/

Download the windows SDK if you don't already have it installed (If unsure install it anyway) from here: http://www.microsoft.com/downloads/thankyou.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&displayLang=en

We need to make sure that windows is using the SDK that we have just installed. Find "Windows SDK Configuration Tool" on your start menu, run it. Select "v7.0" (or higher) in the drop down box and click "make current".

Now we need to create your mozconfig file. This will contain various compile options for your custom build of firefox. Substituting {username} for your real username, you should find your mozconfig file here: C:\Users\{username}\mozilla-central\mozconfig

I recommend that unless you know what your doing or run into compile issues that are specific to your system then edit your mozconfig file to look like this:

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release
mk_add_options MOZ_MAKE_FLAGS="-j4"

#adding this to prevent it erroring about not being able to build for version 601000
mk_add_options MOZ_WINSDK_TARGETVER=600

#stop the atl errors
ac_add_options --disable-xpconnect-idispatch
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --disable-accessibility


Hurrah, that's all of the setup out of the way. Now we can try and compile firefox! Open a shell window by running: c:\mozilla-build\start-msvc9.bat. Even if you're on 64-bit Windows, do not use the files ending in -x64.bat.

In the newly opened shell window type the following:
To get the latest source:

hg clone http://hg.mozilla.org/mozilla-central/

To navigate to the mozilla-central directory:

cd mozilla-central

To start the build process:

make -f client.mk


Once compiled (It may take hours depending on your system) the firefox executable can be found in C:\Users\{username}\mozilla-central\objdir-ff-release\dist\bin

I recommend you create a shortcut to the executable and don't open it directly. This way you can have it run from a different firefox profile and have it running at the same time as your standard firefox build while keeping the two completely seperate. This will prevent the addons etc from erroring about the unsupported firefox version. The short cut should be formatted as such: "Firefox.exe" -p "{PROFILE}" -no-remote (note: substitute the name of your profile for {PROFILE} or omit to launch the profile manger instead). I've set mine to "Firefox.exe" -p "nightly" -no-remote

If your still unable to compile firefox then please leave a comment, then try other resources such as https://developer.mozilla.org/En/Simple_Firefox_build.

Firefox   Windows 7   Compile   MozillaBuild   mozconfig  




© 2005-2021 Craig Mayhew