Skip to content

feat: add support for URI activations for coder scheme #72

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

spikecurtis
Copy link
Collaborator

@spikecurtis spikecurtis commented Apr 22, 2025

relates to #52

Adds support for Coder Desktop to handle the coder:/ URI scheme by registering for this scheme and forwarding activations to the single instance of Coder Desktop.

Also removes the Package.appxmanifest. It is unused since Coder Desktop is not a packaged app.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@spikecurtis spikecurtis marked this pull request as ready for review April 22, 2025 05:27
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment on lines +38 to +45
// Register for URI handling (known as "protocol activation")
#if DEBUG
const string scheme = "coder-debug";
#else
const string scheme = "coder";
#endif
var thisBin = Assembly.GetExecutingAssembly().Location;
ActivationRegistrationManager.RegisterForProtocolActivation(scheme, thisBin + ",1", "Coder Desktop", "");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it typical for apps to register themselves? Or is it more common for it to be registered in the installer (not sure if this is even an option)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installer could do it, but I'm not sure it provides any advantage.

One advantage of the App registering itself is that you don't need to install to debug, which is nice.

We might want to cosider unregistering in the uninstaller, which I can look into in another PR.

@spikecurtis spikecurtis merged commit bd221c4 into main Apr 22, 2025
4 checks passed
@spikecurtis spikecurtis deleted the spike/uri-activations branch April 22, 2025 17:31
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