Posted on 04-05-2012 01:06 PM
Anyone have an EA to report back what versions of FileMaker Pro are installed on Mac? I presume the folder itself would be a good thing to check:
/Applications/FileMaker Pro 12
PS, New request from a group, they want to see where they are before deciding to upgrade to version 12 that was just released.
Thanks,
Don
Posted on 04-05-2012 01:43 PM
won't that be in the inventory already as an installed app?
Posted on 04-05-2012 02:18 PM
@rockpapergoat Yessir, but if we have our analysts pull an advanced search under "Computers", they'll then need to dig into the "Details" link for each Mac. If they pull a search under "Applications" they won't be able to export the result.
So what we are trying to do is set up an EA so advanced searches under "Computers" will show a field with each instance of /Applications/FileMaker Pro on the Mac.
Don
Posted on 04-05-2012 02:42 PM
Something like the following help?
#!/bin/bash
app="FileMaker"
AppPath=$(find /Applications/ -name "$app*.app" )
if [ -e "$AppPath" ]; then
version=$(defaults read "$AppPath"/Contents/Info.plist CFBundleVersion)
fi
echo "<result>$version</result>"
Posted on 04-05-2012 06:28 PM
similar to this previous script i wrote:
https://github.com/rockpapergoat/scripts/blob/master/misc/get_app_version.rb
this one formats the output for use as an extension attribute.
if you run it as a standalone script, the value of $4 (ARGV[3] in ruby) will be used as the app name to check. otherwise, you can remove the positional arguments check and pass whatever you want.
Posted on 04-06-2012 04:38 PM
@leslie Thanks, I'll give this a go.
@rockpapergoat, I'll have a look at your solution when I get a chance on Monday.