Preparing Windows

Building on windows is significantly more complex than building on macos or linux. This guide will walk you through preparing your Windows machine for building a Firefox fork. Before building, you should be aware that only Windows 10 or 11 are officially supported, but you might be able to get other versions to work.

Installing Dependencies

The first thing you will need to do is install Microsoft's c++ build tools. You will need to download Build Tools for Visual Studio 2022. The following will need to be installed:

  • In the Workloads tab

    • Desktop development with C++

  • In the Individual components tab

    • MSVC v143 - VS 2022 C++ x64/x86 build tools.

    • Windows 11 SDK (at least 10.0.22000.0) or Windows 10 SDK (at least 10.0.19041.0).

    • C++ ATL for v143 build tools (x86 and x64).

    • Python 3.10 (or later) for v143 build tools (Microsoft Store version recommended)

Note: If this guide ever gets out of date, you can get the latest build requirements from Mozilla's docs

You will need to install MozillaBuild. Next, install Git. You will need to set the following specific options on install to ensure high performance:

  • Configuring the line ending conversions must be: Checkout as-is, commit as-is

  • Enable experimental built-in file system monitor

Install NodeJS on your system. This should also install chocolatey. If it does not, install it manually. To install the final two dependencies, run:

npm install --global yarn
choco install make

You should be good to return back to the main Getting Started docs

Additional packages required for releasing

If you are creating binaries to target windows, you will need nsis (which mach calls makensisu for some reason, even though the binary is makensis):

choco install nsis

Note that you will also have to provide a path to nsis on your system. For mine it is:

export MAKENSISU="C:\\Program Files (x86)\\NSIS\\Bin\\makensis.exe"

Troubleshooting Common Issues on Windows 11

Checking for the existence of the mach command

If you encounter a FileNotFoundError related to the mach command while running samurai bootstrap, follow these steps:

  1. Ensure that the mach command is correctly installed.

  2. Verify that the mach command exists in the expected location: <project_root>/.engine/mach.

  3. If the mach command is not found, reinstall the necessary dependencies and try again.

Ensuring samurai.json is correctly configured

If you encounter issues related to brandConfig being undefined while running samurai set brand stable or samurai build, follow these steps:

  1. Open your samurai.json configuration file.

  2. Ensure that the brands key is correctly defined and includes the necessary properties for your brand.

  3. Verify that the release key within the brands configuration includes the displayVersion property.

  4. If the brandConfig is still undefined, provide a default value or a clear error message in your configuration.

By following these troubleshooting steps, you should be able to resolve common issues encountered while using Samurai on Windows 11.

Last updated