Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Getting a list of installed apps

Getting a list of installed apps
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2000
Status: Offline
Reply With Quote
Apr 10, 2002, 02:15 PM
 
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
Reply With Quote
Apr 10, 2002, 03:11 PM
 
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
Reply With Quote
Apr 10, 2002, 11:21 PM
 
I believe the LaunchServices APIs can be used to tell you lots of information about all currently installed/registered apps.
Rick Roe
icons.cx | weblog
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 16, 2002, 01:11 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:43 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2