-
Notifications
You must be signed in to change notification settings - Fork 103
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
Register the desktop app path with launch services #1731
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zackattack01
reviewed
Jun 3, 2024
zackattack01
previously approved these changes
Jun 3, 2024
James-Pickett
approved these changes
Jun 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this more than the exec.
It will cause potentially duplicate registrations. Do you think there's an issue with that?
@directionless Not worried about multiple registrations! If called for the exact same app bundle path, it will just update the existing registration. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ordinarily, it is not required to explicitly register an application with Launch Services -- this is done automatically on system boot, on new user login, and whenever Finder becomes aware of a new application. However, because our application autoupdates itself in a unique way, I think sometimes Launch Services doesn't learn about the new update quickly enough. This PR adds a call to LSRegisterURL to manually perform this registration.
It is acceptable to have multiple app bundle paths registered for the same app in Launch Services. Per the documentation, Launch Services should choose the registered application with the latest version. This is pretty good for our use case, at least for now. However, this doesn't appear to work with development versions the way we expect, and wouldn't necessarily cover the use case where we want to roll back to an earlier version -- so we will probably, at some point, want to unregister older app bundles too.
Useful sections in the Launch Services documentation:
Application Registration
Preferred Application for a URL
This relates to previous universal link support work: #1727.