Monday, January 23, 2012

Packaging Mozilla Firefox

Most people dread while packaging Mozilla Firefox application and mostly try to make a silent installation of it. I was recently given task to package the latest Mozilla Firefox application version 9.0.1
The same procedure can be used for 10.0.1 as well as I have tried and it works fine.
I would like to share here how I could easily package it. Also by this method you will be able to do Proxy server settings.
First step is to do a Setup capture of the source exe which can be downloaded from Mozilla’s website. Take care that you do not have to launch the application after the installation is completed.
Second Step is to copy 3 files as stated below. You can add these files in your .wsi directly after the setup capture. These 3 files will solve all your issues.

1. Mozilla.cfg: This file needs to be added to "%programfiles%\Mozilla Firefox\" folder and should have this content:

//Firefox Default Settings
// set Firefox Default homepage
pref("browser.startup.homepage","http://your.intranet.com");
// disable default browser check
pref("browser.shell.checkDefaultBrowser", false);
// disable application updates
pref("app.update.enabled", false)
// disables the 'know your rights' button from displaying on first run
pref("browser.rights.3.shown", true);
// disables the request to send performance data from displaying
pref("toolkit.telemetry.prompted", 2);
pref("toolkit.telemetry.rejected", true);
//Firefox Default Settings
//set proxy server settings, choose whatever is required by your organization
pref("network.proxy.ftp", "your.proxy.server");
pref("network.proxy.ftp_port", 8080);
pref("network.proxy.gopher", " your.proxy.server ");
pref("network.proxy.gopher_port", 8080);
pref("network.proxy.http", " your.proxy.server ");
pref("network.proxy.http_port", 8080);
pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, *.server.local");
pref("network.proxy.type", 1);
pref("network.proxy.share_proxy_settings", true); // use the same proxy settings for all protocols


2. local-settings.js: This file needs to be added to "%programfiles%\Mozilla Firefox\defaults\pref" folder and should have this content:

pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");

3. override.ini : This file needs to be added to “%programfiles%\Mozilla Firefox\” folder and should have this content:

[XRE]
EnableProfileMigrator=false


It is just this simple you can now just remove the Desktop shortcut in your .wsi file and compile it to .msi file.

8 comments:

Akki said...

What exactly does the override.ini do?
What is its importance?

Piyush Nasa said...

After you are done installing Firefox, and you run it for the first time, it asks you if you want to import settings and favorites from Internet Explorer. If this is going to truely be a scripted install, we don't want to click anything.
Override.ini will prevent this from happening.

Anonymous said...

Piyush, what if our networks proxy needs to use the "auto config script" ? I can change the network proxy type to 2 from 1 and it will mark that option but how to you get it to input the proxy address there?

thanks much

Anonymous said...

Nevermind I found it :)

Its called
network.proxy.autoconfig_url

Piyush Nasa said...

Thanks for adding information here.

Facemelt said...

How do I script a custom action so that it removes any version that was previously installed with the mozilla setup.exe? Your tutorial is amazing though and I am not taking away from that.

Facemelt said...

How do you get it to uninstall previous versions? Installations created with the mozilla setup.exe aren't available to do a major upgrade. This tutorial is amazing work and thank you!

Piyush Nasa said...

That is when managed software comes into picture. If from start you package Mozilla firefox, you can use upgrade code for every package in your install.
However, now I would suggest you to look as this KB and see if it works for you.
http://kb.mozillazine.org/Uninstalling_Firefox