Skip to main content
Question

Check silverlight version?

  • September 25, 2013
  • 4 replies
  • 8 views

Forum|alt.badge.img+8

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

stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • September 25, 2013

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
Forum|alt.badge.img+24
  • Legendary Contributor
  • September 25, 2013

@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


Forum|alt.badge.img+8
  • Author
  • Contributor
  • September 25, 2013

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


Forum|alt.badge.img
  • New Contributor
  • September 25, 2013

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