Sunday, December 24, 2006

Firefox Enterprise Deployment Guide (Windows)

A deployable build may be made in 3 steps: -

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

Before starting you should be comfortable compiling Firefox on your own (or see http://developer.mozilla.org/en/docs/Build_Documentation)

There are sub-stages of these and we will be going through them one at a time.

What you want to 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 (eg. a custom search-plugin for a Knowledgebase in your Org.)
  • Deploy bookmarks
  • Deploy user-interface customisations. (like toolbar settings)
  • A custom namespace icon (Windows only)
  • Customise the help page(s).
  • Name of your Org in the title bar.
  • Others
  1. Let's begin with customising 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.
    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 extensions to C:\Program Files\Mozilla Firefox\extensions.
    11. Copy the chrome folder from the new profile to the default profile

l. Move the contents of folder “searchplugins” from the new profile to “C:\Program Files\Mozilla Firefox\searchplugins”.

m. To lock uninstallatin of extensions from the global extensions dir, you’ll have to edit the install.rdf of the extension and insert true

n. To disable update and compatibility check you’ll have to edit the install.rdf and insert true

o. 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

    1. Half the battle is won. Get ready to compile Firefox.
  1. Build Firefox: - Go through my batch file and know which lines in teh particular files have been modified to suit ur organisation. This file does the following: -
    1. Creates a temp dir for our exclusive use (we’ll use this to copy our customised 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 customised 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.
  1. 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

    1. 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
  1. You may want to do a little research on MOZ_NO_REMOTE on google.

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

8 comments:

ciscoblog said...
This post has been removed by a blog administrator.
Shivanand Sharma said...

this is a test

Jobeesh said...

I love the guide, I've been trying to put together a custom firefox install for my university for a few days now and this is the first promising thing I've found. I've hit a snag though, I've gone through the majority of your guide and when I went to download your batch file I got a 404 error. Is there some other way I can get this file? My email is Jonbeesh@gmail.com if you want to e-mail it to me.

Shivanand Sharma said...

sure. they've been taken off the site, but i'll email you the one that i'm still using in a day (i'm away on vacation). i know it's time that i updated the blog but i guess i have some homework to do before that. thanks for writing. please do remind if you don't receive it by tuesday.

regards

Coyo7e said...

Wow, you're really a lifesaver, I've been trying to figure out how to get firefox with adblockplus onto a couple hundred workstations, to cut down on clickthrough infections and reduce bandwidth, and you are a life saver!

Coyo7e said...

BTW, could you possibly email that bath file to me as well? perhaps you could throw a zipped copy up on your blog so people don't have to directly bug ya for it..
chueske (at) gmail.dot

Jessica said...

Hi,

I just stumbled across this post of yours, and was wondering if I could also get a copy of the scripts you used?

Thanks!

Shivanand Sharma said...

Jessica: Thanks for writing. The page that you visited is one of the older ones. You can visit the new one at http://www.binaryturf.com/enterprise-build-of-firefox-for-deployment/ which has the scripts and other revised instructions. Feel free to let me know in case you have any queries.

About Me

My Photo
Shivanand Sharma
My creative side finds solace in all things as I stay a man of interests.
View my complete profile