kolide / launcher

Osquery launcher, autoupdater, and packager
https://kolide.com/launcher
Other
501 stars 99 forks source link

Register the desktop app path with launch services #1731

Closed RebeccaMahany closed 4 weeks ago

RebeccaMahany commented 1 month ago

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:

This relates to previous universal link support work: https://github.com/kolide/launcher/pull/1727.

RebeccaMahany commented 4 weeks ago

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