Bug 1892061 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This bug tracks adding 2+ data fields to MARs that we ship. As described in the [MAR documentation](https://wiki.mozilla.org/Software_Update:MAR), the MAR format was designed to be able to accommodate additional data sections.

Addition 1: Versioned Installation Directory boolean flag
--------------------------------------------------------------
In order for the updater to know when to migrate an installation to use versioned install directories, the migration code needs to be present and then an update needs to be downloaded that is configured to use versioned installation directories. Then the updater can perform the migration and install the new version that supports it at the same time. This all hinges, however, on the updater being able to tell whether the update it will install uses versioned installation directories or not. This flag will allow us to do that by simply propagating the value of the build flag (Bug 1891616).

Addition 2: "Update From" version
--------------------------------------

Once we start using versioned installation directories, we will suddenly need to know what version we are updating from in order to make sure that we don't apply a partial MAR to the wrong version or apply a complete MAR such that a watershed is skipped over. I would like to have this information embedded into the MAR. It would make me uncomfortable to have this information be conveyed via some un-signed mechanism, because I don't really want us looking in semi-arbitrary (potentially attacker-controlled) directories and then blindly applying updates to them.

I think that doing this for the partial MARs should be pretty reasonable. I haven't looked into the code yet, but I believe that it will probably be as simple as reaching into the `application.ini` of the copy of Firefox we are generating the partial from, finding the `BuildID` field, and adding that to the MAR.

I'm not actually fully sure how to do this for the complete MARs yet. We still need to figure out this detail. We want the MAR to contain the build id of the last watershed, but it's not clear to me how to get access to that information in that context. I also need to verify my assumption here that it is reasonable to apply a complete MAR to an arbitrary version after the last watershed.

Ideally, fixing this should also fix Bug 1875183.

---

In addition to adding these fields to MARs, this bug encompasses adding the functionality to the updater to read these fields. I don't think there is any reason that we couldn't ship the "update from version" feature immediately, so we should probably do that. Reading the Versioned Installation Directory boolean flag will probably be gated behind the build flag (Bug 1891616).

---

We don't change the MAR format often. We might want to consider making multiple changes as long as we are doing it.
I have this vague memory that nalexander had another MAR format change in mind that we might want to consider. Unfortunately I no longer seem to remember what it was.
@nalexander Do you remember what I'm thinking about here?
This bug tracks adding a data field to MARs that we ship. As described in the [MAR documentation](https://wiki.mozilla.org/Software_Update:MAR), the MAR format was designed to be able to accommodate additional data sections.

In order for the updater to know when to migrate an installation to use versioned install directories, the migration code needs to be present and then an update needs to be downloaded that is configured to use versioned installation directories. Then the updater can perform the migration and install the new version that supports it at the same time. This all hinges, however, on the updater being able to tell whether the update it will install uses versioned installation directories or not. This flag will allow us to do that by simply propagating the value of the build flag (Bug 1891616).

In addition to adding this fields to MARs, this bug encompasses adding the functionality to the updater to read these fields (gated behind the build flag - see Bug 1891616).

---

We don't change the MAR format often. We might want to consider making multiple changes as long as we are doing it.

It might be nice to fix Bug 1875183 while we are here.

I have this vague memory that nalexander had another MAR format change in mind that we might want to consider. Unfortunately I no longer seem to remember what it was.
@nalexander Do you remember what I'm thinking about here?

Back to Bug 1892061 Comment 0