Skip to content
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 5 commits into from
Jun 3, 2024

Conversation

RebeccaMahany
Copy link
Contributor

@RebeccaMahany RebeccaMahany commented May 31, 2024

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.

@RebeccaMahany RebeccaMahany marked this pull request as ready for review June 3, 2024 18:45
zackattack01
zackattack01 previously approved these changes Jun 3, 2024
@RebeccaMahany RebeccaMahany added this pull request to the merge queue Jun 3, 2024
Copy link
Contributor

@directionless directionless left a 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?

ee/desktop/user/universallink/handler.m Show resolved Hide resolved
@RebeccaMahany RebeccaMahany removed this pull request from the merge queue due to a manual request Jun 3, 2024
@RebeccaMahany
Copy link
Contributor Author

@directionless Not worried about multiple registrations! If called for the exact same app bundle path, it will just update the existing registration.

@RebeccaMahany RebeccaMahany added this pull request to the merge queue Jun 3, 2024
Merged via the queue into kolide:main with commit ed17220 Jun 3, 2024
29 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/lsregister branch June 3, 2024 20:53
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.

4 participants