index.rst (3296B)
1 ============================= 2 Installation Directory Layout 3 ============================= 4 5 Rationale 6 =================== 7 8 Firefox supports automatic downloading and applying of updates while the user is still using 9 the browser. However, once the update has been installed, files that the browser relies on 10 may have changed on disk, which caused the original implementation of update functionality to 11 force the user to restart the browser after updates. (See 12 _this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1891600 for details and discussion.) 13 14 15 In order to let users continue to use the browser after updates are applied, the updater needs 16 to leave in place the files associated with the running browser, for as long as the browser's process 17 exists. 18 19 The approach we are taking to enable this behavior is a new installation layout called "versioned install directories". 20 What this involves is: 21 22 - Under the "base" install directory, there will be one or more "versioned" install directories, 23 with names based on the version of Firefox installed in them. 24 - Each versioned directory contains a complete installation of Firefox at the approapriate version. 25 - In the base install directory, there will be a launcher exectuable that launches the Firefox 26 executable in the appropriate versioned directory for the current Firefox version, 27 28 Example of "single" layout 29 30 This process allows all of the file resolution in Firefox to remain unchanged (for example, 31 C:\\Program Files\\Mozilla Firefox\\136.0.1a\\firefox.exe will load libraries from the directory 32 C:\\Program Files\\Mozilla Firefox\\136.0.1a\\). Most code will have no need to be aware of the change. 33 34 However, when applying updates to an installation, 35 the updater needs to know if it should: 36 - apply updates to a "single" install directory, and leave a single install directory in place (current behavior) 37 - apply updates to a single install directory, and migrate it to be a versioned install 38 - apply updates to a versioned install directory, using the new versioned install behavior 39 40 This means that the updater needs a way to know unambiguously whether an installation 41 is using a single or versioned layout. This is the functionality provided by this module. 42 43 Module contents 44 =============== 45 46 The installation_dir_layout module provides two different implementations of a library `installation_dir_layout.dll` 47 48 This library has a single function, `GetInstallationDirLayoutType`, which returns an enumerated type. 49 50 The implementation of `installation_dir_layout.dll` in the `single` directory returns `InstallationDirLayoutType::Single` 51 The implementation of `installation_dir_layout.dll` in the `versioned` directory returns `InstallationDirLayoutType::Versioned` 52 53 The interface for both implementations is specified in InstallationDirLayout.h 54 55 DLL installation 56 ================ 57 58 When Firefox is installed or updated, the installer or updater will choose the appropriate version of `installation_dir_layout.dll` 59 to install. This version will be available to firefox.exe and its supporting utilities as a runtime library. 60 61 DLL usage 62 ========= 63 64 Code that needs to know about the installation directory layout (such as updater and uninstaller) will load the installed 65 version of the DLL and call `GetInstallationDirLayoutType`.