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.
The same procedure can be used for version 10.0.1, 11, 12 and 13, 14 and 15 as well as I have tried and it works fine for all of these.
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.

24 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

Rainer said...

How shouldi use the upgrade Code to do a upgrade of an previous installed Firefox? What is the "upgrade Code"? Where do i find it?

Piyush Nasa said...

Read MSI.chm about upgrade code. Every package has an upgrade code. It is used to uninstall previous application before installation of this one.

Anonymous said...

hi

can any one help me to enable the add-ons in firefox 13.

the add-ons are added using mst which put the add-ons into extensions folder.

when i launch the shortcut, add-ons-> extensions, i can see the status as disabled.
i tried using xpinstall.enabled, true but dint worked..

thanks in advance

Anonymous said...

Hello Piyush,

Please let me know how to install Add-Ons for ALLUSERS profile?

Mozilla Firefox Support said...

Interesting and beautiful blog lovely presentation thanks for sharing your views..

Visit at www.itechguru247.com for Unlimited Tech support call Toll Free number: 1-888-702-3607.

Piyush Nasa said...

I would suggest you to follow the add-on procedure mentioned here and take a setup capture of it and see what changes it do.
http://support.mozilla.org/en-US/kb/Customizing%20Firefox%20with%20add-ons

Hakka said...

I packaged the Mozilla firefox 13

http://support.mozilla.org/en-US/questions/820392?s=automate+profile+creation&r=1&e=un&as=s

automate profile migration -
That folder doesn't exist anymore, so you will have to create it. All files in that folder are copied to a new profile.
◦C:\Program Files\Mozilla Firefox\defaults\profile\

Hakka said...

http://support.mozilla.org/en-US/questions/820392?s=automate+profile+creation&r=1&e=un&as=s
Mozilla 13.0.1
All the config can be in the prefs.js
and copied to a new profile.
◦C:\Program Files\Mozilla Firefox\defaults\profile\

no need of the mozilla.cfg

Piyush Nasa said...

Thanks Hakka for your input. Much appreciated.

Anonymous said...

Hi Hakka,
your comment about the need of the mozilla.cfg file isn't quite accurate. The mozilla.cfg file is used to lock down settings. They appear greyed out, when you start FF.
The pref.js is (as its name suggests) a preference file. The settings you put in there are defaults, but can be altered by the user.
Hope this clarifies this a bit.
Regards, Nick

Anonymous said...

You can use user_pref, wich is default with the possibility to change...
Or you can use lock_pref, wich is default settings, but greyed out for changes.

Anonymous said...

So useful! Thanks a lot :)

Anonymous said...

Have a look at Firefox Client Customization Kit (CCK), it allows you to modify all settings in Firefox as an addon. I've been using this to modify user seettings on our build

vish msi said...

Hi Piyush,
Thsi is Balu..
I am working on Firefox 21.0 msi package.This version is prompting "ProfileMigretion" even "override.ini" file present at INSTALLDIR.and also i want to keep hompage bt user able to change that ondemand. please help me on this.

Thanks in advance.

Prasanna Kumar said...

can able to virtualiaze mozila firefox usin appv 4.6

Piyush Nasa said...

Yes you can and I have done it.
You need to take care of plugins and java install. Either you can install them all in one or create a DSC with these components.