Deployment Solution

 View Only

Custom Firefox Install: Part 4 

Aug 01, 2008 11:08 AM

The internet and access to the internet is the life-blood of business today. Without access to the world wide web we would be unable to get work done. Firefox has been gaining market share and is gaining more legitimacy in the market over the past few years. Its speed, ease of use, and small thumbprint has been a hit in the IT world. So far in this series we have discovered how to use a script to install Firefox with custom settings. We have also learned how to install Add-ons using a script. Finally, we have learned how to configure and secure Firefox in multiple environments. Using the steps that I have already discussed will make deploying a fresh copy Firefox a breeze.

What if you already have Firefox installed? What do you do then? In this article we will talk about how to update an existing copy of Firefox. You will also learn how to update or even add Add-ons. Lets get started.

Updating Firefox:

One thing that I try to do for all of the software that I manage is turn off automatic updates. There are several reasons for this, but the biggest is that I want to reduce stress. When people see a screen that they are not used to they tend to freak out. Also, it is nice to test a software update before it gets deployed to every person. This is the case with Firefox in my environment. I have turned off automatic updates (I don't even let it check if there are updates). That means that I have to update Firefox. For a long time I really didn't know how to update Firefox, and my only other option was to do it by hand.

Eventually I found a way to manually install Firefox updates. It took me a while to figure everything out, but eventually I got it. Here is how you do it (I used this web page as the base of this article: http://wiki.mozilla.org/Software_Update:Manually_Installing_a_MAR_file. If you have any questions check it out):

Download the Update Files

First we need to download the update files. Here is what you do:

  • In a browser, go to: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/
  • Click on the "releases" link. If you want, you can download the "nightly" update files. For this example I want the latest official release
  • Find the update files you want:
    • At the very bottom of the page there is a link titled: "latest-3.0". This will let you download the latest version of the software, click on this link or (see below)
    • Scroll down the list and find the latest version. As of this writing Firefox 3.0.1 is the latest version. Once you find the latest release, click on the link
      Note: In the picture you can see that the latest release is at the very bottom. But, if you have not moved to Firefox 3 yet, you can download the latest release of Firefox 2.
  • A new screen will load. If you choose the folder titled "win32" you will be able to download the setup files for Firefox. We want the update files, so I will chose the folder titled "update"
  • You can choose was OS you want to update Firefox on, I want to update Firefox in Windows, so I will choose the "win32" folder
  • On this new screen you can choose the language you want to download the update files in. I want US English, so I choose "en-US"
  • We have finally reached the update files. Click on the link that has the .mar extension. In this case "firefox-3.0.1.complete.mar"

    Download the file to your desktop

Now that we have the file, we can start putting together everything else we need to get this working:

  • Create a folder on your desktop named something like "FirefoxUpdate"
  • Copy the update file (the .mar file we downloaded above) into the "FirefoxUpdate" folder we just created
  • Open the "FirefoxUpdate" folder, and right click in any empty space
  • Go to New >> Text Document
  • Rename the file to "update.bat" or "update.cmd"
  • And, rename the .mar file (firefox-3.0.1.complete.mar) to update.mar
  • Go to your Firefox directory (C:\Program Files\Mozilla Firefox) and find "updater.exe" and "updater.ini"
  • Copy those files to the "FirefoxUpdate" folder on your desktop. Copying these files will make the process a little smoother, and it will ensure that a progress UI window will run when Firefox is updating. Also, you will be updating the updater.exe file as part of this process. You can't update a file that is running.
  • Now, copy the "FirefoxUpdate" folder to the "Program Files" directory.
  • Now you are ready to update Firefox to the newest version. Open a command prompt (Start >> Run >> cmd.exe) and navigate to the folder that Firefox is installed into, in this case "C:\Program Files\Mozilla Firefox" folder by typing in: cd "\Program Files\Mozilla Firefox"
  • Now, type in: ..\FirefoxUpdate\updater ..\FirefoxUpdate 0
    • You have to run the update files from the directory that Firefox is installed in. I have tried it a bunch of other ways and it didn't seem to work right until I ran it this way.
  • The next time you open Firefox it will check and make sure that your Add-ons are up-to-date (unless you have turned that off)

I created this script to do everything for me. It adds a few more steps to the process, but it works well:

@ECHO OFF

ECHO Updating Firefox to version 3.0.1...

REM Create a directory for the update files
mkdir "C:\Program Files\FirefoxUpdate"

REM Copy the update files to our newly created directory
copy *.* "C:\Program Files\FirefoxUpdate"

REM Navigate to the Firefox directory
cd\
cd "program files"
cd "Mozilla Firefox"

REM Run the update files
..\FirefoxUpdate\updater ..\FirefoxUpdate 0

REM Remove the update directory and all files
rmdir /s /q "C:\Program Files\FirefoxUpdate"

EXIT

Notes:

There are a few things to keep in mind when you are updating Firefox. Here they are:

  • After you ran the script, you probably noticed the "FirefoxUpdate" contains all the files you need to run Firefox. In the example above I extract all of the Firefox files to a directory and then copy them into my Firefox directory
  • Firefox can't be open (this is for me, sometimes my brain isn't working)
  • It wants to update all of the files. It updates files by replacing them (this includes your settings)
  • If the user has opened Firefox before, their settings will be imported into the new version
  • Your extensions may or may not work

There are a few things from the last article that we can use to make this update process work better. All of the files that were identified as settings files can be injected into the appropriate locations:

  • prefs.js: "C:\Program Files\Mozilla Firefox\defaults\profile" and to the user profiles folder*
  • places.sqlite: "C:\Program Files\Mozilla Firefox\defaults\profile" and to the user profiles folder*
  • permissions.sqlite: "C:\Program Files\Mozilla Firefox\defaults\profile" and to the user profiles folder*
  • override.ini: "C:\Program Files\Mozilla Firefox"
  • content-prefs.sqlite: "C:\Program Files\Mozilla Firefox\defaults\profile" and to the user profiles folder*
  • localstore.rdf: "C:\Program Files\Mozilla Firefox\defaults\profile" and to the user profiles folder*
  • mimeTypes.rdf: "C:\Program Files\Mozilla Firefox\defaults\profile" and to the user profiles folder*

*You may over-write your users settings if you copy these files into their profile folder. You will have to make that judgement call.

Notes: You may want to create a subfolder in "FirefoxUpdate" with all of the files that I listed above. That will make getting the settings into the appropriate locations.

You can also make sure that all of the pre-packaged Add-ons are updated (any Add-ons that the user installs will have to be updated by them):

  • In the "FirefoxUpdate" folder, create a subfolder named "Addons"
  • Download all of the plugins you would like to update/install
  • Use the following script to update/install
    • "C:\Program Files\Mozilla Firefox 3\firefox.exe" -install-global-extension "%CD%\Addons\ie_tab-1.5.20080618-fx-win.xpi"

Here is a script that will update Firefox to the newest version, copy all of the settings files to the appropriate locations, and update all Add-ons:

@ECHO OFF

ECHO Updating Firefox to version 3.0.1...

REM Create a directory for the update files
mkdir "C:\Program Files\FirefoxUpdate"

REM Copy the update files to our newly created directory
xcopy /s *.* "C:\Program Files\FirefoxUpdate"

REM Navigate to the Firefox directory
cd\
cd "program files"
cd "Mozilla Firefox"

REM Run the update files
..\FirefoxUpdate\updater ..\FirefoxUpdate 0

ECHO Copying Custom Files...

copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\content-prefs.sqlite" "C:\Program Files\Mozilla Firefox\defaults\profile"
copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\localstore.rdf" "C:\Program Files\Mozilla Firefox\defaults\profile"
copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\mimeTypes.rdf" "C:\Program Files\Mozilla Firefox\defaults\profile"
copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\permissions.sqlite" "C:\Program Files\Mozilla Firefox\defaults\profile"
copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\places.sqlite" "C:\Program Files\Mozilla Firefox\defaults\profile"
copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\prefs.js" "C:\Program Files\Mozilla Firefox\defaults\profile"
copy /y "C:\Program Files\FirefoxUpdate\CustomSettings\override.ini" "C:\Program Files\Mozilla Firefox"

ECHO Updating Add-ons...

firefox.exe -install-global-extension "..\FirefoxUpdate\Add-ons\ie_tab-1.5.20080618-fx-win.xpi"
firefox.exe -install-global-extension "..\FirefoxUpdate\Add-ons\ie_view-1.3.7-fx+mz-win.xpi"

REM Remove the update directory and all files
rmdir /s /q "C:\Program Files\FirefoxUpdate"

EXIT

Conclusion:

Now we have Firefox covered. We can install a new copy, or update an existing copy, from the comfort of our Deployment Console or Notification Server. In this article we have learned to use scripts to update Firefox. We can even use scripts to add more functionality and improve our users experience. In the next article we will learn how to create a Firefox layer and how to add Firefox to SVS Pro.

Statistics
0 Favorited
0 Views
7 Files
0 Shares
0 Downloads
Attachment(s)
JPG file
1.JPG   12 KB   1 version
Uploaded - Feb 25, 2020
JPG file
2.JPG   11 KB   1 version
Uploaded - Feb 25, 2020
JPG file
3.JPG   7 KB   1 version
Uploaded - Feb 25, 2020
JPG file
4.JPG   5 KB   1 version
Uploaded - Feb 25, 2020
JPG file
5.JPG   4 KB   1 version
Uploaded - Feb 25, 2020
JPG file
6.JPG   4 KB   1 version
Uploaded - Feb 25, 2020
JPG file
7.JPG   7 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Sep 20, 2010 02:06 PM

Great info. Question though: is there a way to bundle other software with this package? For example, have it come with a pre-installed extension, or a toolbar? If so, I can see a lot of possibilities with this.

Aug 06, 2010 02:22 PM


This is a great article and a very good alternative to a complete reinstallation of Firefox. I am wondering if I can do the same for Thunderbird...

Nov 13, 2009 04:16 AM

Hello...this article is very helpful...

i want to make a custom installer which can run on a computer which has previously installed firefox...

how can i make a installer which adds shortcut to desktop with its custom icon and runs with a custom profile....

i can use firefox 2 version so that the pc which already has firefox 3 can also use my installer...

please help me reagrding this....

Related Entries and Links

No Related Resource entered.