Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

frankpuccino

macrumors newbie
Original poster
Jul 24, 2010
29
0
Suppose I want to determine the versions of applications that are installed on a user's machine.

Is it "correct" to take the application's bundle identifier, go to the application bundle directory, and then pull the Info.plist out of the bundle and look at the version number there?

Or is there a better way?

Frank
 
If you only need this to work with apps that are packaged as bundles, you can also just use NSBundle, e.g.:

Code:
[[NSBundle bundleWithPath: @"/path/to/an.app"] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]
 
The terminal command

Code:
system_profiler SPApplicationsDataType -xml

will produce an XML file with all app details. You can redirect this to a file, parse it with an XML parser, whatever
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.