Zero to Hero: How to Check if Silverlight is installed.


Technorati Tags:

del.icio.us Tags:

I’ve been getting lots of questions on how to check to see if Silverlight is already installed. This is actually very easy to do, but has somehow slipped through the cracks (I even missed it when writing my Silverlight book — DOH!) — anyway — the Silverlight.js library offers how to do this as well as lots of other goodies.

First, you can check to see if Silverlight is installed by looking at the

Silverlight.available

variable. Simple, huh? This will return true is Silverlight is installed and false if not.

While you’re doing that, you may also want to see what browser and OS you are currently running.

 

The Browser is checked using this JavaScript var:

Silverlight.ua.Browser

which will return one of the following values: ‘MSIE’, ‘Firefox’, ‘Safari’ or ‘Unsupported’.

 

The Operating System is checked using this JavaScript var:

Silverlight.ua.OS

which will return one of the following values: ‘Windows’, ‘MacPPC’, ‘MacIntel’, ‘Unsupported’

 

So, using these values, you can make your installation experience as flexible as possible :)

Also, don’t forget about the inplaceInstallPrompt property on the control itself.

Comments (4)

  1. Test says:

    Technorati Tags: Silverlight del.icio.us Tags: Silverlight I've been getting lots of questions on

  2. Bryan Chow says:

    Silverlight.js库提供了如何检查是否已安装Silverlight的方法。Silverligh.available可以检测Silverlight是否被安装,这个方法会返回true或者fa…

  3. WynApse says:

    Silverlight Cream for October 25, 2007 — #112