 |
 |
Getting a list of installed apps
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Status:
Offline
|
|
I'm in the planning stages of creating a utility kind of like OS 9's multiple user app. I'm a newbie to Cocoa but not to programming. What I need to know, among other things, is how to retrieve a list of applications currently installed. I would also like to be able to list devices such as cd-rw drives and dvd drives. My goals is to be able to have one app (or preference pane) that allows permissions editing for apps and devices.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Apr 2000
Location: San Francisco, CA
Status:
Offline
|
|
Originally posted by rabbittb:
<STRONG>I'm in the planning stages of creating a utility kind of like OS 9's multiple user app. I'm a newbie to Cocoa but not to programming. What I need to know, among other things, is how to retrieve a list of applications currently installed. I would also like to be able to list devices such as cd-rw drives and dvd drives. My goals is to be able to have one app (or preference pane) that allows permissions editing for apps and devices.</STRONG>
I'm a hard core Carbon programmer, so I don't know how to do this explicitely in Cocoa, but you can always call Carbon calls from Cocoa: Use PBCatSearchVol (might be spelled differently, this is off the top of my head) and search for all file names that contain ".app" or for files of type 'APPL'. Pretty straightforward, but note that the PBCatSearchVol call can be expensive if called asynchronously (there is a synchronous version of the call). Check out the "Carbon/File.h" header. You should be able to conver the resulting FSRef list into CFURLRef's, then into NSFile's for direct cocoa manipulation.
Michael Kamprath
|
|
--
Michael F. Kamprath
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
I believe the LaunchServices APIs can be used to tell you lots of information about all currently installed/registered apps.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Originally posted by Rickster:
<STRONG>I believe the LaunchServices APIs can be used to tell you lots of information about all currently installed/registered apps.</STRONG>
It can, but the APIs are private. For example, I think you might be wanting _LSCopyAllApplicationURLs, but you won't find that in the headers.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |