Skip to content
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

Not able to re-associate with magnet links on windows 10 latest version. #11524

Closed
pullup opened this issue Nov 26, 2019 · 12 comments
Closed

Not able to re-associate with magnet links on windows 10 latest version. #11524

pullup opened this issue Nov 26, 2019 · 12 comments
Labels
OS: Windows Issues specific to Windows

Comments

@pullup
Copy link

pullup commented Nov 26, 2019

Please provide the following information

qBittorrent version and Operating System

v4.1.9.1 / Windows 10

If on linux, libtorrent-rasterbar and Qt version

(type here)

What is the problem

Not able to re-associate with magnet links after trying to use instant.io for a web torrent, checking the associate with magnet links box and applying doesn't change and windows doesn't seem to think qbit is capable of handling magnet urls (thanks windows)

What is the expected behavior

Being able to associate qbit with magnet links

Steps to reproduce

Have qbit as default for magnet links, try to use instant.io for web torrenting then try to switch back to using qbit for magnet links.

Extra info(if any)

Here you can see windows not recognizing that qbit is used for torrenting (amazing job windows)
qbit not show

@thalieht thalieht added the OS: Windows Issues specific to Windows label Nov 26, 2019
@glassez
Copy link
Member

glassez commented Nov 26, 2019

Congratulations! Here we began to stumble about the fact that we still use this "relic" way (from Windows XP epoch) of file associations...
@sledgehammer999, @Chocobo1, ping.

@sledgehammer999
Copy link
Member

@glassez isn't that still supported though by Win 10? In any case, since we drop windows XP with 4.2.0 we can look into changing this. What are the new APIs involved?

@glassez
Copy link
Member

glassez commented Nov 28, 2019

isn't that still supported though by Win 10?

Seems new way is preferably so you can't redefine default applications using the old one.

What are the new APIs involved?

Default Programs
https://docs.microsoft.com/ru-ru/windows/win32/shell/default-programs

I twice opened PRs implementing its support, but they died of old age, never being properly reviewed and approved. So if you still decide to evolve qBittorrent a bit, I can share my experience with anyone who wants to finish it.

@sledgehammer999
Copy link
Member

sledgehammer999 commented Nov 28, 2019

https://docs.microsoft.com/ru-ru/windows/win32/shell/default-programs

The registry modifications aren't that bad. We already do something really close to that.
The caveat is how you actually make qbittorrent the default handler. As far as I can understand we can't have the 2 checkboxes in the preferences (file association). We are supposed to call a Windows API that makes Windows itself present a dialog to the user. That dialog allows the user to make appropriate file/uri associations for qbittorrent. But then there is another caveat, that API works until Windows 10. In Windows 10 a program simply can't make itself the default handler(if there are multiple choices of handlers). The user has to go by himself in the Control Panel and make the associations.

@glassez Am I reading this correct?

@pullup If I understand correctly you used instant.io via a web browser. And the web browser prompted you about making instant.io the default handler for magnets (which I assume you accepted). Try to search in your browser's preferences for Applications associations per filetype. And see what it allows for magnet uris. For example, in Firefox this is Found in the General tab of the Options window. Scroll down where it says "Applications".

@glassez
Copy link
Member

glassez commented Nov 29, 2019

The registry modifications aren't that bad. We already do something really close to that. The caveat is how you actually make qbittorrent the default handler.

In my previous work I changed it to be compatible with both old and new methods. Really if you register handlers according to Default Programs specifications you can use them with old method.

As far as I can understand we can't have the 2 checkboxes in the preferences (file association).

Yes.

We are supposed to call a Windows API that makes Windows itself present a dialog to the user. That dialog allows the user to make appropriate file/uri associations for qbittorrent. But then there is another caveat, that API works until Windows 10.

Yes. Moreover, it doesn't show this dialog in Windows 8+ but just message about where you can change default handlers.

In Windows 10 a program simply can't make itself the default handler(if there are multiple choices of handlers). The user has to go by himself in the Control Panel and make the associations.

Additionally Windows 10 shows you an appropriate dialog when you open some file for which handlers have been changed (e.g. the new one is added).

The common thing in all this is that we need to register correct handlers (according to Default Programs specifications).
Then we can perform some possible actions depending on Windows version the qBittorrent running on.

@glassez
Copy link
Member

glassez commented Nov 29, 2019

https://github.com/glassez/qBittorrent/tree/fileassoc2
Theoretically, you should just remove XP/Vista code paths from it...

@pullup
Copy link
Author

pullup commented Dec 2, 2019

https://github.com/glassez/qBittorrent/tree/fileassoc2
Theoretically, you should just remove XP/Vista code paths from it...

Any workaround until this gets fixed?
Re-installing didn't help, and good god I never realized how useful being able to click magnet links was.

@TheManFromDelmote
Copy link

TheManFromDelmote commented Jan 14, 2020

Just finding out after installing a transmission client for elsewhere that my main qb client can't be assigned the magnet link while trans can. Was just about to try reinstalling, but ^
As it did work on its own, there must be a workaround? I may have a look in the reg later see what i can decode

@pullup
Copy link
Author

pullup commented Jan 22, 2020

Just finding out after installing a transmission client for elsewhere that my main qb client can't be assigned the magnet link while trans can. Was just about to try reinstalling, but ^
As it did work on its own, there must be a workaround? I may have a look in the reg later see what i can decode

Still haven't been able to find a workaround, I'm honestly pretty butthurt about it, qbit is my default magnet link handler in reg, but somehow the stupid windows protocol shit overrides it. They could've moved it and left the old one, if they did I haven't found the new location. When I try opening magnet links with firefox it works totally fine btw, too bad I don't use it as my default browser :/

edit- if you find a work around please let me know :3

@LowTea
Copy link

LowTea commented Mar 7, 2021

edit- if you find a work around please let me know :3

I had the same problem and this workaround worked for me :)

@h3xcat
Copy link

h3xcat commented Nov 19, 2021

I'm having this issue for years now. I have never been able to get magnet links to work on Windows 10 and 11 now.

You could try implementing Firefox's approach to set the default app by generating the UserChoice key in the registry. Their source code is easy to read and documented well with references.

https://searchfox.org/mozilla-central/source/toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp
https://searchfox.org/mozilla-central/source/browser/components/shell/WindowsUserChoice.cpp

@xavier2k6
Copy link
Member

PR #19446 should address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Windows Issues specific to Windows
Projects
None yet
Development

No branches or pull requests

8 participants