November 8, 2011

Sequencing Mozilla Firefox 8

Mozilla has just released Firefox 8, so it’s time to look at virtualizing the new version. It’s a simple task to virtualize Firefox, as it lends itself well to application virtualization; however getting it right takes a little more effort. Here’s how to successfully sequence Mozilla Firefox 8.x.

What you lose by virtualizing Firefox

Virtualizing Firefox with App-V will isolate the application from the OS, so the following features will not be available once Firefox has been sequenced:

  • Firefox Jump Lists in the Start Menu and Taskbar
  • The ability set the browser as default

Firefox features to disable

There are a couple of features that should be disabled when running Firefox under App-V:

  • Automatic updates for Firefox – Options / Advanced / Update – Automatically check for updates to: Firefox. Firefox updates should be delivered via new App-V packages. Updates for Add-ons and Search Engines should be OK as these are written to the user profile
  • Default browser check – Options / Advanced / General – Always check to see if Firefox is the default browser on startup. Once Firefox is isolated from the OS, the user won’t be able to make it the default browser

I will cover using a couple of customisation to ensure these features are disabled for any new Firefox profile.

Managing the Firefox profile – virtualize or not?

Firefox stores preferences, extensions and other user data in:

  • %APPDATA%\Mozilla (preferences, bookmarks etc.); and
  • %LOCALAPPDATA%\Mozilla (browser cache)

The default behaviour of the App-V Sequencer is to exclude %LOCALAPPDATA% – this is a good thing and I don’t recommend removing this exclusion. %APPDATA% will be included by default and whether you leave this location included in the package will depend on your specific deployment requirements; however my recommendation is to exclude this location by adding %CSIDL_APPDATA%\Mozillato the exclusion list in your sequence. On the client, Firefox will then create a new profile in the real file system when the user starts the browser for the first time. There are several reasons why this approach is a good idea:

  • Some of the configuration files within the Firefox profile include hard-codes paths – challenging if your App-V virtual drive changes between clients
  • Virtualizing the profile increases the complexity of upgrading Firefox packages especially challenging given Mozilla’s new approach to Firefox releases. By storing the Firefox profile on the real file system, Firefox can be deployed via completely unrelated packages – no need to create upgrade versions
  • Users can potentially create multiple Firefox profiles, with each stored in the users’ PKG file. The minimum size for a new Firefox profile is 12Mb – the PKG file will grow by 12Mb for each new Firefox profile created

By excluding %APPDATA% and not virtualizing the user profile you will gain some flexibility with your Firefox deployment.

Configuring Firefox Defaults

If a Firefox profile is not virtualized within the package any options set during the monitoring phase won’t be captured. Fortunately Firefox can be configured with defaults for any new profile so that it will contain your required configuration options.

Mozilla has made it easy to deploy custom default settings and preferences – by adding files to %ProgramFiles%\Mozilla Firefox\defaults\profile (change the path to suit your environment), new Firefox profiles will pick up a copy of these files when the profile is created. I will walk through adding a couple of files to this location to ensure that any new Firefox profile receives the required settings. You can find more detailed documentation on these features in the following articles:

To enforce user settings we can leverage user.js and the use UserChrome.css to remove those user interface elements. Available below is a copy of user.js that disables automatic updates of Firefox and checking whether it is the default browser:

Firefox user.js Firefox user.js

A simple approach to extending the options in user.js and prefs.js is to install Firefox and configure it the way you would like. Then open prefs.js from the new profile and use the entries to create custom versions.

Available here is a copy of userChrome.css that will remove from the user interface the options to enable browser updates and set Firefox as the default browser:

Firefox userChrome.css Firefox userChrome.css

Sequencing Platform

I have sequenced Firefox 8 on a clean Windows 7 SP1 x86 VM with all current updates and no other applications other than the App-V Sequencer. I’ve configured a Q: drive using a second vDisk, rather than let the Sequencer create a Q: drive for me. I’ve used a VFS install and tested successfully; however if you would prefer a MNT install just change the install folder when installing Firefox

The Firefox version available from Mozilla is an x86 application (x64 build are available from other sources), so I generally recommend sequencing Firefox on Windows 7 x86 virtual machine even though you may be deploying to 64-bit Windows. However confirm this in your own environment and re-sequence for 64-bit platforms if required.

Sequencer Configuration

Before Sequencing, add the following exclusions:

  • %CSIDL_APPDATA%\Mozilla
  • \REGISTRY\USER\%SFT_SID%\Software\Microsoft\Windows\CurrentVersion\Internet Settings

If you are adding Adobe Flash Player to the package, add these exclusions as well:

  • %CSIDL_APPDATA%\Macromedia
  • %CSIDL_WINDOWS%\Installer

I have included these in a Package Template for Firefox that you can download from here:

App-V 4 Package Template for Firefox App-V 4 Package Template for Firefox

Installing Firefox

Download the Firefox installer in your target language from the Mozilla site. Sequencing Firefox will require the following steps:

  • Install Firefox
  • Configure profile defaults
  • Optionally add global add-ons and install plug-ins such as Adobe Flash Player

Automating this process as much as possible will create a cleaner package and make it faster to re-create a new Firefox package if required.

For an example script that will automate the install and configuration of Firefox, see the script below:


REM Create the Firefox answer file
ECHO [Install] > %SOURCE%\Firefox8.ini
ECHO ; InstallDirectoryName=Firefox8 >> %SOURCE%\Firefox8.ini
ECHO ; InstallDirectoryPath=Q:\MozillaFirefox8_en-GB >> %SOURCE%\Firefox8.ini
ECHO QuickLaunchShortcut=false >> %SOURCE%\Firefox8.ini
ECHO DesktopShortcut=false >> %SOURCE%\Firefox8.ini
ECHO StartMenuShortcuts=true >> %SOURCE%\Firefox8.ini
REM Install Firefox - the START command will not work if the Firefox setup filename includes spaces
START /WAIT FirefoxSetup8.exe /INI=%SOURCE%\Firefox8.ini

REM Configure Firefox profile defaults
MD "%ProgramFiles%\Mozilla Firefox\defaults\profile\chrome"
COPY %SOURCE%\user.js "%ProgramFiles%\Mozilla Firefox\defaults\profile\user.js"
COPY %SOURCE%\userChrome.css "%ProgramFiles%\Mozilla Firefox\defaults\profile\chrome\userChrome.css"


If the monitoring phase was successful the Sequencer should create a single shortcut for Firefox. If you are including Flash Player, add an additional shortcut for the Flash Player Control Panel applet using “C:\Windows\System32\FlashPlayerCPLApp.cpl” as the target.

First Run Tasks and Primary Feature Block

If the steps above have been followed for exclusions, installation and configuration of Firefox, there will be no first run tasks to complete. Additionally the resultant package will be reasonably small so there is no need to create the Primary Feature Block. Because you don’t need to complete first run tasks or create the Primary Feature Block, you could automate the entire end-to-end process of creating a Firefox package using the App-V Sequencer command-line interface.


Save your package and deploy. With compression enabled, the package should be around 22Mb.

Print Friendly
  • Pingback: What everyone and their mother should know about VFS in App-V, pt. 2 – Client –based operations for VFS folders and special behaviour of merged folders | Gridmetric Blog()

  • Well done.  Your CMD needed a little work, but I appreciate the starting point.

    CMD Changed to:
    SET SOURCE=%~dp0

    REM Create the Firefox answer file
    ECHO [Install] > “%SOURCE%Firefox8.ini”
    ECHO ; InstallDirectoryName=Firefox8 >> “%SOURCE%Firefox8.ini”
    ECHO ; InstallDirectoryPath=Q:MozillaFirefox8_en-GB >> “%SOURCE%Firefox8.ini”
    ECHO QuickLaunchShortcut=false >> “%SOURCE%Firefox8.ini”
    ECHO DesktopShortcut=false >> “%SOURCE%Firefox8.ini”
    ECHO StartMenuShortcuts=true >> “%SOURCE%Firefox8.ini”
    REM Install Firefox – the START command will not work if the Firefox setup filename includes spaces
    START /WAIT FirefoxSetup8.exe /INI=”%SOURCE%Firefox8.ini”

    REM Configure Firefox profile defaults
    MD “%ProgramFiles%Mozilla Firefoxdefaultsprofilechrome”
    COPY “%SOURCE%user.js” “%ProgramFiles%Mozilla Firefoxdefaultsprofileuser.js”
    COPY “%SOURCE%userChrome.css” “%ProgramFiles%Mozilla FirefoxdefaultsprofilechromeuserChrome.css”

  • D Van Abs

    Tip for Firefox people who packaged 7.0.1 before: The user.js and userchrome.css you created or edited for Firefox 7 are also perfect for Firefox 8. Saves you a lot of config time.

  • Revere04

    I keep getting an error on the client.

    “Could not initialize the application’s security component. The most likely cause is problems with files in your application’s profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features.”

    Any ideas would be appreciated.

  • Kasper

    Hi Aaron. We are running an environment with a virtualized firefox, but I cant figure out what the localhost address is? On a locally installed firefox (or any other application) localhost will be= how is this working on a sequenced browser? I’m asking because i sometimes use putty for SSH tunneling, and then use the browser for accessing another system on http:\localhost:portxx. apparently this is not possible on a sequenced browser?

    • App virtualization does change where the application executes, so localhost will still be 127.0.0.x. I assume PuTTY opens the port on localhost, so I can’t see why Firefox wouldn’t work. 

  • Hi Aaron, How do you add Flash Player on the sequence? I have sequence Firefox 9 and created a shortcut for Firefox 9. When I want to add shortcut to Flash Player I could not find FlashplayerCPApp.cpl
    Im sequencing Firefox 9 with FlashPlayer 11.

  • trying to get around the “Firefox Jump Lists in the Start Menu and Taskbar”-Problem, I realized that even if I disable jumplists by “browser.taskbar.lists.enabled -> false”, the pinned shotcut on the taskbar goes directly to Q:-Drive, which of course does not work.

    Any idea how to stick Firefox to the Taskbar? It definitely works for other App-V applications.

    Secondy, did anyone get Flash player running while there is ActiceX-Flash Player installed? For me it only works, when I delete the real “C:windowssystem32Macromedia” folder. Otherwise the Flashplugin is not found by Firefox – for whatever reasion…

    • I believe that the issue is caused by the way in which Firefox implements Jump Lists, so I don’t think that there is a solution at this time.

      Have you set the C:WindowsSystem32Macromed to Override Local?