Open Bug 1891600 Opened 2 years ago Updated 7 months ago

[meta] Use Versioned Installation Directories

Categories

(Toolkit :: Application Update, task, P3)

Unspecified
Windows
task

Tracking

()

People

(Reporter: bytesized, Unassigned)

References

(Depends on 13 open bugs, Blocks 4 open bugs)

Details

(Keywords: meta, Whiteboard: [fidedi-dup-update])

The problem at hand is described in detail in Bug 1480452 but can be summarized like this: we shouldn't show a 'Restart Required' page when one Firefox instance updates while another is running. The issue is highly OS-specific and this bug only covers addressing the issue on Windows. A decision brief explaining the proposed solution is located here. The decision brief is currently only accessible to Mozilla employees, but others will be able to examine the approach being planned via the descriptions of the bugs dependent on this one.

The gist of the approach is that the installation directory will go from looking something like this:

Mozilla Firefox/
    firefox.exe                 Browser Binary
    omni.ja
    xul.dll
    ...                         Other browser libraries and resources

to looking something like this:

Mozilla Firefox/
    firefox.exe                 Version Selector/Firefox Launcher
    125.0/
        firefox.exe             Browser Binary
        omni.ja
        xul.dll
        ...                     Other browser libraries and resources
    125.0.1/
        firefox.exe             Browser Binary
        omni.ja
        xul.dll
        ...                     Other browser libraries and resources

This way, when the updater runs while Firefox is running, it can leave the still in-use version of Firefox's installation directory alone and simply install the update into a different directory. The only common file that it will touch is the version selector, which Firefox will not need to continue running. When the updater runs, it will also check for unused installation directories and remove them.

The version selector will be extraordinarily simple; it will simply execute the newest installed copy of Firefox, handing off all of its arguments and exiting. It will be located at the precise path that the browser binary used to be located at in order to avoid breaking any existing links, scripts, etc. It will respect the --wait-for-browser switch and will not immediately exit in that case.

Depends on: 1891616
Depends on: 1891618
Depends on: 1891620
Depends on: 1891622
Depends on: 1891623
Depends on: 1891801
Depends on: 1891848
Depends on: 1891850
Depends on: 1891851
Depends on: 1891855
Depends on: 1891874
Depends on: 1892061
Depends on: 1892064
Depends on: 1892076
Depends on: 1892291
Depends on: 1905795

One of the biggest questions left has been around how to do a slow rollout. Since the current design for the migration involves using a build flag, it seemed like a slow rollout would involve duplicating every production Windows build during the rollout (building once with the versioned installation feature on and once with it off). Which is probably possible but not very appealing. We've come up with a plan that should allow us to do a slow rollout without so much overhead.

With this approach, we will build and ship the same number of update MARs that we do now since the updater will use the same MAR for updates of versioned and unversioned installations.

  1. Have a MAR directive that allows us to specify different versions of a file depending on whether we are using VID. See Bug 1892061 Comment 1 for details.
  2. Build two (individually signed) versions of the same DLL that basically just contain something like MOZ_USING_VERSIONED_INSTALL_DIR. One version sets it to true, one sets it to false. Ship both in the update MAR.
  3. Firefox and the updater load the this DLL to determine whether the installation is currently using the VID feature or not.
  4. When Balrog returns the update XML for this update, it may specify that we should transition to using VID. This value is propagated into a file in the patch directory that can be read by the updater.
  5. When the updater sees that it has the MOZ_USING_VERSIONED_INSTALL_DIR = false but that it has been signaled to start using VID, it does the migration and switches which DLL is written into the installation directory.
See Also: → 1925144
Whiteboard: [fidedi-ope] → [fidedi-dup-update]
Depends on: 1930696
Blocks: 1941788
You need to log in before you can comment on or make changes to this bug.