I recently had a request from a client for an application that could be distributed and run from a USB memory stick. I wrote it in .NET of course, but some of the target machines don’t have the .NET framework installed (it’s getting more common, but it’s not ubiquitous yet).
This wouldn’t have been a problem if we were installing the application because the installer would have taken care of that for me, but because it was designed to run from the USB memory stick I needed to write a bootstrap that could detect if .NET was installed; if it was installed go straight into the program, if not ask the user if they want to install it (from the installer on the USB memory stick).
var wsh = new ActiveXObject("WScript.Shell");
Add to that the fact that the version numbers of installed .NET frameworks are included in the user agent string, and I can write code like this to detect if the correct version of .NET is installed:
if (navigator.userAgent.indexOf(".NET CLR 3.5.") > -1)
And as I final bonus, it’s a web page so I can layout an information page about the product, with images, that is displayed if .NET isn’t installed.
I’ve never used HTML applications before, but even thought it’s an old technology I think it has some life in it yet. I’ll certainly think about it in future if I need a small app but can’t rely on the .NET framework being installed.