Organizations 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: -
- Customizing default settings and preferences and saving them (for use in the final build).
- (Optionally) Compiling the source into a build.
- Creating a custom installer.
Before starting you may want to do the following
- Download my scripts and customized source files. This will give you more insight about how things get going. (a build log is included as well)
- You should be comfortable compiling Firefox on your own (or see http://developer.mozilla.org/en/docs/Build_Documentation).
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
- Let’s begin with customizing the default preferences.
- 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>
- Back up the directory where Firefox is installed.
- 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.
- Create a special profile at: “C:\Program Files\Mozilla Firefox\defaults\profile”. This will enable us to configure the default profile.
- 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).
- Close Firefox and create a backup of the profile directory.
- Back at the command prompt, create a new Firefox profile at the default location (“%APPDATA%”)
- Configure preferences for extensions, the theme in use, toolbar settings, install other search plugins, configure bookmarks, userchrome.css, usercontent.css.
- Copy lockstore.rdf and bookmarks file from this new profile to the default profile (C:\Program Files\Mozilla Firefox\defaults\profile).
- Copy the global extensions to C:\Program Files\Mozilla Firefox\extensions.
- Copy the profile specific extensions to C:\Program Files\Mozilla Firefox\defaults\profile\extensions.
- Copy the chrome folder from the new profile to the default profile.
- Move the contents of folder “searchplugins” from the new profile to “C:\Program Files\Mozilla Firefox\searchplugins”.
- To lock uninstallation of extensions from the global extensions dir, you’ll have to edit the install.rdf of the extension and insert true
- To disable update and compatibility check you’ll have to edit the install.rdf and insert true
- 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 - Here’s a small list of other files I’ve customized.
- mozilla\browser\locales\en-US\chrome\help\firefox_welcome.xhtml (custom firstrun file)
- mozilla\browser\locales\en-US\chrome\browser-region\region.properties
- mozilla\browser\locales\jar.mn (for including a custom firstrun file)
- mozilla\browser\locales\en-US\chrome\help\firstrun.xhtml
- mozilla\browser\locales\en-US\chrome\browser\browser.dtd (to add the name of my organisation to the title bar).
- mozilla\browser\installer\windows\packages-static
- installsub.pl (to add msvcrt to the installer).
- mozilla\extensions\inspector\install.rdf (lock the uninstall of DOM Inspector)
- mozilla\browser\installer\windows\uninstall.it
- mozilla\FFBIN\dist\bin\override.ini
Half the battle is won. Get ready to compile Firefox.
- 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: -
- Creates a temp dir for our exclusive use (we’ll use this to copy our customized extensions searchplugins etc)
- Sets environment variables.
- Extracts source
- Creates .mozconfig
- 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).
- Modify source files (if you are comfortable).
- Build
- Backup
- Copy plugins as required
- Copy customized profile.
- Copy extensions
- Copy activex files
- Copy msvcrts (I’ve modified a source file to package msvcrts and they are required to package the installer).
- Convert unix files to DOS format.
- Make installer.
- Make package.
- Edit config.ini (in <objdir>\dist\install) in easy steps: checkout my config.ini
- Setup type auto, normal, silent.
- Required components (I want to disable QFA and install ADT).
- 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 - 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
{ 3 comments… read them below or add one }
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
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.
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.
{ 1 trackback }