How to register a global protocol handler for electron app?

83 views Asked by At

I have an electron app built with electron-builder where I set a custom protocol handler

 protocols: [
          {
            name: 'My App',
            role: 'Viewer',
            schemes: ['my-app']
          }
        ],

The app is installed globally for all users. When I try to open the app through a link my-app://something it does not work. I have to manually open the electron app first, after that the link works. This is a problem because I can have multiple windows accounts and manually starting my app for each one so that the link works is not a solution. I also tried registering a global protocol handler in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myapp but it does not work. Any ideas?

0

There are 0 answers