Confirmed users
1,041
edits
m (→Windows) |
|||
| Line 21: | Line 21: | ||
Here is a proposal for how background updates will be implemented. | Here is a proposal for how background updates will be implemented. | ||
* The process will start by Firefox checking for an update in the background | * The process will start by Firefox checking for an update in the foreground or background. | ||
* Once an update is found | * Once an update is found | ||
** If the user needs to prompted for some reason, we show that prompt at the normal time. (e.g, | ** If the user needs to prompted for some reason, we show that prompt at the normal time. (e.g, on idle). If the user declines, we bail out. | ||
** Otherwise, we go ahead and download the update (as a complete/partial MAR file) | ** Otherwise, we go ahead and download the update (as a complete/partial MAR file). | ||
* Once the download is finished, Firefox launches the updater binary in the background with the UI display disabled. Searching for new updates will be paused during this time. | * Once the download is finished, Firefox launches the updater binary in the background with the UI display disabled. Searching for new updates will be paused during this time. | ||
** The target of the update will be known <code>FIREFOX_NEW</code> from now on. | ** The target of the update will be known <code>FIREFOX_NEW</code> from now on. | ||
*** On Windows, if Firefox is installed to "C:\path\to\Mozilla Firefox", <code>FIREFOX_NEW</code> will be "C:\path\to\Mozilla Firefox\updated". | *** On Windows, if Firefox is installed to "C:\path\to\Mozilla Firefox", <code>FIREFOX_NEW</code> will be "C:\path\to\Mozilla Firefox\updated". :[[User:Robert Strong|Robert Strong]] 02:16, 18 October 2011 (PDT) I suspect the rename operation will be faster if the old is renamed to <code>FIREFOX_OLD</code>, the new is renamed to <code>FIREFOX_NEW</code>, and <code>FIREFOX_OLD</code> is then deleted while Firefox is starting. | ||
*** 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 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. | *** 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 "update.pending" located in the root of the existing Firefox installation. | ** The manifest file will be known as an empty file named "update.pending" located in the root of the existing Firefox installation. | ||
* The updater binary checks to see if there is an existing manifest file. | * 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, it will be removed. | ** If this file exists, it will be removed. | ||
* The updater binary checks to see if there is an existing <code>FIREFOX_NEW</code> directory. | * The updater binary checks to see if there is an existing <code>FIREFOX_NEW</code> directory. | ||
** If this directory exists, it will be removed. | ** 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. | * 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 manifest file to the existing installation directory. | * The updater binary will write a new manifest file to the existing installation directory. | ||
* The updater binary will shutdown, and signal the Firefox main process. | * The updater binary will shutdown, and signal the Firefox main process. | ||
* The Firefox main process will | * The Firefox main process will search for new updates when the next update interval is reached. | ||
== Firefox startup == | == Firefox startup == | ||