Customizing the Firefox Installer on Windows (2012)

This is an update of a previous post. It has some new questions answered as well.

One of the questions I get asked a lot is how to customize the Firefox installer on Windows and how to bundle add-ons with it. This Q&A should give folks answers to the common questions they have. If you have more questions, please post in the comments.

Standard disclaimer: Under no circumstances should you use this information to create a custom Firefox install and redistribute it to anyone outside your organization without contacting Mozilla. If you want more information, you can consult the Mozilla Foundation Trademark Policy.

What tools do I need to work with the Firefox installer?

The primary tool you need is 7-Zip. I install the MozillaBuild package which gives me all the tools I need. Even though the Firefox Installer is NSIS based, we will not need to use NSIS for most customizations. I'll talk a little bit about the end about what kinds of things you would need NSIS to do.

How do I unpack the Firefox installer?

The Firefox installer is created using 7-Zip. So you can grab any of the Windows installers that end in EXE and unpack them. Any of the Windows installers on the Firefox ESR download page will work. Once you've downloaded the EXE, create a temporary directory and type:

7z x "Firefox Setup 10.0.1 esr.exe"


This will unpack the contents of the installer so we can modify it.

How do I bundle my add-on with the Firefox installer?

Bundling your add-on with the Firefox installer is just a matter of putting it in the right place. Then when we package up the installer at the end, it will get installed along with Firefox. There are different locations to place your add-on depending on how you want it installed. You can get more details by reading this blog post. All of the directories referenced in that post will be created under the core directory where you unzipped Firefox. You can add as many extensions as you want into the installer.

What are some useful add-ons I can bundle with Firefox

I've created three add-ons that create interesting things to bundle with Firefox. The first is the CCK Wizard. The CCK Wizard can be used to change various defaults in Firefox so that you can customize it for deployment in your organization. The second is Rebrand. Rebrand allows you to change the internal branding used in Firefox. The third is the Firefox 3.6 Behaviors add-on. It can change some of the behaviors of Firefox to be more like Firefox 3.6. Some other useful add-ons are RSS Icon in Awesombar to bring back the RSS icon that was in Firefox 3.6. Another good one is Status-4-Evar which brings back some of the Firefox 3.6 status bar behavior.

Can I change the names used in the installer?

Yes, you can change the names used in the installer. To do this, you need to create a directory called distribution inside the core directory that was created when you unpacked the installer. Create a file called setup.ini in this directory. Here's what it looks like:

[Branding]
BrandFullName=Mike's Browser
BrandShortName=Browser


BrandFullName will be used to replace "Mozilla Firefox" and BrandShortName will be used to replace "Firefox".

Can I change the images used in the installer?

Yes, you can change the images used in the installer. In that same directory where you put the setup.ini, you can put two files, modern-wizard.bmp and modern-header.bmp. The first image corresponds to the large image on the first page of the installer. The second image corresponds to the small image that is used on later pages of the installer. You can use the linked images as a reference to know what size to make these images.

(NEW) Can I stop Firefox from attempting to migrate settings from other browsers?

Yes. In the file application.ini in the core directory, you can change the line EnableProfileMigrator=1 to EnableProfileMigrator=0
UPDATE: A better way to do this (that will work in future versions of Firefox) is to create a new file called override.ini that looks like this:

[XRE]
EnableProfileMigrator=0

(NEW) Can I stop Firefox from reporting crashes?

Yes, but please don't do this unless you have some strict requirement to do so. In the file application.ini in the core directory, in the [Crash Reporter] section, you can change the line Enabled=1 to Enabled=0

How do I repackage the installer?

To repackage the installer, first you need to zip up the changes that you made. At the top level directory (above core), type:

7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3


This will create a file called app.7z that has all the changes we made. Now we need to package that file with some other files to create the final EXE. We'll need the file 7zSD.sfx which you can download from Mozilla. And we'll need a file called app.tag which you can create. It looks like this:

;!@Install@!UTF-8!
Title="Mozilla Firefox"
RunProgram="setup.exe"
;!@InstallEnd@!


Once we have these files, we can run the command:

