Silverlight’s AIR Equivalent Has Been Here All Along.. At Least In Windows

by Jon Davis 5. March 2009 04:02

I think I know one more reason why Microsoft hasn’t pushed an AIR equivalent for Silverlight. It’s because it already exists in lightweight form, bundled with Internet Explorer, called HTAs, or HTML Applications.

HTAs are basically HTML files, renamed to .hta. Double-clicking an HTML file renamed to .hta opens it up in a form of Internet Explorer that has no status bar, no menu, no toolbar, just the content, and it runs in a desktop-accessible security context. You can even go chromeless (no border and no titlebar on the browser window) by setting the caption setting to false in the HTA header tag.

Of course, HTA is only usable on Windows, which, to many people, makes the comparison of HTAs to Adobe AIR fairly moot. I dunno, though, I’m not entirely inclined to agree. I just like the idea of producing Windows-installable RIAs in a portable codebase of my preferred architecture. On the other hand, cross-platform deployment of rich apps is the biggest selling point for AIR.

Technically, HTA is similar to Mozilla’s Prism (formerly “Webrunner”) in the Windows environment in that it is a way of accessing web content from a desktop icon without the bulk of the browser application. However, HTA is more like AIR in that it breaks out of the Internet Explorer security sandbox (sort of) and allows you to access the desktop environment from script.

Note: The reason why I added a “(sort of)” when saying HTA breaks out of the IE security sandbox above is because it seems there is a mis-trust that goes on when accessing some web content. I tried creating an HTA that redirected (window.location.href=) to a web page that had Silverlight content. It unexpectedly popped up a new window and then the Silverlight app failed to load due to “missing files”. I then tried referencing the web page in an IFRAME, and that worked without any problems. This was strange to me. These things said, I *am* using Windows 7 / IE 8, so it might’ve been a beta quirk. Dunno, really.

HTAs aren’t “marketed” as being very sexy. I don’t know why Microsoft stopped touting HTA as something interesting as of 2005; indeed, the Scripting Center makes HTAs seem somewhat geekish. And I never hear of HTA being compared with Adobe AIR, but I suspect that’s because AIR is presented in a sexy way and HTA is not.

