Posted on 09-25-2013 07:18 AM
I searched JAMF and google but I couldn't find a script that checks the version of Silverlight. Someone else asked on here but there was no reply.
I'm sure it's an easy script but I am a script n00b.
If anyone has one, please let me know.
Thanks very much!
Posted on 09-25-2013 07:32 AM
Similar to the post yesterday, I think, about grabbing Flash software version, and other software versions. Utilize the "defaults read" command to read the Info.plist file inside application bundles. This particular one is used as an Extension Attribute to grab the Silverlight version:
#!/bin/sh
# Name: silverlightversion.sh
# Date: 04 March 2009 (revised 16 June 2010)
# Author: Steve Wood (swood@integer.com)
# Purpose: to grab the version of Silverlight and place the version in the Position tag in
# the location information of a machine.
# grab the version from the plug-in
version=`defaults read /Library/Internet Plug-Ins/Silverlight.plugin/Contents/Info CFBundleShortVersionString`
echo "<result>$version</result>"
Hope that helps.
Posted on 09-25-2013 07:52 AM
@stevewood beat me to it, but yes, the general rule here is that the information you seek (version number) of an application or plug-in is almost always stored in the bundle's Info.plist. The defaults command will read either the CFBundleVersion or CFBundleShortVersionString from the plist
Posted on 09-25-2013 08:08 AM
wow you guys are fast! thanks for the info and the script.
Posted on 09-25-2013 12:30 PM
We use this and display it with the unit's inventory:
#!/bin/sh
echo "<result> `/usr/bin/defaults read /Library/Internet Plug-Ins/Silverlight.plugin/Contents/Info CFBundleVersion`</result>"