Check silverlight version?

rseide
Contributor

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!

4 REPLIES 4

stevewood
Honored Contributor II
Honored Contributor II

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.

mm2270
Legendary Contributor III

@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

rseide
Contributor

wow you guys are fast! thanks for the info and the script.

Berdley
New Contributor

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>"