2

How does GitHub launch its GitHub Desktop application directly from the browser?

It works even when using Google Chrome. I thought that this was impossible outside of Internet Explorer.

cascading-style
  • 247
  • 1
  • 3
  • 12

2 Answers2

2

Lets assume you register a custom protocl following the guide Registering an Application to a URI Scheme

Using a simple reg file that looks like the following you would register a custom protocol named mytest: that starts C:\temp\test.bat when its called.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\mytest]
@="URL:mytest Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\mytest\shell]

[HKEY_CLASSES_ROOT\mytest\shell\open]

[HKEY_CLASSES_ROOT\mytest\shell\open\command]
@="\"C:\\temp\\test.bat\" \"%1\""

Using the following content for test.bat you would get a cmd window that displays the argument and stays open:

echo %1%
pause

This works straight on your cmd, IE and Firefox. Chrome and Opera would give you a warning that you're about to start an application. This information is also available in this question: Custom protocol handler in chrome

If you look further into it you will find that the github application registers a github-windows protocol using that way. So it's likely that there IS a way available to make it work with chrome. Sadly, right now, I can't dig further into it as the Application doesn't want to react on any browser.

Seth
  • 9,393
0

[Program Setup] Add the subkey to your application "SupportedProtocols" HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

Next add a Str Type with the name of each Protocol you want your program to handle, with no values

[Application Setup] Next add/update your application's entry under HKEY_CLASSES_ROOT\Applications\

*If your application needs to save the URL, do the following: Add a Str Type named "SaveURL"

*If your application needs to use the URL, do the following: Add a DWORD Type named "UseURL" Set it's value to 1

The above should enable support for your application