In this post I’ll walk through the steps on how you can successfully deploy Mozilla Firefox with ConfigMgr 2012. For this particular post we’ll be deploying the current ESR (Extended Support Release) version. When writing this, the version is 24.2. We’ll also make sure that Firefox will not bug end-users with any update dialog windows.

Overview

  • Download the installation file
  • Create necessary files to disable automatic update function
  • Script wrapper
  • Create an application in ConfigMgr 2012

Download the installation file

Go ahead and download the Mozilla Firefox 24.2 setup file from the following location:
ftp://ftp.mozilla.org/pub/firefox/releases/24.2.0esr/win32/en-US/

Save it to your Content Library. In my case I’ll be saving the file as Firefox24.2.0esr.exe in:
\\fileserver\ContentLibrary$\Software\Firefox\24_2

I’m renaming the setup file just to eliminate errors in the script that we’ll be using later. It’s important that the file doesn’t have any spaces in the file name, or the script will not function properly. If you’d like to name it something else, go ahead and do so but remember to update this line in the script below:

strPath = """Firefox24.2.0esr.exe""" & " -ms"

Create necessary files to disable automatic update function

When you’re deploying Mozilla Firefox in an enterprise where users are not allowed to install applications themselves (except from the Application Catalog), I’d recommend that you turn of the Update function. Doing so requires two files to be created and stored in the same location as of the setup file. In this post, we’ve put the setup file in the Content Library mentioned above. The two files that needs to be created are the following:

local-settings.js

The local-settings.js file should contain the following:

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

mozilla.cfg

The mozilla.cfg file should contain the following:

lockPref("app.update.auto", false);
lockPref("app.update.enabled", false);

As already mentioned, it’s important for the script below to function properly that you create these two files and put them in the same directory as the Mozilla Firefox setup file. The link below explains more in detail regarding the two files that we’ve created:

http://blog.danielburrowes.com/2013/06/mozilla-firefox-disable-auto-update.html

Script wrapper

Save the below script as install.vbs and put it in the same location as where you downloaded the setup file for Mozilla Firefox. In this case that would be \\fileserver\ContentLibrary$\Software\Firefox\24_2. You can never repeat something that’s important to many times! This script will close any running instances of firefox.exe, execute the Mozilla Firefox setup and wait for it to finish. Once the setup has finished, it will copy the local-settings.js and mozilla.cfg into its required locations.

Set objWMIService = GetObject ("winmgmts:")
foundProc = False
procName = "firefox.exe"

For Each Process in objWMIService.InstancesOf ("Win32_Process")
    If StrComp(Process.Name,procName,vbTextCompare) = 0 Then
        foundProc = True
        procID = Process.ProcessId
    End If
Next
If foundProc = True Then
    Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process where ProcessId =" &  procID)
    For Each objProcess in colProcessList    
        objProcess.Terminate()
    Next
    WScript.Sleep(1000)
End If

strPath = """Firefox24.2.0esr.exe""" & " -ms"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run strPath, 1, True
Set WshShell = Nothing

Set objShell = WScript.CreateObject("WScript.Shell")
strFileToCopy1 = "local-settings.js"
strFileToCopy2 = "mozilla.cfg"
strFolder1 = objShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Mozilla Firefox\defaults\pref\"
strFolder2 = objShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Mozilla Firefox\"

Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolder1) Then
  objFSO.CopyFile strFileToCopy1, strFolder1, OverwriteExisting  
End If
If objFSO.FolderExists(strFolder2) Then
  objFSO.CopyFile strFileToCopy2, strFolder2, OverwriteExisting
End If

Create an application in ConfigMgr 2012

1. Create a new Application and on the General page select Manually specify the application information. Click Next.
2. On the General Information page, give the application a name, version etc that you feel is needed for your environment and click Next.
3. Enter the information that will be displayed in the Application Catalog if you decide to distribute the application to end-users. Click Next when you’ve added the necessary information for your environment.
4. Select Add on the Deployment Types page. Now the Create Deployment Type Wizard appears.
5. On the General page, select Script Installation as Type and click Next.

69_1

6. On the General Information page, give the deployment type a name and fill in any other necessary information for your environment. Click Next.
7. Enter the path to where you’ve put the Firefox setup file and the files created above in the Content Location field. Configure the following:

Installation program: install.vbs
Installation start in: <empty>

Uninstall program: helper.exe -ms
Uninstall start in: %ProgramFiles(x86)%\Mozilla Firefox\uninstall

69_2

When done, click Next.

8. On the Detection Method page, click Add Clause. Configure the following:

Setting Type: File System
Type: File
Path: %ProgramFiles(x86)%\Mozilla Firefox
File or folder name: firefox.exe
This file or folder is associated with a 32-bit application on 64-bit systems: Checked
The file system setting must satisfy the following rule to indicate the presence of this application: Checked
Property: Version
Operator: Equals
Value: 24.2.0.5087

69_3

When done, click Next.

9. On the User Experience page, configure the following:

Installation behavior: Install for system
Logon requirement: Whether or not a user is logged on
Installation program visibility: Hidden
Maximum allowed runtime (minutes): 30 (this can be set to whatever suites your environment)
Estimated installation time (minutes): 2 (this can be set to whatever suites your environment)

69_4

When done, click Next.

10. On the Requirements page, add any requirement that might be necessary for your environment. I always add a requirement for total amount of free disk space on the system drive, configured as the below image. Click Next when done.

69_5

11. We’ll not configure any dependencies for this application, but if your environment requires it you can do that now. Click Next.
12. On the Summary page, click Next.
13. On the Completion page, click Close.
14. You should now be back at the Create Application Wizard. Click Next.
15. On the Summary page, click Next.
16. On the Completion page, click Close.

You can now go ahead and deploy this application to a group of test systems or in your lab environment. Remember to distribute the application to your Distribution Points or even your Distribution Point Groups.

That’s all!

Nickolaj Andersen
Principal Consultant and Enterprise Mobility MVP. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows deployments and Automation. In 2015 Nickolaj was awarded as PowerShell Hero by the community for his script and tools contributions. Author of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService and a frequent speaker at user groups.

(1721)

