Closed Bug 1750987 Opened 1 year ago Closed 10 months ago

Installer, post-update, and installer support for Private Browsing enhancements

Categories

(Firefox :: Installer, enhancement, P1)

Desktop
Windows
enhancement

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: bhearsum, Assigned: bhearsum)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidedi-pbm])

Attachments

(1 file, 7 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review

We'll be using the new AUMID and ProgIDs to allow Private Browsing to have it's open shortcuts, Taskbar pins, and have it set as the default browser. Any AUMID or ProgID related set-up (mostly registry entries) will need to additionally create Private Browsing entries.

Notably, we will not be doing any shortcut creation for Private Browsing mode here, as this is an optional feature that users will opt into during onboarding.

Depends on: 1750988
Depends on: 1750991
Depends on: 1751000
Depends on: 1751002
Depends on: 1751010
Depends on: 1751013
Depends on: 1751016
Depends on: 1751038
Status: NEW → ASSIGNED
Blocks: 1750988
No longer depends on: 1750988
Blocks: 1750991
No longer depends on: 1750991
Blocks: 1751000
No longer depends on: 1751000
No longer depends on: 1751002
Blocks: 1751010
No longer depends on: 1751010
No longer depends on: 1751013
No longer depends on: 1751016
No longer depends on: 1751038

I think much of this is largely straightforward, such as calling SetStartMenuInternet a second time to deal with creating Private Browsing registry keys. The interesting parts are:

  • Adding -private-window for launch commands
  • Adding /PrivateMode to the helper, to ensure we can do things such as /SetAsDefaultAppUser for private browsing mode
  • Ensuring Software\Classes\Applications\${FileMainEXE} is only updating once between both invocations

Depends on D136899

In an ideal world, we'd change the WDBA to handle multiple AUMIDs, but this is the more expedient path, and probably cheap enough to be fine.

Depends on D136900

This is really just a giant TODO until I sort out how to accurately find the localized shortcuts.

Depends on D136901

I believe this is largely straightforward -- mostly doing what we currently do a second time for this AUMID. The main thing of note is that the launch commands for protocol & file handlers use -private-window for Private Browsing instead of -url.

Depends on D136902

This still needs a bit of work. It's unclear to me whether we ever should Private Browsing to the taskbar in the installer, and whether or not there's even any value in doing so in post-update (I'm pretty sure we want to when the helper is invoked with /SetAsDefaultAppUser, though).

Depends on D136903

Mostly a duplication of existing code that deals with removing registry entries, etc.

One notable part of this is that it skips the uninstall ping for the new AUMID. I couldn't come up with a compelling reason why we'd want to send it.

Depends on D136904

Attachment #9260642 - Attachment description: WIP: Bug 1750987: Generate a new AUMID for Private Browsing Mode → WIP: Bug 1750987: Generate a new AUMID for Private Browsing Mode. r?nalexander!
Attachment #9260643 - Attachment description: WIP: Bug 1750987: Update SetStartMenuInternet, SetAsDefaultApp{User,Global} to deal with private and non-private AUMIDs → WIP: Bug 1750987: Update SetStartMenuInternet, SetAsDefaultApp{User,Global} to deal with private and non-private AUMIDs r?nalexander!
Attachment #9260644 - Attachment description: WIP: Bug 1750987: Create a WDBA task for Private Browsing AUMID → WIP: Bug 1750987: Create a WDBA task for Private Browsing AUMID r?nalexander!
Attachment #9260645 - Attachment description: WIP: Bug 1750987: Add support for Private Browisng AUMID to {Show,Hide}Shortcuts → WIP: Bug 1750987: Add support for Private Browisng AUMID to {Show,Hide}Shortcuts r?nalexander!
Attachment #9260646 - Attachment description: WIP: Bug 1750987: Add support for Private Browsing AUMID to UpdateProtocolHandlers, FixShellIconHandler, and SetHandlers → WIP: Bug 1750987: Add support for Private Browsing AUMID to UpdateProtocolHandlers, FixShellIconHandler, and SetHandlers r?nalexander!
Attachment #9260647 - Attachment description: WIP: Bug 1750987: Add support for Private Browsing AUMID to MigrateTaskBarShortcut → WIP: Bug 1750987: Add support for Private Browsing AUMID to MigrateTaskBarShortcut r?nalexander!
Attachment #9260648 - Attachment description: WIP: Bug 1750987: Add uninstaller support for Private Browsing AUMID related things → WIP: Bug 1750987: Add uninstaller support for Private Browsing AUMID related things r?nalexander!
Attachment #9260644 - Attachment is obsolete: true

There's a few things we can test here before we do any in-product work. Specifically that:

  • Private and non-private mode can be set set as the default browser
  • Private and non-private mode are both available as File & Protocol handlers (all versions)
  • Private Browsing is available as an option in the "Open With..." context menu for html and other file types

There's a few rough edges here at the moment that I'm still trying to work through -- but most of this works. The things I'm still working through are:

  • Firefox doesn't show up in the Windows 10 "Default Apps" (but it does show up if you drill down to "apps by file type", "apps by protocol", or "defaults by app")
  • Private and non-private mode are showing the same strings and icons in most places on Windows 10, and in a couple of places on Windows 7.
  • Only one Firefox entry is shown in the "Open with..." context menu.

A build with the current code can be found here: https://treeherder.mozilla.org/jobs?repo=try&revision=4ec4feb56c24fb7c82ef39fa125f50c688b9f541&selectedTaskRun=fMhr7G6zR5K5X6xDpUYTyw.0

I got a good handle on these pieces today, and the news does not appear to be great when it comes to the Windows 10 Set Defaults UI.

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

  • Firefox doesn't show up in the Windows 10 "Default Apps" (but it does show up if you drill down to "apps by file type", "apps by protocol", or "defaults by app")

I was able to get both entries to show up in the main "Default Apps" list by adjusting the private mode HKLM\Software\Classes$ProgID\shell\open\command key. By changing that to a unique binary (in this case, I copied firefox.exe to firefox-private.exe and changed the registry), both were shown.

I tried other things to get it show up as well -- such as adjusting other parts of the registry to be distinct (various strings and paths in RegisteredApplications and StartMenuInternet subkeys) -- but none of them had any effect.

  • Private and non-private mode are showing the same strings and icons in most places on Windows 10, and in a couple of places on Windows 7.

This is still an issue though, at least on Windows 10. As best I can tell, both the name and the icon are picked up automatically by looking at the metadata of the file in the aforementioned command. I was able to manipulate the name by using Resource Hacker to adjust it -- but this breaks signatures, so the only way we'd be able to achieve this in proper builds is shipping a second binary with these parts tweaked. I haven't tested adjusting the icon, but it's probably possible (I haven't seen it caching the icon it uses anywhere, so I suspect it just uses the first icon every time).

It's worth noting that none of this stops Firefox (private browsing or otherwise) from becoming the default browser -- it just breaks or makes worse certain parts of the Windows UI for doing so.

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

There's a few things we can test here before we do any in-product work. Specifically that:

  • Private and non-private mode can be set set as the default browser
  1. On Win10&Win11 Private Mode can be set as default through the Windows Settings change by protocol, but on about:preferences the default status is not changed (it shows "Nightly is not your default browser")
  2. On Win7 Private Mode can be set as default through Windows Default Programs. If selecting from about:preferences "Make default", the default Normal browsing is set and it shows "Nightly is your default browser".
  • Private and non-private mode are both available as File & Protocol handlers (all versions)
  1. On Win10&Win11 users can open links, mailto in default Private mode.
  2. On Win7 users can open links, mailto, html, avif files in default Private mode.
  • Private Browsing is available as an option in the "Open With..." context menu for html and other file types
  1. "Open With .." from the context menu has only one FireFox Nightly option and is the normal Browser, not the Private one, on all Win platforms.

There's a few rough edges here at the moment that I'm still trying to work through -- but most of this works. The things I'm still working through are:

  • Firefox doesn't show up in the Windows 10 "Default Apps" (but it does show up if you drill down to "apps by file type", "apps by protocol", or "defaults by app")
  1. Choose default "apps by file type" shows only one Firefox icon and is the normal one, while "apps by protocol" / "defaults by app" have two instances of Firefox.

This is what we managed to verify so far. Could you please take a look at the inline comments and let us know your input? Thank you.

Flags: needinfo?(bhearsum)

Thank you for the testing so far! This matches what I would expect in most cases. There's just one thing I'd like to clarify below:

(In reply to Monica Chiorean from comment #10)

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

There's a few things we can test here before we do any in-product work. Specifically that:

  • Private and non-private mode can be set set as the default browser
  1. On Win10&Win11 Private Mode can be set as default through the Windows Settings change by protocol, but on about:preferences the default status is not changed (it shows "Nightly is not your default browser")

Does the Default Browser status in about:preferences change when you use the "Make Default" button there to set regular Firefox to the default browser? (Like you said it does below for Windows 7.)

  • Private Browsing is available as an option in the "Open With..." context menu for html and other file types
  1. "Open With .." from the context menu has only one FireFox Nightly option and is the normal Browser, not the Private one, on all Win platforms.

I noticed this as well. We may be dropping this requirement, so I'll come back to it after we know what's going on there.

Flags: needinfo?(bhearsum)

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #11)

Thank you for the testing so far! This matches what I would expect in most cases. There's just one thing I'd like to clarify below:

(In reply to Monica Chiorean from comment #10)

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

There's a few things we can test here before we do any in-product work. Specifically that:

  • Private and non-private mode can be set set as the default browser
  1. On Win10&Win11 Private Mode can be set as default through the Windows Settings change by protocol, but on about:preferences the default status is not changed (it shows "Nightly is not your default browser")

Does the Default Browser status in about:preferences change when you use the "Make Default" button there to set regular Firefox to the default browser? (Like you said it does below for Windows 7.)

  • On Win10&Win11 when on about:preferences and pressing ‘Make Default’ button the Windows default settings page is opened. If selecting http, https and html from “Set defaults by app” then FF is set as default in about:preferences (but is FF Normal for html files and FF Private for http and https).
  • On Win7 when on about:preferences and pressing ‘Make Default’ button the default is set for Normal FF. Normal FF can be changed to Private from Windows ->Default programs (files and links are opened with FF Private, depending on the settings made).
  • Private Browsing is available as an option in the "Open With..." context menu for html and other file types
  1. "Open With .." from the context menu has only one FireFox Nightly option and is the normal Browser, not the Private one, on all Win platforms.

I noticed this as well. We may be dropping this requirement, so I'll come back to it after we know what's going on there. - Ok

(In reply to Monica Chiorean from comment #12)

  • On Win10&Win11 when on about:preferences and pressing ‘Make Default’ button the Windows default settings page is opened. If selecting http, https and html from “Set defaults by app” then FF is set as default in about:preferences (but is FF Normal for html files and FF Private for http and https).

Huh, this is very interesting! I will look into it. Thank you!

  • On Win7 when on about:preferences and pressing ‘Make Default’ button the default is set for Normal FF. Normal FF can be changed to Private from Windows ->Default programs (files and links are opened with FF Private, depending on the settings made).
Attachment #9260643 - Attachment is obsolete: true
Attachment #9260645 - Attachment is obsolete: true
Attachment #9260646 - Attachment is obsolete: true
Attachment #9260647 - Attachment is obsolete: true

There was significant scope change to this project. Most notably for this bug, we are no longer going to offer Private Browsing as the default browser. This means that most of the existing stack can go. We will still be supporting Private Browsing taskbar pins which means at the very least, we need support for updating the icons and strings of those shortcuts, and removing them during uninstall.

Attachment #9260642 - Attachment description: WIP: Bug 1750987: Generate a new AUMID for Private Browsing Mode. r?nalexander! → WIP: Bug 1750987: Installer, post-update, and uninstaller support for Private Browsing enhancements.
Attachment #9260648 - Attachment is obsolete: true

Given the new scope for this project, there's a few things to test here:

  • Shortcut names & icons should be updated (when they change) during updates. I'll have to hack something up with a custom MAR to test this, most likely.
  • Shortcuts, taskbar pins, and jumplist entries should be removed during uninstall

We're no longer doing anything in the installer, so there's nothing to test or verify as part of the install process.

Summary: Generate and store an AUMID & ProgIDs for Private Browsing Mode → Installer, post-update, and installer support for Private Browsing enhancements
Attachment #9260642 - Attachment is obsolete: true
Attachment #9265788 - Attachment description: WIP: Bug 1750987: Installer, post-update, and uninstaller support for Private Browsing enhancements. → Bug 1750987: Uninstaller support for Private Browsing enhancements. r?nalexander
No longer blocks: 1751010, 1750988, 1750991, 1751000
Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/93e272387c6a
Uninstaller support for Private Browsing enhancements. r=nalexander,mhowell
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.