copy /B 7zSD.sfx+app.tag+app.7z our_new_installer.exe


to package them all as an EXE. Don't forget the /B. It indicates that the files are binary so Windows won't put an EOF marker on them.

Can I change the defaults that are set in the installer like the install directory or the checkboxes?

At this time, there is no way to change the defaults in the installer without rebuilding the installer. There's a bug open on this with a patch, but it hasn't moved in a while.

Can I make my totally rebranded Firefox coexist nicely with an existing Firefox?

There are a couple ways to do this. The easiest way is to use the -no-remote parameter when you start Firefox. This causes the Firefox you are starting to not connect to the Firefox that is currently running. When you do this, you have to specify a different profile using the -P {profilename} parameter or the -profile parameter. Alternatively, you can change the internal identifiers that Firefox uses. Then it will be considered to be a completely different browser. If you choose to do this, you should be aware that you will not receive updates and there will be other side effects. This is not a decision that should be taken lightly. Also, your profiles will be stored in different locations as well. It will even change your user agent. If you want to do this, check out the file application.ini in the core directory. The variables you want to change are Vendor and Name. Again, you do this at your own risk.

What can I do if I'm willing to rebuild the installer with NSIS?

If you are willing to rebuild the installer, you can change things like the name of the entry in the Add/Remove programs list, as well as the install directory and other defaults. This is a nontrivial exercise because some of the required files are built as part of the Mozilla build proces and are not available in the build tree. If you're really interested in doing this, you can contact Kaply Consulting and we can talk about it.

I hope this answered some questions folks have. If anyone has any more questions, please don't hesistate to ask.

Please note: I reserve the right to delete comments that are offensive or off-topic.

Leave a Reply

Your email address will not be published. Required fields are marked *

