views:

90

answers:

1

I need to get list of installed applications on leopard / snow leopard. Can any one suggest me how I can get list of installed apps using my cocoa application.

I have tried using "system_profiler SPApplicationsDataType". Problem with this is it just lists out *.app files, which includes the drivers as well. Is there a way to get only list of "installed apps".

A: 

You might be able use to use system_profiler -xml SPApplicationsDataType and then parse the resulting XML data to get just the applications that you are interested in.

Paul R
Thats what I am using as of today. One problem with this approach is, it lists out apps from windows image as well, where windows image is installed using vmware. I cant take these app out thats why I need some clean way to do this.
Unicorn
@Unicorn: are there no fields in the XML data that you can use for filtering ?
Paul R
@Paul: No no field for vmware 2.0.5, i can filter out apps installed using vmware 3.0+. No other straight way possible ?
Unicorn
@Unicorn: I wasn't suggesting that there would be an obvious field for VMware - I was thinking more of something like "runtime_environment" - what does that return for one of your problem VMware apps ?
Paul R
@Paul: "runtime_Environment" is set to "arch_x86" which can be MAC apps as well.
Unicorn
If you're having trouble with vmware apps email [email protected] and they can help you find a work around.
Leibowitzn