On Mar 21, 2013, at 9:39 AM, Jerry Krinock wrote:

> To the original question, I don't think there's an easy way to do this.  I 
> don't think Launch Services remembers any more than the most 
> recently-recognized version.

There's one Launch Services function which returns paths for all copies of all 
applications which meet a certain criterion: LSCopyApplicationURLsForURL().  
You can "mark" your applications by having them claim some bizarre fake URL 
scheme, such as "com-yourcompany-yourapp-bogus-url-scheme".  Then, you can use 
LSCopyApplicationURLsForURL() to search for all applications which can handle 
the URL "com-yourcompany-yourapp-bogus-url-scheme:junk".

Yes, this is a gross hack.  Yes, it can only be used in situations where you've 
planned for it in advance – you have to have marked your apps.  If you're 
adding a feature to a new version of your app that relies on this, then the old 
versions won't have been marked.

But it's the only public API that can do this.  Launch Services definitely 
remembers more than the most recently recognized version, as you can see by 
running:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
 -dump

Cheers,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to