Changes

Jump to: navigation, search

Background Updates

82 bytes removed, 14:11, 18 October 2011
no edit summary
*** On Mac, if Firefox is installed to "/path/to/Firefox.app", <code>FIREFOX_NEW</code> will be "/path/to/Firefox.app/Updated.app". In other words, the updated version of Firefox will be installed as a bundle inside the existing Firefox bundle.
*** On Linux, if Firefox is installed to a flat directory like "/path/to/firefox", <code>FIREFOX_NEW</code> will be "/path/to/firefox/updated". If it's installed in a non-flat directory structure (like /usr/bin for example), the details of where <code>FIREFOX_NEW</code> will be is TBD.
** The manifest file will be known as an empty file named is the "update.pendingstatus" located in file used by the root of the existing Firefox installationupdater service.* The updater binary checks to see if there is an existing manifest file. :[[User:Robert Strong|Robert Strong]] 02:16, 18 October 2011 (PDT) we might be able to just use the existing update.status file located in "/path/to/firefox/updates/0/" though it shouldn't be removed in the next step.** If this file exists, and it will be removedcontains "applied", its content is changed to "applying". Otherwise, the background update stops.
* The updater binary checks to see if there is an existing <code>FIREFOX_NEW</code> directory.
** If this directory exists, it will be removed.
* The updater binary will go ahead and apply the update to the <code>FIREFOX_NEW</code> directory using the existing installation directory as the base. Any errors happening during this phase (such as running out of disk space or failing to write to disk) will be handled by the updater process by removing the <code>FIREFOX_NEW</code> directory and aborting. :[[User:Robert Strong|Robert Strong]] 02:16, 18 October 2011 (PDT) The updater binary will also write to the update.status file "failed: n" where n is the reason code.
* The updater binary will write a new "applied" to the manifest file to the existing installation directory.
* The updater binary will shutdown, and signal the Firefox main process.
* The Firefox main process will search for new updates when the next update interval is reached.
The following needs to happen at Firefox startup time in order for the applied update to be used.
* Firefox checks for the manifest file in the installation directory. If it's not found, or its content does not equal "applied", then startup continues as normal.* If the manifest file is foundand its content is "applied", Firefox looks for the known <code>FIREFOX_NEW</code> directory. If that directory is not found, Firefox removes writes "failed: ERROR_CODE" to the manifest file and continues to startup as normal.
* If the <code>FIREFOX_NEW</code> is found, Firefox "replaces" the existing installation direcotry with the new <code>FIREFOX_NEW</code> directory, and removes the <code>FIREFOX_NEW</code> directory, and restarts using the new binary. The details of this phase depends on the platform, and is documented below.
=== Mac ===
On Mac, we basically move the Contents directory in the <code>FIREFOX_NEW</code> directory over to the Contents directory in the existing installation, remove the manifest file and the now empty <code>FIREFOX_NEW</code> directory, write "succeeded" to the manifest file, and restart Firefox. :[[User:Robert Strong|Robert Strong]] 02:19, 18 October 2011 (PDT) There is also the precomplete file in the root of the bundle.
=== Linux ===
On Linux, we basically move the <code>FIREFOX_NEW</code> over the existing installation directory, remove write "succeeded" to the manifest file, and restart Firefox.
== Considered alternatives ==
= Downgrade =
Firefox currently supports downgrading to older versions by installing an old installer over the new installation directory. The way that it works is that the Firefox installer first uninstalls the old version and then proceeds with the rest of the installation. This can be made possible in the face of background updates by adding relying on the manifest file uninstaller to know about the uninstall.log manifest file, and making the installer aware of the <code>FIREFOX_NEW</code> directory. The uninstaller should remove the <code>FIREFOX_NEW</code> directory as part of the uninstall process. The same handling is enough to correctly handle Firefox being uninstalled explicitly as well.
Confirm
657
edits

Navigation menu