Build Pale Moon on Windows

Prerequisites

Prerequisite caveats

  • Launch VS2012 after installation to initialize the environment, start the IDE and get the latest updates. Launch after updating to finish up the update, after which you can close the IDE. For x64 builds, make sure you install the x64 build tools.
    (Note: You will be asked to register with Microsoft when launching it the first time. If you want to continue using VS2012 Express after 30 days, I strongly recommend you do so immediately and get it out of the way. Skipping this step will give you a 30-day evaluation period after which VS2012 Express will cease to work.)
  • DirectX SDK: Note that other versions of the DirectX SDK on Microsoft's Developer Center that claim to have been released after June 2010 are actually older versions that are misdated, some of which will result in an error if you try and download them due to the installer files themselves having been removed from the MS servers. There will not be any further standalone DirectX SDKs released by MS, since DirectX has been transitioned from an independent distribution model to an integrated (into Windows and Visual Studio) model, and the DirectX SDK is now integrated into the Windows 8 SDK (which is bundled with Visual Studio as of VS2012). The reason that we require the June SDK even on newer Win7+VS2012 systems is because ANGLE depends on D3DX9, but MS considers D3DX to have been obsoleted by newer technologies and therefore VS2012 doesn't include the d3dx9.h and d3dx9tex.h headers that are required to compile ANGLE.
  • DirectX SDK: If installation fails with an "S1023" error, execute the following commands to remove the VC++ 2010 redistributable libraries from your computer:

    MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
    MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
    Then install the DirectX SDK again. After installation has completed, you can re-install the VC++ redistributable libraries from http://www.microsoft.com/download/en/details.aspx?id=26999

Getting the Source

Download the source from here or clone with git
If you are using the 7zip packed source code then unpack the source code (using 7-zip) to a path that does not contain spaces, e.g. c:\palemoon-source

If you cloned the git repo be sure to switch to the desired relbranch.

This source tree will contain everything needed for both x86 and x64 builds of Pale Moon (they share the same release source code).

Build Instructions

Configure

Create a file called .mozconfig in the source folder you unpacked the source in.
(Yes, that is {dot}mozconfig -- don't omit the . at the start. Also make sure it's not .mozconfig.txt or something crooked like that. If you are hiding extensions of known file types, fix that first in folder options because it's a PITA when trying to do this kind of thing)

Make sure it contains at least the following for a close-to-official build:

For x86 (32-bit):

mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser
ac_add_options --enable-optimize="-O2"
ac_add_options --enable-jemalloc
 
WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x86/Microsoft.VC110.CRT

For x64 (64-bit):

ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser
ac_add_options --enable-optimize="-O2"
ac_add_options --enable-jemalloc
ac_add_options --enable-shared-js
 
WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x64/Microsoft.VC110.CRT

Build

  • Go to C:\mozilla-build (or wherever you extracted to mozilla build tools) and run start-shell-msvc2012.bat
This will open a UNIX-like shell with the compile environment set up for Visual Studio 2012. Please do not use the -x64 batch file even if you are on a 64-bit operating system when building x86.
The -x64 batch file is for launching a 64-bit build environment and building a 64-bit browser using a 64-bit compiler. So for creating an x64 build of Pale Moon, run start-shell-msvc2012-x64.bat
  • In the shell, cd to your pale moon source directory, e.g.
cd /c/palemoon-source
if you installed the source in C:\palemoon-source
  • Start the build:
./mach build
  • Be patient. Building will take a long time. Your PC will be fully occupied compiling and linking the browser (you can expect 100% CPU usage throughout and lots of memory use - provide ample cooling) and you should not be using it for anything else that is intensive at this time. Especially memory-intensive applications should be avoided because it can cause issues with the linker (memory fragmentation) resulting in a very unstable browser.

Important note: before you start building, make sure to exclude the source and target folders from antivirus software or it will severely slow down the build process or may even break it entirely (due to file locks). Either completely disable real-time/on-access scanning before building, or make specific exclusions for your working folders.

Strip/Package

After building is completed, you can take the resulting binaries for a test run in the object directory directly (see the on-screen instructions at the end of the build process) but it will not be complete yet. You need to strip and package the browser to integrate additional code and have a ready-to-use browser. You do this by running

./mach package

This will create a properly packaged .zip file in your object folder under the Pale Moon source folder. e.g.:
C:\palemoon-source\obj-i686-pc-mingw32\dist\palemoon-{version}.en-US.win32.zip (for x86)

Generating the installer

If you want to build a self-extracting installer, similar to the off-line installers offered in official builds, you will have to do give the following command:

./mach installer

This will create a self-extracting installer in your object folder under the Pale Moon source folder. e.g.:
C:\palemoon-source\obj-i686-pc-mingw32\dist\install\sea\palemoon-{version}.en-US.win32.installer.exe (for x86)

Firefox, Mozilla Firefox and Mozilla are registered trademarks of the Mozilla Corporation.
Site design and Branding © 2016 Moonchild Productions - All rights reserved
Any other content is copyright or trademark to their respective owners.
This site uses Cookies - Your usage indicates your consent to their use.

The Pale Moon Developer Wiki is powered by Enano