-
Notifications
You must be signed in to change notification settings - Fork 29k
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
Custom file association breaks VSCode command line registry entry. #13919
Comments
Damn it, nice catch @milkergy! |
I verified that for an unknown file extension I can associate VS Code from the "Open With" dialog and that it opens the file with VS Code. I did not follow the exact steps in the description because I think our users will not go into the windows registry and change something there. |
@bpasero This wasn't about users manually editing the registry. The URL handling feature from Electron broke the registry that our Setup created. The fix was to rename that registry key in our setup. This only reproduces in Stable though, not in Insiders. |
Ah ok, then I did not verify correctly. |
Has this really been fixed? In 1.7.2 in Windows 7, I reset the .txt file association (by removing --open-url in the relevant registry entry), and on double-clicking a .txt file it opens correctly—but only once! Having opened the file, VS Code seems to put the --open-url back into the registry, which prevents the .txt file from being opened the same way again. VS Code should either accept the --open-url parameter, or not write it to the registry. |
Yeah, I can confirm that the behavior stayed the same in the latest release version. |
@joaomoreno Just tried that; no change. Before running VS Code, I set HKEY_CLASSES_ROOT\vscode\shell\open\command to "C:\Program Files (x86)\VS Code\Code.exe" "%1". After running VS Code, VS Code has changed the value to "C:\Program Files (x86)\VS Code\Code.exe" --open-url "%1". |
What's the value of |
There is no HKEY_CLASSES_ROOT\vscodeSourceFile key. There is, however, HKEY_CLASSES_ROOT\vscode\shell\open\command, which is "C:\Program Files (x86)\VS Code\Code.exe" --open-url "%1". I would have thought that the problem is the insertion of --open-url that VS Code can't subsequently understand (on Windows). I note that the VS Code uninstallation does not remove its AppData files; maybe it doesn't clean up the registry either. Ergo, perhaps vestiges of the previous behavior can survive uninstallation. |
@pmcoz 1.7.2 should've inserted that key when updated... I verified that myself. If you reinstall the setup, does it come up? |
I uninstalled, then reinstalled via the setup file. No key. Perhaps the setup is seeing one of the old keys and is then bailing out of updating the registry. I'll try to delete all the old VS Code keys before installing again. |
That's so strange, as I consistently see the keys. This is 1.7.2 right? |
Yes, 1.7.2. I also installed on a second Windows 7 machine, and that key wasn't created. Perhaps HKEY_CLASSES_ROOT\vscodeSourceFile is only created if using one or more of the file association options available in the installer. I deselect all of those since I prefer greater control. I'm reticent to see what happens when they're selected because I'm not confident of being able to roll back. I gather this makes me dependent on HKEY_CLASSES_ROOT\vscode\shell\open\command. I can probably work around this by associating files with a .BAT that calls code.exe. |
Good catch, that's exactly it! I'll push a fix to always add it regardless of that checkbox. 👍 |
Verified that:
Marking verified. |
@joaomoreno Outstanding! I'm very pleased to have been able to help. Thank you for persevering with this issue. :) |
@pmcoz No, thank you for your persistence! 👍 |
Getting this same issue while installing VS code 1.13 and 1.14 on windows 10 HKEY_classes_root\vscode source file\shell\open\command how to resolve this? |
Same here. |
Steps to Reproduce:
registry entry, it should say:
HKEY_CLASSES_ROOT\vscode\shell\open\command
, it now says:--open-url
option does not work on Windows, double-clicking your *.custom files opens VSCode, but the file's not opened.The text was updated successfully, but these errors were encountered: