views:

1056

answers:

2

Hi folks,

I would like to associate the last installed version of my Mac OS X application with a certain type of file. A little experimentation shows that the info.plist file seems to be read and interpreted by the operating system when launching the application, not when dragging the application bundle to the disk. Apple's documentation on run-time configuration does not say much on that topic.

Is there any way, using a simple .dmg image as installation medium, to make sure the system associates that particular file type with my newly installed app without having to launch it first?

EIDT: I should clarify that I want this to be done automatically during the installation (I don't want my users to have to do it themselves).

Thanks!

+3  A: 

When a user drags an application into the Applications folder, the system should register it with Launch Services automatically. See Application Registration in the Launch Services Guide.

Tony
Uh, the system does not do that, the application does. How the system is supposed to know which extensions are handled by the application?
Keltia
@Keltia: Tony is right, read the documentation he links to.
Carl Seleborg
@Tony: Thanks Tony, I suspected that was the behavior. My experimentation leads me to believe that it does not always work as expected, but it could simply be me doing something wrong. I'll investigate further based on the documentation you point at.
Carl Seleborg
@Carl: Sometimes the database gets a little confused. I've noticed this particularly after doing many rebuilds of a given application, it can stop registering it correctly. Do a search for "lsregister" for info on forcing a rebuild.
Tony
+1  A: 

You can do that by typing apple-I on the file you want to associate the application with, use the little box called "Open with..." and select your app. You can check the little box below "Change All..." to make the change for all similar files.

Keltia
What I really want is for this to happen during the installation: it's my application that's being installed on the user's computer. Sorry for not being clear on that one.
Carl Seleborg
Then look the URL Tony posted, it has the answer.
Keltia