There are some rough corners in HTA technology to make it awkward in its competition with Adobe AIR, here’s a quick list:

  • No app installer. You have to roll your own. HTAs are easy to produce, just take an .html file and rename it to .hta (and optionally add HTA tags to the file, etc.). The problem is that, as easy as that is, it’s not feasible for an end user, who typically won’t even be able to change the file extension (it’s hidden by default).

    Microsoft’s equivalent to AIR’s easy app installation process is ClickOnce Deployment, but once you’re using ClickOnce you’re not using HTAs, you’re using full-blown Windows binaries. Microsoft needs to produce a ClickOnce Lite that allows you to install HTAs and dependency files in something like a .docx, .xap, or .baml file (like, but not equal to, and certainly not being), maybe a new .htax file extension, being a ZIP file with all the CSS, scripts, .xaps, and other dependencies that a standalone rich HTA would need.
  • No app uninstaller, either. No app installer means it won’t get added to Add/Remove Programs, so if you rename an .html file to .hta and manually add it to your Start menu, well, good for you. But there is no realistic end user option for you.

    I think it’s time someone created a CodePlex solution for an HTA app installer/uninstaller if one hasn’t been started already. I’d be tempted to jump in myself if HTAs were cross-platform, but oh if I only had more free time ...
  • Not likely much in the way of special integration with Silverlight or other runtimes. It’s IE, so it all “just works”, just like with a normal web site. I haven’t really tinkered much with AIR so I don’t know but I’d be surprised if AIR didn’t have some special integration between Flash/ActionScript and the Webkit browser host runtime, such as alternative windowing or menuing APIs not normally available in a browser.
  • AFAIK, no transparency. I mentioned earlier that if you turn off the caption option in the HTA header tag, you end up with a chromeless window. (I’m not sure how you can drag windows around the desktop or resize without horribly painful hacks that work around security constraints that, frankly, suck.) But even if you drop the outer border, as far as I know, you can’t have transparency. Hence, no rounded corners. I could be wrong about that.
  • Not many tools out there for producing HTA apps. Adobe AIR comes with a full-blown SDK. There’s also Aptana Studio which provides an IDE for creating Adobe AIR applications. HTA, however, doesn’t really provide anything outside of MSDN documentation and “good luck”.
    This wouldn’t much matter since HTA truly builds on web technology (like AIR). The problem is that it’s more. The HTA SDK is the Windows Script (WScript.exe) COM server, exposing desktop objects like the file system to script, and Internet Explorer itself, which offers up extra rendering and transition filters and a script runtime that supports COM objects, alternate language support (VBScript), etc.

    So what HTA needs in order to compete in the area of tools support are
    • That HTA app installer I keep whining about for not currently existing.
    • A rich Javascript API that exposes common windowing and menuing programming options in an elegant manner, and that acts as an abstraction to WScript and other common Windows ActiveX controls that are accessible to HTAs and would be used in typical HTAs.
    • A fresh XHTML markup model, none of this all-caps HTML sample code. (And please, no more VBScript samples or ‘-o-matics’ unless side-by-side with JScript.)
    • First class support for HTA application development within Visual Studio, including:
      • Window (HTML) designer with all the HTA bells and whistles bundled into the editor and properties window (if it’s not already there??)
      • Debugger (already there, fortunately)
      • HTA installer package creation projects
    • A Silverlight and/or WPF/BAML integration API so that Silverlight / BAML code (C#/VB.NET/DLR) can “speak to” the HTA environment for such things as menus, windowing, etc. to the same extent as the “rich Javascript API” I mentioned above, and then some.
    • An icon exporter/integrator. (HTAs already support desktop icons.) 
    • Rolled into the Expression suite (export a Silverlight app from Blend to a desktop app, which can be edited further with Expression Web).
    • Some look-and-feel love on the above-mentioned, currently non-existent installer.

A fella can dream, can’t he?

Now for the money question. What would be the incentive for Microsoft to produce an AIR equivalent for Silverlight? I was always tempted to believe that there was a conflict of interest in the fact that introducing Silverlight in AIR-like form on non-Windows desktops like Mac or Linux introduced a competition problem with the primary competitive advantages of WPF, which is the XAML-based GUI environment for windowed apps, and which requires Windows. One might argue that giving Silverlight a windowing platform on the Mac or on Linux makes WPF, and thus Windows, less interesting. I used to claim this, now I’m not convinced, because I’ve seen how painfully limited Silverlight is compared to WPF. WPF has the whole of .NET available at its fingertips, as well as extra features like 3D.

That said, though, if Microsoft made HTAs a competitive AIR-like product that gave Silverlight apps a windowing and install-based platform, even if it would be exclusive to Windows, the sole argument I can think of that makes an AIR equivalent for Silverlight a competitive conflict of interest for Microsoft suddenly goes away. Now Silverlight becomes a Windows-favoring technology again, something Microsoft can use to its advantage.

And yes, I’m playing devil’s advocate with that previous paragraph. Meanwhile, you still have AIR and Prism, although, no, you can’t run Silverlight on AIR (apparently there’s some kind of security lock-down on plug-ins, although one wonders how hackable this is) and I don’t think you can access desktop objects such as COM objects from within Prism or AIR, although I believe Prism claims to have scriptable access to desktop files.

Looking at the simplicity of AIR—really, there are only a few key files, notably “Adobe AIR.dll” and “webkit.dll”—it surely can’t be hard to create a new AIR for Silverlight. The more I reconsider, the more I am back in my original agreement that AIR is all about being cross-platform, and that Silverlight needs something more. And certainly, Prism is looking more and more interesting as well.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Silverlight | Software Development


Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar