Background Updates
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
- Being able to apply a newer update if Firefox was not restarted since the previous update was applied in the background
- Try to do as little as possible at startup
- 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
- Eliminating the UI we display in Step 2
- Changing how updates work on Android
- Any of the other projects falling under the "silent update" umbrella
Implementation
Here is a proposal for how background updates will be implemented.
- The process will start by Firefox checking for an update in the background (as it does today).
- Once an update is found
- If the user needs to prompted for some reason, we show that prompt. If the user declines, we bail out.
- Otherwise, we go ahead and download the update (as a complete/partial MAR file) in the background.
- Once the download is finished, Firefox launches the updater binary in the background with the UI display disabled.
- The target of the update will be known
FIREFOX_NEWfrom now on.- On Windows, if Firefox is installed to "C:\path\to\Mozilla Firefox",
FIREFOX_NEWwill be "C:\path\to\Mozilla Firefox.new". - On Mac, if Firefox is installed to "/path/to/Firefox.app",
FIREFOX_NEWwill 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",
FIREFOX_NEWwill be "/path/to/firefox.new". If it's installed in a non-flat directory structure (like /usr/bin for example), the details of whereFIREFOX_NEWwill be is TBD.
- On Windows, if Firefox is installed to "C:\path\to\Mozilla Firefox",
- The manifest file will be known as a file named "update.pending" located in the root of the existing Firefox installation.
- The target of the update will be known
- The updater binary checks to see if there is an existing manifest file.
- If this file exists, it will be removed.
- The updater binary checks to see if there is an existing
FIREFOX_NEWdirectory.- If this directory exists, it will be removed.
- The updater binary will go ahead and apply the update to the
FIREFOX_NEWdirectory using the existing installation directory as the base. - The updater binary will write a new manifest file to the existing installation's directory.