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

Need to document how app.setAsDefaultProtocolClient works in "windowsStore" environment #16852

Closed
ZudoMC opened this Issue Feb 8, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@ZudoMC
Copy link

ZudoMC commented Feb 8, 2019

  • Electron Version (output of node_modules/.bin/electron --version):
    • v4.0.4
  • Operating System (Platform and Version):
    • Windows 10 1809
  • Last known working Electron version (if applicable):
    • Not applicable

Expected Behavior

app.setAsDefaultProtocolClient("practically-anything") should register a protocol handler, or fail and return false.

Actual behavior

app.setAsDefaultProtocolClient("practically-anything") returns true but no protocol handler is registered.

To Reproduce

This is a tricky one to reproduce, the bare minimum would be:

import {app} from "electron";

app.on("ready", () => {
   app.setAsDefaultProtocolClient("practically-anything");
});

and packaged as an appx with electron-builder or with this guide.

Additional Information

Not sure if this is an Electron "bug" or just a specific case for appx distribution. Either way I'd love to hear from someone who knows more about this than me.

@welcome

This comment has been minimized.

Copy link

welcome bot commented Feb 8, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@MarshallOfSound

This comment has been minimized.

Copy link
Member

MarshallOfSound commented Feb 8, 2019

@ZudoMC My understanding is this is working as intended and probably something we just need to document. When installed as an appx your app gets fake versions of a few things including some parts of the registry. So when we write your protocol handler to the registry it does succeed, just it writes it to a fake registry that windows gave your app and your app alone.

In order to register URI handlers in an appx you need to do it in the manifest at install time --> https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol

@MarshallOfSound MarshallOfSound changed the title app.setAsDefaultProtocolClient fails silently when installed from appx Need to document how app.setAsDefaultProtocolClient works in "windowsStore" environment Feb 8, 2019

@ZudoMC

This comment has been minimized.

Copy link
Author

ZudoMC commented Feb 8, 2019

Makes sense, thanks 👍

MarshallOfSound added a commit that referenced this issue Feb 11, 2019

MarshallOfSound added a commit that referenced this issue Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment