A few months back Tim Heuer wrote up a great post on customizing the Silverlight installation experience. I highly recommend reading his post and doing something similar in your own applications, it can really make the user experience better.
What I'm going to discuss builds on what Tim already wrote so go read his post first if you haven't done so already. Don't worry, I'll wait.
Welcome back. I was recently presented with a situation that isn't exactly common, but is not so unusual that no one else will experience it, in fact, some of you may be working on this right now. The situation I was presented with is we are building an ASP.NET application that contains a Silverlight application and is installed at client locations via a installation CD. At some of the installed locations, end user PCs that will use the application don't have access to the outside Internet. So how do we install the Silverlight Plug-in if the browser can't access the Microsoft download site?
Hopefully the corporate IT department will have already pushed the Silverlight plug-in to all PCs in the enterprise. There was a nice white paper put together last year explaining different approaches for doing just that. Unfortunately, we all know that many IT departments are slow (or reluctant) to install new software, which is why we have this issue.
Since the application is installed in numerous locations from a single installation CD, we don't know the environment it will be installed in, so any solution had to handle cases both with and without Internet access. After attempting numerous approaches I came up with something that is so simple and elegant I felt a little stupid for not coming up with the answer hours earlier.
The first step is to ad the latest version of the Silverlight Plug-in installation .exe in your web app. You could just point your installation link to that exe and call it done but that's an easy way out. It would be better to have the user install directly from the Microsoft site to ensure it is the latest version that gets installed. So what we needed was a way to determine if the users browser can access the Microsoft download site and then install the runtime from there if available or from the intranet application's web server if MS is not reachable. This is actually quite easy.
There are two parts to the solution:
The function then, which is called only if the user doesn't have Silverlight installed and clicks the "Install Silverlight" link, checks to see if the image was successfully downloaded or not. If the image is present it means that the user does indeed have access to the Microsoft download site and directs the browser to the correct location and if not, directs them to the exe in the Intranet application.
As you can see this is a very simple way to make sure that users of Intranet hosted applications can still get the Silverlight plug-in, even if they don't have Internet access. If anyone else has similar tips please pass them along.