Changes

Jump to: navigation, search

Background Updates

4 bytes removed, 19:20, 18 October 2011
corrected wiki syntax
This page describes the technical plan to move the process of applying the updates in Firefox to the background as opposed to at startup. In order to get a clear idea about the scope of the project, please see the Goals and Non-Goals sections below.
== Goals ==
# Moving the update process to the background
# Initiating the update process as soon as an update is downloaded
# Eliminate the progress bar UI that the current updater shows
== Non-Goals ==
# Handling UAC prompts on Windows
# Changing the frequency of checking for updates, our handling of major/minor updates, or the way we check for add-ons compatibility
# Any of the other projects falling under the "silent update" umbrella
== Implementation ===== Background updates ===
Here is a proposal for how background updates will be implemented.
* The Firefox main process will search for new updates when the next update interval is reached.
=== Firefox startup ===
The following needs to happen at Firefox startup time in order for the applied update to be used.
* 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.
=== Replacing the existing installation ======= Windows ====
On Windows, it is not possible to remove or rename files and directories which are being used. In order to handle this, we need to add a little complexity.
* At the end of its run, the helper app relaunches Firefox as a non elevated process from the path name of the existing installation, whatever it was.
==== 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 now empty <code>FIREFOX_NEW</code> directory, write "succeeded" to the manifest file, and restart Firefox.
==== Linux ====
On Linux, we basically move the <code>FIREFOX_NEW</code> over the existing installation directory, write "succeeded" to the manifest file, and restart Firefox.
=== Considered alternatives ===
A number of other approaches have been considered before writing this proposal. One such approach is to make <code>FIREFOX_NEW</code> live inside the existing installation directory. That will cause a lot of pain on Windows where we can't overwrite files that are currently open in another application.
We have also considered keeping two versions of Firefox in versioned side-by-side directory. That will also lead into a number of problems because the directory from which Firefox is going to be launched is going to change over and over again.
== 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 relying on the uninstaller to know about the 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.
56
edits

Navigation menu