43 thoughts on “Customizing the Firefox Installer on Windows (2012)

  1. Mike, just a warning.

    As of Firefox 11, any edits to |application.ini| are not automatically reflected in the app itself. (That file is statically imported directly into the Cpp launcher, changes there need you to pass |-app | now.

  2. > The easiest way is to use the -no-remote parameter when you start Firefox.
    > This causes the Firefox you are starting to not connect to the Firefox
    > that is currently running. When you do this, you have to specify a
    > different profile using the -P parameter or the -profile parameter.

    This is, of course, completely unusable, as when you try to start your customized Firefox when it is already running, you get the "Firefox is already running but is not responding" error.

    • @nickers:

      That's incorrect.

      As long as you start Firefox with -no-remote, it will start a separate Firefox. That's the whole point of that parameter. I just did it.

      If you have multiple profiles and have the profile manager set to come up at startup, -no-remote will show the profile manager and you can select a different profile and run two different Firefox versions side by side.

      • Perhaps I am being misunderstood - 'firefox -no-remote -P ' will refuse to start if another instance of Firefox using _the same profile_ is already running. With standard Firefox, I can ask it to open an URL and it will always do so. I am unable to do the same with a custom profile.

        • No, it was I that was being unclear.

          I should have said -p {profilename}

          You have to specify a profile name with the -p to specify which profile you want to start the new instance with.

          I'll update the post.

          • Yes indeed.
            Firefox (or Thunderbird, or SeaMonkey) won't let you run two different instances of the program on the same profile. This is what happen when you invoke the program a second time:
            * Without -no-remote you always get a new window run by the existing instance on the existing profile. -P {profilename} or -ProfileManager are disregarded.
            * With -no-remote and -P {profilename} (specifying a profile not yet in use) you get a new instance on a different profile
            * With -no-remote -ProfileManager you get a new instance and you can create or select a profile other than the one already in use. There are rumors that this particular option is going to be removed from Firefox, which IMHO would be a bad idea but you never know to which depths of ill-advisedness the Firefox team will stoop; last time I tried, it still worked. I hope SeaMonkey will keep it but I'm not sure it will be possible (maybe it is in shared code).

  3. Hi. I am trying to add language packs to a Firefox 10 ESR install. I have added the extracted language pack to core\distribution\extensions\langpack-fr@firefox.mozilla.org where langpack-fr@firefox.mozilla.org is the id within the install.rdf
    The folders and files are present when Firefox is installed, but the language pack is not present for any users and is not visible in the Add-ons manager. Is this correct and am I missing a step?
    I have updated about:config to use French, but no change.
    Help would be appreciated.

    • Here's what I did and it worked for me (I realize this might be exactly what you did. I just want to confirm).
      My first step is always to test with Firefox directly before I package it.
      I downloaded the Firefox 10.0.3 ESR and unzipped it. Then I created a directory called distribution\extensions.
      In that directory, I placed the German langpack as an XPI (you don't need to unzip it). The file was - langpack-de@firefox.mozilla.org.xpi
      Then I started Firefox with a new profile. In my add-ons manager, I had a new icon on the left (a globe) and when I clicked on it, the german lang pack was available.
      I then went to about:config and changed general.useragent.locale to de-DE and restarted the browser and it was in German.

      If you do not create a new profile, the new language won't be installed. To install a language for an existing profile, you would have to put it in the bundles directory. It would be hidden to the user, but still work.

  4. Can I remove the default bookmarks? in 3.x and prior I just replaced the places.sqlite file in the default profile.

  5. Thanks Mike for your great post ...

    ... but how to enable custom extensions by default?
    I put extensions under core\extensions folder and deployed firefox. Extensions are installed - but disabled!
    Is there a way to enable the extension automatically?

  6. Is there a way to save a custom toolbar(Ive added buttons and moved buttons around) . So that all installs will have it.

  7. I am very new to this. I need to have 12 computers auto open to FF to a certain website (which they currently do) and not allow users to move to a different site. We use these for check in only. Is there a simple way to do this? (I know simple is a relative term.)

  8. Hello Mike Kaply,

    I want to add an extension to the Firefox installer.

    I had unzip the installer, and i had a setup file and a core folder. Also, I had added an unzip extension in the folder core\extensions\{7E7165E2-0767-448c-852F-5FA8714F2C37}. I don't know if it is correct, and know, i want to repackage the installer to try. But i don't understand your command line : " 7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 ". In the CMD window, where i must lunch this command ?

    Best Regards,

      • Thanks for your answer.
        I had made this command :

        C:\Program Files\7-Zip> 7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3

        But it just give me a file "t7z.7z" in the folder "C:\Program Files\7-Zip". I didn't found the file app.7z.

        I have another question: I do not understand in the command line, where is specified the path of the folder core ?

        Please Help.

  9. Good evening Mike,

    Just playing around with Firefox 21 beta - the override.ini does not seem to be acknowledged anymore.

    I've removed my profile, and when starting the browser, it wants to migrate my profile. Even though when it shouldn't.

    Work son Firefox 17ESR. But not on 21 beta.
    Would you perhaps have any info on that?
    Or is it wiser to wait untill the final version comes out and create a bug then?

    Thanks, Patrick

  10. Hello Mike,

    great work documenting all that stuff and gifting us the CCK Wizard.

    However, I'm currently trying to customize Firefox 21.0 for our corporate environment - but I don't get the override.ini with

    [XRE]
    EnableProfileMigrator=0

    to work. The file rests in the folder where firefox.exe is. I even tried manipulating the application.ini directly without success.

    Any ideas? A bug maybe?

    Thanks

  11. hi Mike,

    How do I bundle my firefox profile with the Firefox installer, after unzip firefox exe with 7zip?

    • What part of your profile do you need to bundle? You don't want to bundle your profile with Firefox, you want certain settings from the profile...

      • i want to bundle userChrome.css, at directory C:\Users\'username'\AppData\Roaming\Mozilla\Firefox\Profiles\'profile.default'\chrome

        • If you put a userChrome.css in FIREFOXEXE\browser\defaults\profile, it should get copied when a new profile is created.

  12. A lot of what is described in this blog doesn't work anymore with the latest firefox version. There seems to be no way to brand this to use a separate profile that doesn't conflict with Mozilla. Application.ini or -app command line settings no longer work It has completely broken for our customized corporate webapp and they have no plans to fix it. Very frustrating
    see
    https://bugzilla.mozilla.org/show_bug.cgi?id=723493