Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailto integration on Windows: "send to" for global install doesn't work after the local install #3787

Closed
charlag opened this issue Jan 13, 2022 · 3 comments
Labels
desktop Desktop client related issues dev bug unpublished bugs, found during our development/test cycle (excluded from release notes) state:not-testable "tested" for blind fixes or old code removal with no expected regressions
Milestone

Comments

@charlag
Copy link
Contributor

charlag commented Jan 13, 2022

See #3574
See #3752

This time I logged in as non-admin user, installed the app globally and tried to set mailto handler. The app elevated (as expected) but doesn't how up as an option in Windows settings.

@charlag charlag added dev bug unpublished bugs, found during our development/test cycle (excluded from release notes) desktop Desktop client related issues labels Jan 13, 2022
@charlag
Copy link
Contributor Author

charlag commented Jan 13, 2022

Also global install didn't work on Win 11 with admin user but works with local install.

@charlag charlag added this to the 3.91.1 milestone Jan 14, 2022
@charlag
Copy link
Contributor Author

charlag commented Jan 14, 2022

I played with it a little bit and looked up how Windows find email clients. Here's what I've found:

  • Windows looks for available email clients under \SOFTWARE\Clients\Mail\ registry path. It can be under HKLM (per device) or under HKCU (per user)
  • Windows tracks default mail client under \SOFTWARE\Classes\mailto (again, different root for different purposes)
  • Settings:
    • Windows 10 has "mail client" option
    • Windows 11 has "mailto" handler option
  • If user goes to Tutanota settings and registers as mailto handler we write multiple registry keys:
    • return [
      {
      root: `${r}\\SOFTWARE\\Clients\\Mail`,
      value: client_template,
      },
      {
      root: `${r}\\SOFTWARE\\CLASSES`,
      value: {
      mailto: mailto_template,
      "tutanota.Mailto": mailto_template,
      },
      },
      {
      root: hkcr,
      value: {
      mailto: mailto_template,
      "tutanota.Mailto": mailto_template,
      },
      },
      {
      root: `${r}\\SOFTWARE\\RegisteredApplications`,
      value: {
      tutanota: "SOFTWARE\\\\tutao\\\\tutanota\\\\Capabilities",
      },
      },
      {
      root: `${r}\\SOFTWARE\\Wow6432Node\\RegisteredApplications`,
      value: {
      tutanota: "SOFTWARE\\\\Wow6432Node\\\\tutao\\\\tutanota\\\\Capabilities",
      },
      },
      {
      root: `${r}\\SOFTWARE`,
      value: capabilities_template,
      },
      {
      root: `${r}\\SOFTWARE\\Wow6432Node`,
      value: capabilities_template,
      },
      ]
  • We do not write or clean up these keys on install/uninstall, only through our settings

Knowing all of this, here's the scenario where MAPI breaks (but mailto still magically works). I did this with admin user but I imagine it works the same with any other one:

  1. install client locally. Register as mailto.
  2. uninstall client
  3. install client globally. Register as mailto.
  4. Try to right-click in files -> (show more options) -> send to -> mail recipient
  5. See error message ("There is no email program... Create an association...")
  6. Bonus: cleaning up keys under HKCU makes it work again

My proposal would actually be:

  • Make sure that we always write \SOFTWARE\Clients\Mail\, either during install or during startup. There's no reason to not be listed as available email client
  • Make sure we clean it up during uninstall, for our own sake
  • We can still give user an option to set default email app through our settings, we will just write \SOFTWARE\Classes\mailto

@charlag charlag changed the title Mailto integration on Windows: global installation for non-admin user Mailto integration on Windows: "send to" for global install doesn't work after the local install Jan 14, 2022
@charlag
Copy link
Contributor Author

charlag commented Jan 18, 2022

Merged back into #3574

@charlag charlag closed this as completed Jan 18, 2022
@charlag charlag added the state:not-testable "tested" for blind fixes or old code removal with no expected regressions label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Desktop client related issues dev bug unpublished bugs, found during our development/test cycle (excluded from release notes) state:not-testable "tested" for blind fixes or old code removal with no expected regressions
Projects
None yet
Development

No branches or pull requests

1 participant