Fixlet to upgrade all Firefox to Firefox ESR

I am looking for a fixlet to convert or upgrade all Firefox to Firefox ESR

I used this powershell script to pull the latest 64-bit version of Firefox ESR and applied it to any devices that had Firefox (non ESR on it) and it has been successful. If you don’t want the 64bit you can adjust the URL.

// Enter your action script hereaction uses wow64 redirection {not x64 of operating system}

delete __createfile

//    CREATEFILE
createfile until END_OF_FILE

#Download URL: https://download.mozilla.org/?product=firefox-esr-latest&os=win&lang=en-US

#Path for the workdir
$workdir = "c:\Temp\"

#Check if work directory exists if not create it

If (Test-Path -Path $workdir -PathType Container)
{{ Write-Host "$workdir already exists" -ForegroundColor Red}
ELSE
{{ New-Item -Path $workdir  -ItemType directory}

#Download the installer

$source = "https://download.mozilla.org/?product=firefox-esr-latest&os=win64&lang=en-US"
$destination = "$workdir\firefoxsetup.exe"

#Check if Invoke-Webrequest exists otherwise execute WebClient

if (Get-Command 'Invoke-Webrequest')
{{
     Invoke-WebRequest $source -OutFile $destination
}
else
{{
    $WebClient = New-Object System.Net.WebClient
    $webclient.DownloadFile($source, $destination)
}

#Start the installation

Start-Process -FilePath "$workdir\firefoxsetup.exe" -ArgumentList "/S"

#Wait XX Seconds for the installation to finish

Start-Sleep -s 35

#Remove the installer

rm -Force $workdir\firefox*

#write-host should be changed to write-verbose  # we have not tried it yet with these directions
#https://devblogs.microsoft.com/scripting/understanding-streams-redirection-and-write-host-in-powershell/

END_OF_FILE

delete powershell.ps1
move __createfile powershell.ps1

waithidden { pathname of file ((it as string) of value "Path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" of native registry) } -ExecutionPolicy Bypass -File powershell.ps1

Thanks, Beachbound, can i copy and paste as such or do I need to edit any steps?

You should be fine to just copy and paste. The link to the latest ESR version is for the 64bit installation. If you do not want that, you would need to change that link.

1 Like

Do this script requires reboot

No, it doesn’t require a reboot.