I've been playing around with Silverlight again in the last few days (I know - coding rather than talking about things. It's going to do my reputation no good at all) and I wanted to do something a little neater than the basic workflow where the user is directed off to the Microsoft.com download page and has to go from there.

A quick search and I spotted Laurences article on using inplace (aka direct aka inline) install for the Silverlight control and that made for a much better user experience - the control could be put where I wanted it and the user didn't have to leave my page to install it.

That then left the little challenge of what happened after they'd installed the control. In Firefox because of the architecture you have to restart the browser to activate plug ins so there's nothing I could do about that, but in IE7 the control is usually available straight away. The problem was the page didn't know the control had been installed.

Luckily the Silverlight Javascript libraries include a test for the plug-in being present (and you can check the version number) which means it's a simple enough task to write some Javascript that loops around every 5 seconds or so and tests to see if the plug-in is there and when it is stop showing the install prompt and show the goodness that you were after in the first place.

You can download my very simple sample from here or see it in action here