question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Protocol (scheme) for windows

See original GitHub issue
  • Version: 5.4.2
  • Target: Windows

I’m trying to build my application for OSX and for Windows. Right now my package.json looks like below:

"build": {
    "appId": "",
    "app-category-type": "",
    "dmg": {},
    "win": {
      "iconUrl": ""
    },
    "protocols": [
      {
        "name": "App name",
        "schemes": ["myapp"]
      }
    ]
  }

So everything working for OSX and I can open application using myapp:// scheme. How can I make the same for Windows?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
ghostcommented, Aug 29, 2016

I figured out my problem. I didn’t set the installer to perMachine: true, so it was installing for a single user, and apparently the registry keys don’t work in that case.

3reactions
hacdiascommented, Jan 29, 2019

@develar this is quite easy to implement via the NSIS script. I’m using the following macro to make it work:

!macro AddProtocolHandler Protocol Description
  DeleteRegKey SHELL_CONTEXT "Software\Classes\${Protocol}"
  WriteRegStr SHELL_CONTEXT "Software\Classes\${Protocol}" "" "${Description}"
  WriteRegStr SHELL_CONTEXT "Software\Classes\${Protocol}" "URL Protocol" ""
  WriteRegStr SHELL_CONTEXT "Software\Classes\${Protocol}\DefaultIcon" "" "$appExe,0"
  WriteRegStr SHELL_CONTEXT "Software\Classes\${Protocol}\shell" "" ""
  WriteRegStr SHELL_CONTEXT "Software\Classes\${Protocol}\shell\open" "" ""
  WriteRegStr SHELL_CONTEXT "Software\Classes\${Protocol}\shell\open\command" "" "$appExe %1"
!macroend

And then I just call it for each protocol. It could be done here for the protocols defined in the Build configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing and Registering Protocol Handlers (Windows Search)
Installing a protocol handler involves copying the DLL(s) to an appropriate location in the Program Files directory, and then registering ...
Read more >
Getting started with Protocol Handlers for your web app
Additionally, you can create custom schemes that your web app can handle by registering protocols that are prefixed with web+ . This is...
Read more >
Abusing the MS Office protocol scheme - SySS Tech Blog
When installing Microsoft Office under a recent Windows system, some default handlers for protocols are added. This opens some possibilities an attacker can ......
Read more >
List of URI schemes - Wikipedia
Scheme Purpose Status aaa aaas Diameter Protocol Permanent acap Application Configuration Access Protocol Permanent acct Identifying user account Permanent
Read more >
New Microsoft Office Attack Vector via "ms-msdt" Protocol ...
New Microsoft Office Attack Vector via "ms-msdt" Protocol Scheme (CVE-2022-30190), Author: Xavier Mertens.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found