Wednesday, May 29, 2013

Silently install Firefox 21 and preconfigure it for deployment with SCCM

Silently install Firefox 21 and preconfigure it for deployment with SCCM

This was a pain to figure out. Most of it was done here, thanks Adrian Gordon.

I've added two modifications.

1. The method he uses to disable the bookmark importer doesn't work as the override.ini file has moved. I've modified the install script to reflect this.
2. I want the internal pdf viewer disabled as we prefer to use acrobat reader or pro. This required a modification to the mozilla.cfg file in our package.

Here's the final results.

Create a folder to contain all your files.

Download the Firefox 21 .exe file and place it in the folder.

Create an install.cmd file and these are the contents;
@echo off
REM==========================================
REM Install FireFox 21.0
REM==========================================
REM Date   : 16 April 2013
REM Author : mockbox.net
REM .
REM Script Details:
REM --------------
REM  This script will:
REM       + silently install or upgrade Firefox 20.0.1 WITHOUT Firefox being the default browser
REM       + Disables the 'Automatically check for updates' option
REM       + Disables the 'Always check to see if Firefox is the default browser on startup' option
REM       + Deletes desktop icon
REM       + Works for Windows XP / 7 32-bit and 64-bit
REM .
REM===========================================
echo Installing Firefox - Please Wait.
echo Window will close after install is complete

REM Install Firefox 21.0
"%~dp0Firefox Setup 21.0.exe" -ms

REM Install 32-bit customisations
if exist "%programfiles%\Mozilla Firefox\" copy /Y "%~dp0override.ini" "%programfiles%\Mozilla Firefox\browser"
if exist "%programfiles%\Mozilla Firefox\" copy /Y "%~dp0mozilla.cfg" "%programfiles%\Mozilla Firefox\"
if exist "%programfiles%\Mozilla Firefox\" copy /Y "%~dp0local-settings.js" "%programfiles%\Mozilla Firefox\defaults\pref"


REM Install 64-bit customisations
if exist "%ProgramFiles(x86)%\Mozilla Firefox\" copy /Y "%~dp0override.ini" "%ProgramFiles(x86)%\Mozilla Firefox\browser"
if exist "%ProgramFiles(x86)%\Mozilla Firefox\" copy /Y "%~dp0mozilla.cfg" "%ProgramFiles(x86)%\Mozilla Firefox\"
if exist "%ProgramFiles(x86)%\Mozilla Firefox\" copy /Y "%~dp0local-settings.js" "%ProgramFiles(x86)%\Mozilla Firefox\defaults\pref"


REM Removes Firefox Desktop Icon - Windows XP
if exist "%allusersprofile%\Desktop\Mozilla Firefox.lnk" del "%allusersprofile%\Desktop\Mozilla Firefox.lnk" /S

REM Removes Firefox Desktop Icon - Windows 7
if exist "%public%\Desktop\Mozilla Firefox.lnk" del "%public%\Desktop\Mozilla Firefox.lnk"

REM Return exit code to SCCM
exit /B %EXIT_CODE%

Create a local-settings.js file and these are the contents;
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");


Create a mozilla.cfg file and these are the contents;
//Firefox Default Settings

// set Firefox Default homepage
pref("browser.startup.homepage","http://uwfox.uwc.edu");

// disable default browser check
pref("browser.shell.checkDefaultBrowser", false);
pref("browser.startup.homepage_override.mstone", "ignore");

// 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);

// disables built in pdf viewer
pref("pdfjs.disabled", true);

Create an override.ini file and these are the contents;
[XRE]
EnableProfileMigrator=False

Once all these files are in your folder, make it into a SCCM package and your program should run install.cmd.

No comments:

Post a Comment