Deploy Mozilla Firefox with ConfigMgr 2012
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.
- 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:
Save it to your Content Library. In my case I’ll be saving the file as Firefox24.2.0esr.exe in:
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:
The local-settings.js file should contain the following:
pref("general.config.obscure_value", 0); pref("general.config.filename", "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:
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.
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
When done, click Next.
8. On the Detection Method page, click Add Clause. Configure the following:
Setting Type: File System
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
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)
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.
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.
Principal Consultant and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Currently working for TrueSec as a Principal Consultant. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences and user groups.