How can I script Firefox updates using vbScript, PowerShell or C#?
I would like to script Firefox updates using vbScript, PowerShell or C#, are there any API calls I use to do this? There are several different OS version versions that I support and auto update is not an option. I do updates at a specific time of the month. I would like to write a script that would download and install the update for the currently installed version of Firefox (32 or 64 bit) for the version of the OS (32 or 64bit). I can detect the OS version and the Firefox version. I can download updates but I do not want to hard code anything.
Все ответы (13)
hello, for some documentation on how the firefox updates work, please refer to https://wiki.mozilla.org/Software_Update (also the links at the bottom of the page!).
The latest version of firefox is available from official sites such as:
so you would not need to hard code the version number.
Note also Firefox updates are on a six week cycle. If you update only on one specific day of each month you will be out of sync with that cycle, and so, often running outdated and insecure Firefox.
Also have you considered
- using Firefox ESR instead of the standard Releases (if you are not already doing so)
http://www.mozilla.org/en-US/firefox/organizations/ - you should also the possibility of evaluating the Beta channel releases in some of the working installs. Firefox 20 broke completely on thousands of corporate machines.
Thanks fo the info. Another question. What is the version pattern for Firefox? (20.0.1, 20.0.2., 20.0.3...) or (20.1, 20.2, 20.3...)?
Ordinarily for Releases the pattern is 20.0.0, 20.0.1, 20.0.2....
With luck it will be 20.0, 21.0, 22.0 ....
The other releases are unscheduled
Note the user agent string now no longer differentiates between minor Releases nn.n.x because the final digit is not included.
Also IIRC the current Release 20.0.1 was Windows OS only due mainly to the issue with corporate installs and UNC paths. Minor releases are not always for all OS s.
Thanks. So I an do something like this to download the binary.
private void FindVersion()
{ //[MAJOR VERSION].[MINOR VERSION].[BUILD NUMBER].[REVISION NUMBER] int iMajorVer = 20; int iMinorVer = 0;
while (true) { string strVersion = "http://url.com/" + iMajorVer.ToString() + "." + iMinorVer.ToString();
// check for version 20.0, 21.0, 22.0 ... if (!DoInstallFileExist(strVersion)) { string strVersion = "http://url.com/" + iMajorVer.ToString() + "." + iMinorVer.ToString();
// check for version 2X.x if (!DoInstallFileExist(strVersion)) { for (int i = 0; i < 10; i++) { // check for version 2X.x.x DoInstallFileExist(strVersion + "." + i); } } iMinorVer++; } iMajorVer++; } }
I do not write code :-)
So my comments will be rather naive.
When does your code iteration stop ?
If used on an ftp site with multiple versions
- would it stop on the first match, and so always download fx20
- would it download each version it finds
and so download fx20 and then in turn each other version it finds, until stopping with the latest version, presumably a Nightly !
Hopefully your code in fact merely checks for the version's existence and downloads only the latest version, and you have identified a suitable ftp location with Releases only.
If used with a site such as http://www.mozilla.org/en-US/firefox/all/ there is only one (numbered) version available so there is no need to check for the latest version, merely to compare the version available with the version installed.
Note also cor-el's post /questions/958270#answer-433132 and link
Изменено
The latest version is in the latest directory and you can check the last modified date and file name of the Firefox setup file.
- http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/en-US/
- https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/en-US/
The details of the currently installed version can be found in the application.ini file in the Firefox program folder.
Изменено
My code will check if Firefox is installed. If it is, then what version is it. I will then check if there is a new version. My look stop checking after 1 full version. if version 20.1.1 it will stop at 30.1.1. The check is very fast. I will how ever look at http://www.mozilla.org/en-US/firefox/all/ and see if it will work better for me. Thanks for the info.
"My look stop checking after 1 full version. if version 20.1.1 it will stop at 30.1.1."
That's 10 versions, not 1 version. After 20.0.1 there could be a "chem-spill" update (##.0.#), although that is unlikely now given that Firefox 21.0 is slated for release on May 14.
You are correct. It was a typo. Writing on a few forums.
I downloaded the file from http://www.mozilla.org/en-US/firefox/all/ and the product version is 20.0. The current update is 20.0.1. I think I will stick to what I have and just make a small change.
http://www.mozilla.org/en-US/firefox/all/ should be giving 20.0.1 already if you are on Windows. If not something is going wrong with the Mozilla site, or you are not looking at the Windows version..
All Firefox download pages give a link to Firefox 20.0.0
You need to update manually to 20.0.1 or download/install the 20.0.1 directly to get this version for Windows.
You can only check with version is the latest as offered on the in the latest directory on the server like I posted above.