Skip to content

Windows Custom URL Protocol Support#480

Open
cyechow wants to merge 4 commits intovelopack:developfrom
cyechow:support-custom-url-protocols
Open

Windows Custom URL Protocol Support#480
cyechow wants to merge 4 commits intovelopack:developfrom
cyechow:support-custom-url-protocols

Conversation

@cyechow
Copy link

@cyechow cyechow commented Jan 24, 2025

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 PackBuildsPackageWhichIsInstallable test and added a new test specifically for this (basically copied from the shortcuts one).

Let me know what you think!

contains customUrlProtocols.
Added registry function to register custom url protocols.
Added call to write register protocols in install file.
@caesay
Copy link
Member

caesay commented Jan 24, 2025

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
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

❌ Patch coverage is 76.08696% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.34%. Comparing base (789913a) to head (69595af).
⚠️ Report is 281 commits behind head on develop.

Files with missing lines Patch % Lines
src/bins/src/windows/registry.rs 77.77% 16 Missing ⚠️
src/bins/src/commands/apply_windows_impl.rs 50.00% 3 Missing ⚠️
src/bins/src/commands/install.rs 75.00% 1 Missing ⚠️
src/bins/src/commands/uninstall.rs 66.66% 1 Missing ⚠️
src/lib-rust/src/bundle.rs 50.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@caesay
Copy link
Member

caesay commented Jan 30, 2025

@cyechow
Copy link
Author

cyechow commented Jan 31, 2025

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)

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

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

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

@caesay
Copy link
Member

caesay commented Jan 31, 2025

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.

@cyechow
Copy link
Author

cyechow commented Feb 7, 2025

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 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants