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

Open
pullup opened this issue Nov 26, 2019 · 7 comments
Open

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

pullup opened this issue Nov 26, 2019 · 7 comments
Labels

Comments

@pullup
Copy link

@pullup 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

@glassez

This comment has been minimized.

Copy link
Member

@glassez 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

This comment has been minimized.

Copy link
Contributor

@sledgehammer999 sledgehammer999 commented Nov 27, 2019

@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

This comment has been minimized.

Copy link
Member

@glassez 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

This comment has been minimized.

Copy link
Contributor

@sledgehammer999 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

This comment has been minimized.

Copy link
Member

@glassez 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

This comment has been minimized.

Copy link
Member

@glassez glassez commented Nov 29, 2019

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

@pullup

This comment has been minimized.

Copy link
Author

@pullup 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.