Lawson English wrote:
> Chris Hanson wrote:
>> On 2006-08-29 02:33:42 -0700, "kunal" <talktokunal@[EMAIL PROTECTED]
> said:
>>
>>> how to find out, whether an application is installed on the MAC or
>>> not....??
>>
>> The only sure way to know is to exhaustively search all mounted
volumes.
>>
>> What is it that you're really trying to accomplish?
>>
>> -- Chris
>>
>
>
> There used to be a registry file of applications under MacOS Classic.
> Are you saying that there isn't one under MacOS X? I can see how generic
> UNIX executables might not be registered, but it seems very lax of Apple
> not to create and continuously update a registry of all .app executables
> in order to assist the Finder with doing its job.
>
> In fact, I'm almost certain there is one. Perhaps there's no API for
> applications programers to use it, but I don't think the Finder could
> display as fast as it does at startup without a cache of this kind of
> info available somewhere...
>
I knew there had to be something. Check out Launch Services. There
should be a way of grabbing the info it maintains:
http://developer.apple.com/do***entation/Carbon/Conceptual/LaunchServicesConcepts/index.html#//apple_ref/doc/uid/TP30000999
Registering Applications
All applications available on the user’s system must be registered to
make them known to Launch Services and copy their do***ent binding and
other information into its database. It isn’t ordinarily necessary to
perform this task explicitly, since a variety of utilities and services
built into the Mac OS X system software take care of it automatically:
A built-in background tool, run whenever the system is booted or a new
user logs in, automatically searches the Applications folders in the
system, network, local, and user domains and registers any new
applications it finds there. (This operation is analogous to “rebuilding
the desktop” in earlier versions of Mac OS.)
The Finder automatically registers all applications as it becomes aware
of them, such as when they are dragged onto the user’s disk or when the
user navigates to a folder containing them.
When the user attempts to open a do***ent for which no preferred
application can be found in the Launch Services database, the Finder
presents a dialog asking the user to select an application with which to
open the do***ent. It then registers that application before launching it.
In spite of these automatic registration utilities, it may sometimes be
necessary to register an application explicitly with Launch Services.
For example, although developers are encouraged to package their
applications so that they can be installed by simply dragging them onto
the user’s disk, some applications may require more elaborate custom
installer software. In such cases, the installer should call the Launch
Services function LSRegisterFSRef (or LSRegisterURL) to register the
application explicitly.


|