Firefox, Check for Update using Command line or Script??

Sonuw
New Contributor III

Hello All,

I an having Firefox application installed on the Mac, Is there a way to Check for available updates using command line or using any script.

Regards,
SonuW

6 REPLIES 6

Sonuw
New Contributor III

Kindly Help me, Finding the solution for above post.

Thanks!

tkimpton
Valued Contributor II

No go on macs. Firefox been like that from day 1. Only self updating browser is Google Chrome. Just delete the updated app out of Firefox bundle.

tlarkin
Honored Contributor

Hi Everyone,

Not sure how reliable this is, because I haven't fussed with it in a super long time, but Firefox does have a command line binary buried with in the app bundle. See below for example:

bash-3.2$ /Applications/Firefox.app/Contents/MacOS/firefox -v
Mozilla Firefox 15.0.1
bash-3.2$ 
bash-3.2$ /Applications/Firefox.app/Contents/MacOS/firefox -v | awk '{ print $3 }'
15.0.1

Hope this helps, and as always test, test, test, test and test again before you go into production. So, there would be ways to build logic in a script based on version number, to to automatically deploy updates is a weird thing. Yes, you can auto patch security updates, but at the same time you can auto-deploy more security loop holes. I think a better approach is testing before you deploy and to repackage a new version. Of course, this is just my personal opinion for when I was a System Administrator. Obviously, there are other opinions from other admins which are just as valid.

Thanks,
Tom

mm2270
Legendary Contributor III

Well, that's cool. Didn't know there was a built in version check. You could get the same with a 'defaults read /Applications/Firefox.app/Contents/Info CFBundleVersion' But neither of those really help with determining if the version you have installed is out of date. Of course, Firefox does do some kind of version check when it launches. Hence if you have an out of date version and fire it up you'll get a page telling you the version you have is old and should be updated. So its checking against something, but not sure what.

Maybe install Little Snitch on a Mac with an old version of FF, connect it to the internet and open the app, See what Little Snitch reports. Perhaps its a URL you can do some checking against, but I'm not so sure.

The only other thing would be to do a curl on this address - http://www.mozilla.org/en-US/firefox/new/ and look for the version string in there with grep/awk, etc -Its in several places- and then use that to compare it against what the installed app is reporting. But that would be a fragile solution since if Mozilla revamps or renames their page the script could and would likely break.

tlarkin
Honored Contributor

Yeah,

So the automation solution I was hinting at would be ridiculous to set up. Parsing the version and then curl-ing the mozilla project site and then automating the download and upgrade. I've seen things like this before. Which is why I brought up the download, repackage, and test. That way also all your imaging work flows can be updated with the new package, so in a break/fix scenario when you have to reimage your image work flow has the newest approved and tested Firefox package.

Technically, you can just toss the Firefox app itself into Casper Admin (with out packaging it in Composer) and then override policy defaults and specify the path /Applications and it will drop just the app itself into scoped computer's Applications folder. However, permissions will not be set properly and of course it isn't tested for your environment.

Like I mentioned before, this is just my opinion, and there are other ways to do things and other opinions which are probably better than mine, but automating app updates is just not a good idea. I've seen app updates break things. That is why I always as a practice downloaded the new version, packaged it, tested it and then deployed it. Even with that process, I'd sometimes run into bugs down the road that I never tested. Like a new version of Firefox connecting to a specific online assessment testing site that only works with an older version of Firefox, and Chrome and Safari aren't supported.

Just a thought.

Thanks,
Tom

tkimpton
Valued Contributor II

i just use smart computer groups to check the version and install the latest if the machine fit that criteria out of hours.

Until Mozilla sort out a proper auto update mechanism like Google Chrome has done with the ksadmin, then we are stuck, same with Adobes' Flash!