Loading

Enterprise Build of Firefox for Deployment

foxbuild Enterprise Build of Firefox for DeploymentOrganizations have business requirements that warrant a certain extent of customization of vendor provided applications. The story is the same when it comes to the browser. For IE Microsoft has a IE customisation kit while Mozilla has one too. However the extension of customization and the flexibility is quite restrictive and limited. Hence I chose to build my own deployable build of Firefox. The instructions here have worked for the Firefox 1.5 series and are here to provide an inside on how it works for me. This is an update from my old post about Firefox Enterprise Deployment Guide (Windows). I shall be posting a Linux version of the instructions soon.

A deployable build may be made in 3 steps: -

  1. Customizing default settings and preferences and saving them (for use in the final build).
  2. (Optionally) Compiling the source into a build.
  3. Creating a custom installer.

Before starting you may want to do the following

There are sub-stages of this and we will be going through them one at a time. Here are a few things this will let you achieve: -

  • Deploy options for Firefox (prefs.js, userchrome.css, usercontent.css)
  • Deploy extensions/themes
  • Deploy settings for extensions (prefs.js)
  • Lock down all/some of the settings (updates to extensions/ app, uninstallation of extensions)
  • Deploy search-plugins (e.g.. a custom search-plugin for a Knowledgebase in your Org.)
  • Deploy bookmarks
  • Deploy user-interface customizations. (like toolbar settings)
  • A custom namespace icon (Windows only)
  • Customize the help page(s).
  • Name of your organization in the title bar.
  • Others
  1. Let’s begin with customizing the default preferences.
    1. Download the official Firefox installer and install it into the default location (“%PROGRAMFILES%\Mozilla Firefox”) (make sure you chose to un/install the DOM Inspector /QFA as required). Don’t run Firefox yet./li>
    2. Back up the directory where Firefox is installed.
    3. Use a command prompt and change into directory where firefox.exe resides and run “firefox -p” (without quotes). The command prompt will let us use these options for creating and using different profiles while we configure the settings.
    4. Create a special profile at: “C:\Program Files\Mozilla Firefox\defaults\profile”. This will enable us to configure the default profile.
    5. Start Firefox with this profile using “firefox -p” (without quotes). Configure as many preferences and settings you can. Use about:config to tweak advanced prefs and use the options dialog to set general settings. Install extensions and themes of your choice (don’t restart firefox yet).
    6. Close Firefox and create a backup of the profile directory.
    7. Back at the command prompt, create a new Firefox profile at the default location (“%APPDATA%”)
    8. Configure preferences for extensions, the theme in use, toolbar settings, install other search plugins, configure bookmarks, userchrome.css, usercontent.css.
    9. Copy lockstore.rdf and bookmarks file from this new profile to the default profile (C:\Program Files\Mozilla Firefox\defaults\profile).
    10. Copy the global extensions to C:\Program Files\Mozilla Firefox\extensions.
    11. Copy the profile specific extensions to C:\Program Files\Mozilla Firefox\defaults\profile\extensions.
    12. Copy the chrome folder from the new profile to the default profile.
    13. Move the contents of folder “searchplugins” from the new profile to “C:\Program Files\Mozilla Firefox\searchplugins”.
    14. To lock uninstallation of extensions from the global extensions dir, you’ll have to edit the install.rdf of the extension and insert true
    15. To disable update and compatibility check you’ll have to edit the install.rdf and insert true
    16. Remove obsolete files from the default profile. You should finally have the following files in your default profile.
      C:\Program Files\Mozilla Firefox\defaults\profile>dir /s
      Volume in drive C has no label.
      Volume Serial Number is E4B4-8771
      Directory of C:\Program Files\Mozilla Firefox\defaults\profile
      04/12/2006 02:12 AM .
      04/12/2006 02:12 AM ..
      04/12/2006 02:12 AM 20,776 bookmarks.html
      04/12/2006 02:12 AM chrome
      04/12/2006 02:12 AM 5,092 localstore.rdf
      04/12/2006 02:12 AM 618 mimeTypes.rdf
      04/12/2006 02:12 AM 6,411 prefs.js
      04/12/2006 02:12 AM 3,287 search.rdf
      6 File(s) 36,302 bytes
      Directory of C:\Program Files\Mozilla Firefox\defaults\profile\chrome
      04/12/2006 02:12 AM .
      04/12/2006 02:12 AM ..
      04/12/2006 02:12 AM 1,078 userChrome-example.css
      04/12/2006 02:12 AM 2,909 userchrome.css
      04/12/2006 02:12 AM 663 userContent-example.css
      04/12/2006 02:12 AM 978 userContent.css
      4 File(s) 5,628 bytes
      Total Files Listed:
      10 File(s) 41,930 bytes
      5 Dir(s) 268,378,112 bytes free
    17. Here’s a small list of other files I’ve customized.
      1. mozilla\browser\locales\en-US\chrome\help\firefox_welcome.xhtml (custom firstrun file)
      2. mozilla\browser\locales\en-US\chrome\browser-region\region.properties
      3. mozilla\browser\locales\jar.mn (for including a custom firstrun file)
      4. mozilla\browser\locales\en-US\chrome\help\firstrun.xhtml
      5. mozilla\browser\locales\en-US\chrome\browser\browser.dtd (to add the name of my organisation to the title bar).
      6. mozilla\browser\installer\windows\packages-static
      7. installsub.pl (to add msvcrt to the installer).
      8. mozilla\extensions\inspector\install.rdf (lock the uninstall of DOM Inspector)
      9. mozilla\browser\installer\windows\uninstall.it
      10. mozilla\FFBIN\dist\bin\override.ini

      Half the battle is won. Get ready to compile Firefox.

  2. Build Firefox: – Go through my batch files (two of them, one triggers the other) and know which lines in the particular files have been modified to suit your organization. This file does the following: -
    1. Creates a temp dir for our exclusive use (we’ll use this to copy our customized extensions searchplugins etc)
    2. Sets environment variables.
    3. Extracts source
    4. Creates .mozconfig
    5. Copy and merge default & your custom plugins into a temp dir and creates a list.txt file for them (list.txt is required for the source to build).
    6. Modify source files (if you are comfortable).
    7. Build
    8. Backup
    9. Copy plugins as required
    10. Copy customized profile.
    11. Copy extensions
    12. Copy activex files
    13. Copy msvcrts (I’ve modified a source file to package msvcrts and they are required to package the installer).
    14. Convert unix files to DOS format.
    15. Make installer.
    16. Make package.
  3. Edit config.ini (in <objdir>\dist\install) in easy steps: checkout my config.ini
    1. Setup type auto, normal, silent.
    2. Required components (I want to disable QFA and install ADT).
    3. Make a custom installer with the following files
      adt.xpi
      browser.xpi
      config.ini
      en-US.xpi
      icon.exe
      install.ini
      install.vbs
      license.txt
      mozicon
      msvcirt.dll
      msvcp71.dll
      msvcr71.dll
      msvcrt.dll
      setup.exe
      setuprsc.dll
      talkback.xpi
      UninstallFirefox.zip
      xpcom.xpi
    4. I’m using install.vbs to trigger the install and then icon.exe to build a namespace icon and copying mozicon as Mozilla Firefox.lnk to create similar shortcut in the quick launch bar and Start Menu. Also take a look at my Firefox namespace icon installer.

Additionally you may want to do a little research on MOZ_NO_REMOTE on Google. This environment variable if set to ‘1′ allows you to run multiple instances of Firefox simultaneously using different profiles.

This guide is not complete and will need a lot of feedback to improve. Please checkout if this works for you.
Image Courtsey:What What

Bookmark & Share —

Search for More

Loading...

{ 3 comments… read them below or add one }

1 Anon October 13, 2008 at 1:54 pm

Thank you for writing such a helpful artcile but there is a local link in your article:
Build Firefox: – Go through >>>my batch files<<< (two of them, ….

Where my batch files refers to http://192.168.1./main.hml
is there any chance to fix this link

Reply

2 Shivanand Sharma October 13, 2008 at 2:40 pm

the correct link is http://binaryturf.com/files/others/scripts.zip the same as the scripts files mentioned earlier. Run.bat triggers personal.bat.

Thanks for pointing it out.

Reply

3 Steve March 5, 2009 at 6:36 am

Was going through your scripts and to be honest I’m not very adept at scripting, still learning. Is there any way you can annotate them more so we know exactly what each section is doing? I understand if you don’t want to give all your secrets away, but reading through some of it, I have no clue what’s doing what, or how to customize it to use for my organization.

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: