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.

Github Desktop mess with x-github-desktop protocol

See original GitHub issue

Description

Cloning process with ‘Open In Desktop’ from browser is not starting.

Version

  • GitHub Desktop: 1.4.1
  • Operating system: Windows 7 x64

Steps to Reproduce

Launch ‘Open In Desktop’ for any repo GitHub Desktop shows up Nothing happens

Expected Behavior

Cloning process

Actual Behavior

Nothing happens

Additional Information

I’m reopening the issue since #5324 was closed and there is definitely something wrong with URI for x-github-desktop protocol.

Since electron protocol CVE was discovered and fixed with: https://github.com/desktop/desktop/blob/7e9f40403be55d89b18a430f5bd3407eeafc8b54/app/src/main-process/main.ts#L139-L151 GitHub desktop requires arguments to be passed as "GitHubDesktop.exe" --protocol-launcher -- "x-github-client://openRepo/https://github.com/blablablalala"

To enforce that behaviour in Windows there is a documented way. Summary of it will be following:

For example, to associate alert: protocol to alert.exe, create following registry keys:

HKEY_CLASSES_ROOT
   alert
      (Default) = "URL:Alert Protocol"
      URL Protocol = ""
      DefaultIcon
         (Default) = "alert.exe,1"
      shell
         open
            command
               (Default) = "C:\Program Files\Alert\alert.exe" "%1"

For security reasons with electron protocol the command string should be (Default) = "C:\Program Files\Alert\alert.exe" --protocol-launcher -- "%1"

So I assume there should be the same registry key in my Windows x64 workstation with additional ‘–protocol-launcher’ and ‘–’ there, like:

HKEY_CLASSES_ROOT
   x-github-client
      (Default) = "URL:x-github-client"
      URL Protocol = ""
      DefaultIcon
         (Default) = "GitHubDesktop.exe,1"
      shell
         open
            command
               (Default) = "C:\Users\User\AppData\Local\GitHubDesktop\GitHubDesktop.exe" --protocol-launcher -- "%1"

But there is not! Instead what I have is following:

  • HKEY_CLASSES_ROOT\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_CLASSES_ROOT\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_CURRENT_USER\Software\Classes\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_CURRENT_USER\Software\Classes\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_LOCAL_MACHINE\SOFTWARE\Classes\x-github-client that is empty
  • HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000\Software\Classes\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000\Software\Classes\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000_Classes\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
  • HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000_Classes\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”

The reasons GitHub desktop is not working:

  1. Is not Firefox or any other browser handling of x-github-client protocol.
  2. There is definitely missed second argument ‘–’. It’s the main reason.
  3. There is hell more registry keys then it should be.
  4. That keys are refreshed at every launch of GitHub Desktop so I assume the GH Desktop is rewriting it with the wrong string.
  5. It seems wrong that there are multiple versions of GitHubDesktop.exe and especially that ‘app-1.4.1’ version is used instead of ‘GitHubDesktop.exe’ in root folder ‘…\AppData\Local\GitHubDesktop\…’

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
oktonioncommented, Oct 8, 2018

Okay, for future reference: This is some kind of problem in firefox and it’s protocol handling in general. Bug report to follow.

P.S.: From my experience this fix is not going to happen soon because related bug report reported at the end of 2017 is still there with low priority.

2reactions
oktonioncommented, Oct 2, 2018

@iAmWillShepherd Thank you for detailed answer and for your time. If it is the case that now reinstall of GitHub Desktop will solve the problem for firefox in Windows 7 I will definitely do it. That’s unfortunate that such a simple solution took so complicated discussion. I will try it tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GithHub Desktop unable to load enterprise repository #14387
The problem I login with both my personal and enterprise account for my GitHub Desktop on Winddows 10. I am not able to...
Read more >
Github Desktop won't re-open · Issue #14732
The problem Just installed Desktop on several of my Windows 10 machines today. It seems Desktop is not closing properly.
Read more >
Open in Desktop launches GitHub Desktop but doesn't start ...
Using Firefox, I've tried multiple times to use the "Open in Desktop" option when trying to clone a repository. At first, GitHub Desktop...
Read more >
GitHub desktop keeps automatically pulling remote repositories?
It's even worse because the remote changes appear as uncommitted, so now there's a mess of my local (actual) uncommitted changes and some ......
Read more >
This noob screwed up using GitHub Desktop... how to correct ...
So now my project is a mess and I have no idea how to sort this out. I've read that there is a...
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