views:

38

answers:

2

Hi,

I would like to be able to change the OSX services that my application provides based on the current user's preferences (like adding more, changing the name,...). This basically means modifying the Info.plist (NSService key), but I don't think it is a good practice when an application modifies its own Info.plist while running, right? (At least based on few searches here). Is there any other option how to get this functionality?

I guess it should always be an external entity who does modify the Info.plist? So far I can only think about providing a system preference bundle which will do the modification in the actual app? Do you have any ideas?

Thank you

A: 

why not just handle this in your application's preference pane?

kent
well but that would mean that the application would have to modify its own Info.plist which is probably a bad idea.
fikovnik
A: 

One way would be to install a service in ~/Library/Services that provides the services, and edit that application's Info.plist from your main application.

Of course, that should be an explicit action, so the user (hopefully) knows to delete the service if they delete your application. And you should document that procedure on your product's support web page, just in case they don't.

Peter Hosey
To me, this looks like additional complexity (probably necessary) as the service bundle will then just called the application itself - so acting like a broker. Normally it would not be that bad, but as there is now way (or at least I don't know about) how to tightly couple them together for the uninstall process, it's quite a price to pay.In the end I guess I will have to give up on services :(
fikovnik
Or, at least, on configuring them dynamically.
Peter Hosey