Windows Custom URL Protocol Support#480
Conversation
contains customUrlProtocols. Added registry function to register custom url protocols. Added call to write register protocols in install file.
|
This is awesome, thanks for your hard work on this! It might be good to support file associations as well using the same approach (since the process should be the same), and finally the VelopackApp constructs should make it easy to provide a callback to handle these associations too. If you don't have time to continue I'm happy to pick up from here. We'll also need to add in the MacOS support (but not Linux for now) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #480 +/- ##
===========================================
+ Coverage 35.50% 38.34% +2.84%
===========================================
Files 100 52 -48
Lines 8957 6181 -2776
Branches 528 0 -528
===========================================
- Hits 3180 2370 -810
+ Misses 5647 3811 -1836
+ Partials 130 0 -130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
We may need to do a bit more here to do things properly on windows: https://learn.microsoft.com/en-us/windows/win32/shell/default-programs#registering-an-application-for-use-with-default-programs |
No problem! It was interesting (: - sorry for the MIA, been a bit busy but should have a bit of free time this weekend I can take a look at the file associations too, not sure about getting MacOS support though... I can do some research into this but if you have any ref links/pointers for what's needed then that would help
that's a good find 🤔 I'm assuming we could just put this under HKCU rather than HKLM.. otherwise we deal with needing admin privileges |
|
Yes can register everything in hkcu, have a look at the osu implementation linked from the original issue also as they've done it the correct way. |
|
I think I understand what's needed for file associations, based on the doc linked in the osu implementation, will take a bit of time slowly chipping away at it The doc says that the whole page doesn't apply for Windows 10 though so I wonder if it's actually needed? https://blogs.windows.com/windows-insider/2015/05/20/announcing-windows-10-insider-preview-build-10122-for-pcs/ Makes me think that it's actually much simpler for Windows 10 onwards, just a single location for each file type 🤔 |
Added ability to specify custom URL protocols for Windows application, I don't know Linux/MacOS so wasn't sure what needed to be done there... I may take a look at it and see though.
This allows you to add multiple custom URL protocols and if you create a new version with a different set of protocols, it will remove the old ones and add the new ones.
The new pack command option is set at the shared level and removed from Linux & OSx, not sure if this makes sense since I'm not familiar with the code base.
I also modified the
PackBuildsPackageWhichIsInstallabletest and added a new test specifically for this (basically copied from the shortcuts one).Let me know what you think!