Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Created February 21, 2017 00:05
Show Gist options
  • Save Jaykul/4ac29eab17afeebdd20af04aa58b666b to your computer and use it in GitHub Desktop.
Save Jaykul/4ac29eab17afeebdd20af04aa58b666b to your computer and use it in GitHub Desktop.
How to install a specific version of Firefox and make sure it doesn't get updated
# NOTE: Hard-coded to 64bit, default install, MaintenanceService off
$FFxVersion = '44.0'
$locale = 'en-US'
$Downloads = Convert-Path $Home\Downloads
$IsoPath = Join-Path $Downloads agent.iso
$FFxPath = Join-Path $Downloads ffx.exe
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest "https://download.mozilla.org/?product=firefox-${FFxversion}-SSL&os=win64&lang=${locale}" -Outfile $FFxPath
$ProgressPreference = "Continue"
Set-Content -Path "$FFxPath.ini" -Value "[Install]`nMaintenanceService=false"
Start-Process -Wait $FFxPath -ArgumentList "/INI=$FFxPath.ini"
# All three lines mandatory
Set-Content 'C:\Program Files\Mozilla Firefox\defaults\pref\autoconfig.js' @'
// This allows us custom configuration
pref("general.config.filename","automation-lockdown.cfg");
pref("general.config.obscure_value", 0);
'@
# File must match above
Set-Content 'C:\Program Files\Mozilla Firefox\utomation-lockdown.cfg' @'
// Disable updater
lockPref("app.update.enabled", false);
// make absolutely sure it is really off
lockPref("app.update.auto", false);
lockPref("app.update.mode", 0);
lockPref("app.update.service.enabled", false);
// Disable Add-ons compatibility checking
clearPref("extensions.lastAppVersion");
// Don't show 'know your rights' on first run
pref("browser.rights.3.shown", true);
// Don't show WhatsNew on first run after every update
pref("browser.startup.homepage_override.mstone","ignore");
// Disable health reporter
lockPref("datareporting.healthreport.service.enabled", false);
// Disable all data upload (Telemetry and FHR)
lockPref("datareporting.policy.dataSubmissionEnabled", false);
// Disable crash reporter
lockPref("toolkit.crashreporter.enabled", false);
Components.classes["@mozilla.org/toolkit/crash-reporter;1"].getService(Components.interfaces.nsICrashReporter).submitReports = false;
'@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment