Latest Firefox now available as PKG

henrik_schack
New Contributor II

https://download.mozilla.org/?product=firefox-pkg-latest-ssl&os=osx
https://download.mozilla.org/?product=firefox-esr-next-pkg-latest-ssl&os=osx

Reference:
https://bugzilla.mozilla.org/show_bug.cgi?id=1617992

4 REPLIES 4

cbrewer
Valued Contributor II

What is the difference between firefox-esr-next-pkg-latest-ssl and firefox-esr-pkg-latest-ssl? Both currently return the 68.9.0 ESR package.

shaquir
Contributor III

Thanks for the heads up! Put together a simple script to automatically download and install the latest Firefox from the pkg.

#!/bin/bash
#Automatically downloads latest Firefox package and installs
#Created 6-2-2020 by Shaquir Tannis
#Influenced by https://www.jamf.com/jamf-nation/discussions/35211/updates-to-google-chrome-deployment-for-macos#responseChild200000

firefoxDownloadUrl=$(curl "https://download.mozilla.org/?product=firefox-pkg-latest-ssl&os=osx" -s -L -I -o /dev/null -w '%{url_effective}')
pkgName=$(printf "%s" "${firefoxDownloadUrl[@]}" | sed 's@.*/@@' | sed 's/%20/-/g')
firefoxPkgPath="/tmp/$pkgName"
logfile="/Library/Logs/FirefoxInstallScript.log"

/bin/echo "--" >> ${logfile}
/bin/echo "`date`: Downloading latest Firefox version." >> ${logfile}
#Downloads file
/usr/bin/curl -L -o "$firefoxPkgPath" "$firefoxDownloadUrl"
/bin/echo "`date`: Installing $pkgName..." >> ${logfile}
#Install PKG
cd /tmp
/usr/sbin/installer -pkg "$pkgName" -target /
/bin/sleep 10
/bin/echo "`date`: Deleting package installer." >> ${logfile}
#Remove downloaded PKG
/bin/rm "$firefoxPkgPath"

Did it work properly for you on both Intel and M1 CPUs?

jonlju
Contributor

Great script @shaquir . I modified it a little so we can also use it with other applications (by filling in parameter 4 with the URL) as well:

#!/bin/bash
#Automatically downloads latest Firefox package and installs
#Created 6-2-2020 by Shaquir Tannis
#Influenced by https://www.jamf.com/jamf-nation/discussions/35211/updates-to-google-chrome-deployment-for-macos#responseChild200000

programDownloadUrl=$(curl "$4" -s -L -I -o /dev/null -w '%{url_effective}')
pkgName=$(printf "%s" "${programDownloadUrl[@]}" | sed 's@.*/@@' | sed 's/%20/-/g')
programPkgPath="/tmp/$pkgName"
logfile="/Library/Logs/ScriptInstaller.log"

/bin/echo "--" >> ${logfile}
/bin/echo "`date`: Downloading program." >> ${logfile}
#Downloads file
/usr/bin/curl -L -o "$programPkgPath" "$programDownloadUrl"
/bin/echo "`date`: Installing $pkgName..." >> ${logfile}
#Install PKG
cd /tmp
/usr/sbin/installer -pkg "$pkgName" -target /
/bin/sleep 10
/bin/echo "`date`: Deleting package installer." >> ${logfile}
#Remove package if it still exists
if test -f "$programPkgPath"; then
    /bin/rm "$programPkgPath"
else
    echo "$programPkgPath does not exist."
fi