Extension Atribute to Capture GetInfoString?

John_Wetter
Release Candidate Programs Tester

Hi Everybody,

I'm wondering if anybody has any code they'd be willing to share to pull the 'CFBundleGetInfoString' field from the info.plist of an application?

The manufacturer only populates that field with the version, so nothing can automatically pull the version of the software. I have talked to them about this, but the company line still seems to be "Just right-click on the application to find what version you have."

Any thoughts? I haven't thought about it a lot yet, but will need to soon, so I wanted to check to see if anyone else has run into this and might already have the code so I don't need to start from scratch.

John
--
John Wetter
Technical Services Manager
Educational Technology, Media & Information Services
Hopkins Public Schools

6 REPLIES 6

bentoms
Release Candidate Programs Tester

I did something similar with silverlight.

http://macmule.com/2011/03/07/ea-get-silverlight-version/

Regards,

Ben.

talkingmoose
Moderator
Moderator

The 'defaults' command can read .plist files.
On 4/25/11 2:15 AM, "John Wetter" <john_wetter at hopkins.k12.mn.us> wrote:

To read the version number of Acrobat Reader 9, for example, you'd use:

defaults read "/Applications/Adobe Reader 9/Adobe
Reader.app/Contents/Info" CFBundleShortVersionString

Note that the .plist extension is omitted when using 'defaults'. You can
substitute 'CFBundleShortVersionString' with most any key in the .plist
file to get the information you're needing.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

tlarkin
Honored Contributor

Casper already does this. Do an advanced inventory search for software type. Add the application name and the desired version and it will produce a list, and you can find machines that do not match the criteria too.

Not applicable

Ultimately, your best bet is to get the manufacturer to comply with the standards set forth by the OS. Failing that, you should probably edit the Info.plist yourself to include the appropriate version as part of your packaging process. This will make it much easier down the road, I'd expect.

That said, the defaults command can read any valid .plist file, as described previously.

John_Wetter
Release Candidate Programs Tester

This is what I'd normally do, but for this software all I get for a version in the JSS is n/a because the JSS doesn't look for that string.

To Benjamin: Yep, I'm working on that too, have been for a year. But, the need to get a report on the version has come faster than the manufacturer has provided it.

John

--
John Wetter
Technical Services Manager
Educational Technology, Media & Information Services
Hopkins Public Schools

stevewood
Honored Contributor II
Honored Contributor II

In the past what I've done is use 'cat' and 'awk' to grab the info. Here's
On Mon, Apr 25, 2011 at 3:14 PM, John Wetter <john_wetter at hopkins.k12.mn.us>wrote:
an example of the command to grab the Flash plug-in version:

CurrentVersionFlash=`/bin/cat /Library/Internet Plug-Ins/Flash
Player.plugin/Contents/Info.plist | grep -m 1 10. | /usr/bin/awk '{ print $5
}'`

You'd obviously have to play around with what you are grabbing.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475