[Bug]: qBittorrent does not register magnet links and torrent files
Prerequisites
- [x] I have written a descriptive issue title.
- [x] I have searched all issues/PRs to ensure it has not already been reported or fixed.
- [x] I have verified that I am using the latest version of Scoop and corresponding bucket.
Package Name
qbittorrent
Expected/Current Behaviour
Currently, qBittorrent is not associated with magnet links and torrent files. This results in, for example, magnet links not being recognized by the browser to launch the app. You should, theoretically, be able to set it up manually, e.g. set qBittorrent association for .torrent files in Windows Explorer or similar. We're looking for out-of-the-box solution.
Steps to Reproduce
1. Add extras bucket to scoop. (scoop bucket add extras)
2. Install qBittorrent from extras. (scoop install extras/qbittorrent)
3. Notice that no associations have been made.
4. Open a magnet link in the browser or via command, e.g. start magnet:?xt=urn:btih:TEST
5. No application is there to open magnets.
Possible Solution
Create files: install-associations.reg and uninstall-associations.reg as follows:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\qBittorrent]
"InstallLocation"="$qbit"
; Register qBittorrent as possible default program for .torrent files and magnet links
[HKEY_CURRENT_USER\Software\qBittorrent\Capabilities]
"ApplicationDescription"="A BitTorrent client in Qt"
"ApplicationName"="qBittorrent"
[HKEY_CURRENT_USER\Software\qBittorrent\Capabilities\FileAssociations]
".torrent"="qBittorrent.File.Torrent"
[HKEY_CURRENT_USER\Software\qBittorrent\Capabilities\UrlAssociations]
"magnet"="qBittorrent.Url.Magnet"
[HKEY_CURRENT_USER\Software\RegisteredApplications]
"qBittorrent"="Software\\qBittorrent\\Capabilities"
; Register qBittorrent ProgIDs
[HKEY_CURRENT_USER\Software\Classes\qBittorrent.File.Torrent]
@="Torrent File"
[HKEY_CURRENT_USER\Software\Classes\qBittorrent.File.Torrent\DefaultIcon]
@="\"$qbit\\qbittorrent.exe\",1"
[HKEY_CURRENT_USER\Software\Classes\qBittorrent.File.Torrent\shell\open\command]
@="\"$qbit\\qbittorrent.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\qBittorrent.Url.Magnet]
@="Magnet URI"
[HKEY_CURRENT_USER\Software\Classes\qBittorrent.Url.Magnet\DefaultIcon]
@="\"$qbit\\qbittorrent.exe\",1"
[HKEY_CURRENT_USER\Software\Classes\qBittorrent.Url.Magnet\shell\open\command]
@="\"$qbit\\qbittorrent.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\.torrent]
"Content Type"="application/x-bittorrent"
"PerceivedType"="application"
@="qBittorrent.File.Torrent"
[HKEY_CURRENT_USER\Software\Classes\magnet]
@="URL:Magnet URI"
"Content Type"="application/x-magnet"
"URL Protocol"=""
[HKEY_CURRENT_USER\Software\Classes\magnet\shell\open\command]
@="\"$qbit\\qbittorrent.exe\" \"%1\""
And
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\qBittorrent]
[HKEY_CURRENT_USER\Software\RegisteredApplications]
"qBittorrent"=-
[-HKEY_CURRENT_USER\Software\Classes\qBittorrent.File.Torrent]
[-HKEY_CURRENT_USER\Software\Classes\qBittorrent.Url.Magnet]
[-HKEY_CURRENT_USER\Software\Classes\.torrent]
[-HKEY_CURRENT_USER\Software\Classes\magnet]
; Delete associations that Windows Explorer did on its own.
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.torrent]
I based those files on https://github.com/qbittorrent/qBittorrent/pull/19446#issuecomment-1674389079. Elaborated in PR.
Of course, the files are prepared to be used with a modified manifest, which is in my pull request. Simply replace $qbit with install location, e.g. C:\Users\{USER_NAME}\scoop\apps\qbittorrent\current for now.
Scoop and Buckets Version
PS C:\GitHub\Extras-qBit\scripts\qbittorrent> scoop --version
Current Scoop version:
859d1db5 (HEAD -> master, tag: v0.5.2, origin/master, origin/HEAD) chore(release): Bump to version 0.5.2 (#6080)
'main' bucket:
39a33fd29 (HEAD -> master, origin/master, origin/HEAD) sonar-scanner: Update to version 7.0.1.4817
'extras' bucket:
2873562cd (HEAD -> master, origin/master, origin/HEAD) kate: Update to version 24.12-8917
'nonportable' bucket:
9a38109a (HEAD -> master, origin/master, origin/HEAD) office-365-apps-np: Update to version 0.79.2-24
'java' bucket:
23385ab1 (HEAD -> master, origin/master, origin/HEAD) openjdk-ea: Update to version 24-34-ea
'qbit' bucket:
fcb200bb4 (HEAD -> master, origin/master, origin/HEAD) qbittorrent: Add file associations
Scoop Config
PS C:\GitHub\Extras-qBit\scripts\qbittorrent> scoop config
last_update : 2025-02-03T20:13:09.2865180+01:00
aria2-warning-enabled : False
scoop_repo : https://github.com/ScoopInstaller/Scoop
scoop_branch : master
aria2-enabled : False
PowerShell Version
PS C:\GitHub\Extras-qBit\scripts\qbittorrent> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.26100.2161
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.2161
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Additional Softwares
No response
I tried second .reg, then first, then restarted PC. Does not work, magnet links are still dead.
I tried second .reg, then first, then restarted PC. Does not work, magnet links are still dead.
You shouldn't run the registry files attached to this issue directly, because they contain variables. After installation, you'll see instructions on what commands to run.
Something like this:
PS> scoop install qbittorrent
Installing 'qbittorrent' (5.2.0) [64bit] from 'extras' bucket
qbittorrent_5.2.0_x64_setup.exe (41.2 MB) [===================================================================] 100%
Checking hash of qbittorrent_5.2.0_x64_setup.exe... OK.
Extracting qbittorrent_5.2.0_x64_setup.exe... Done.
Running pre_install script... Done.
Linking D:\Scoop\apps\qbittorrent\current => D:\Scoop\apps\qbittorrent\5.2.0
Creating shim for 'qbittorrent'.
Making D:\Scoop\shims\qbittorrent.exe a GUI binary.
Creating shortcut for qBittorrent (qbittorrent.exe)
Persisting profile
Running post_install script... Done.
'qbittorrent' (5.2.0) was installed successfully!
Notes
-----
For file associations, run:
reg import "D:\Scoop\apps\qbittorrent\current\install-associations.reg"
-----
reg import xxx is the command you need to run.