comments
  • scott
    Posted at 17:34 July 16, 2014
    scott
    Reply
    Author

    How would I modify the script if I needed to copy a folder and all its subfolders to the Mozilla Firefox directory

  • Jeff
    Posted at 14:38 July 18, 2014
    Jeff
    Reply
    Author

    Great write up and very useful, thanks.

    Do you know how I can get the Firefox SCCM install to automatically add/install an add-in to Firefox?

    Jeff

  • Raj
    Posted at 14:41 August 26, 2014
    Raj
    Reply
    Author

    Hi, i’m having trouble detecting a FirefoxESR 31.0 installation using sccm2012 and file version detection on the .exe file for version 31.0. it keeps coming back in appenforce.log that the app isn’t detected even though it installs successfully. does anyone have a workaround? thanks.

    • Ben Denham
      Posted at 02:25 October 16, 2014
      Ben Denham
      Reply
      Author

      To get this to work for ESR 31 you have to ensure you have the full version number in the Detection method “Equals” section.

      31.2.0 will not work since this is not the full version number and SCCM is looking for an exact value.

      If you go to the properties of firefox.exe and go to details you will see the full version number.

      Enter version number 31.2.0.5397 and your detection method will start working correctly.

  • Ben Denham
    Posted at 02:22 October 16, 2014
    Ben Denham
    Reply
    Author

    FYI ESR 31

    To get this to work for ESR 31 you have to ensure you have the full version number in the Detection method “Equals” section.

    31.2.0 will not work since this is not the full version number and SCCM is looking for an exact value.

    If you go to the properties of firefox.exe and go to details you will see the full version number.

    Enter version number 31.2.0.5397 and your detection method will start working correctly.

    Happy packaging!

    • Kirill Konovalov
      Posted at 21:38 December 29, 2014
      Kirill Konovalov
      Reply
      Author

      I am following these instructions, but after my deployment I get an error stating Past Due-Will be Retired. My clause stated the same version number as indicated in the properties of firefox.exe

      • Nickolaj
        Posted at 10:55 January 2, 2015
        Nickolaj
        Reply
        Author

        Hi Kirill,

        Have a look in the AppEnforce.log file for the complete error message you received on that specific client. What does it show?

        Regards,
        Nickolaj

  • Ben Denham
    Posted at 00:59 October 17, 2014
    Ben Denham
    Reply
    Author

    FYI X86

    If you want this to work correctly for x86 machines you must edit the script so that the “mozilla.cfg” and “local-settings.js” files copy to the Mozilla Firefox folder so that configuration settings are applied inside:
    C:\Program Files\Mozilla Firefox

    Just change the %PROGRAMFILES(x86)% to %PROGRAMFILES% as seen below:

    strFolder1 = objShell.ExpandEnvironmentStrings(“%PROGRAMFILES%”) & “\Mozilla Firefox\defaults\pref\”
    strFolder2 = objShell.ExpandEnvironmentStrings(“%PROGRAMFILES%”) & “\Mozilla Firefox\”

    • Nickolaj
      Posted at 10:55 October 28, 2014
      Nickolaj
      Reply
      Author

      Thanks Ben for contributing to this post!

      Regards,
      Nickolaj

  • Robert
    Posted at 23:10 December 9, 2014
    Robert
    Reply
    Author

    I set this application up but am getting an error when it attempts to install:

    The system cannot find the file specified.
    C:\Windows\ccmcache\4l\install.vbs

    I checked the location and the file is there so I retried the install and got the same error. Anyone seen this happen with this setup?

    • Nickolaj
      Posted at 09:09 December 10, 2014
      Nickolaj
      Reply
      Author

      Hi Robert,

      This sounds quite odd, could you please paste a snippet from the AppEnforce.log on the client where it fails?

      Regards,
      Nickolaj

    • Dave
      Posted at 21:15 January 13, 2015
      Dave
      Reply
      Author

      I would suggest clearing the cache on the client; that will force it to re-download it. Also, try re-running the machine policy retrieval task from the Config Mgr control panel applet on the client. If you updated the deployment at all, it will create a new version and the client may not be aware and is trying to download a previous version from the DP that isn’t there any more.

  • Rob Landon
    Posted at 15:47 July 21, 2015
    Rob Landon
    Reply
    Author

    What is the best way to determine the full version number of Firefox ESR 38.1? I want to make sure my detection method in my deployment is accurate.

  • Stanley Gholson
    Posted at 19:04 August 13, 2015
    Stanley Gholson
    Reply
    Author

    Hello all,

    So I’m attempting this process with Firefox 40.0. I’ve got the package created, distributed and deployed. However when I try to install it on one of my test machines, it downloads fine but shorting after starting to install it fails. I’ve checked the AppEnforce.log but there are no error for my install. Will this setup work for non ESR version of Firefox?

  • curious
    Posted at 08:44 October 12, 2015
    curious
    Reply
    Author

    Where did you get specific version number for firefox? When looking from firefox help -> about firefox it shows only (i.e) 36.0.4. What does the 5087 stand for in your example?

  • Karine
    Posted at 00:48 October 29, 2015
    Karine
    Reply
    Author

    Nice post. I was checking continuously this blog and I am
    inspired! Very helpful iinfo specially the remaining section 🙂 I deal with such info a lot.
    I used to be seeking this particular information for a long time.
    Thanks and good luck.

  • scott s
    Posted at 17:37 February 29, 2016
    scott s
    Reply
    Author

    Does this work for 32bit and 64 bit systems?

    • Nickolaj
      Posted at 10:32 March 4, 2016
      Nickolaj
      Reply
      Author

      To my knowledge it should.

      Regards,
      Nickolaj

  • Bert Linson
    Posted at 09:18 October 28, 2016
    Bert Linson
    Reply
    Author

    Nice write up. Having a problem that in Software Center it shows that Firefox is downloading but stays at 0% and never installs.

    Anyway to fix this?

  • Leave a Reply