To overcome this, we can either use ActiveX control(I am using it myself and am satisfied with it), or launch a web server on the background. The second has an additional advantage: the server and client are decoupled, so in the future you can easily migrate to a pure web environment without touching too much code. While this approach looks attractive, however, we have to face a reality: most web application servers can be too big for most desktop applications to distribute. Note I am taking web application servers here, not simple web servers. It is easy to find a small footprint web server or even write one by yourself, but your development style will have to go back to the 80s (CGI in C). Even though Tomcat Embedded 5.5.12 can be downloaded as a 3.1 MB zip file, your customers may not have JVM installed in the first place. Cassini suffers the same problem, Microsoft has not pushed hard enough to make .NET universal.
How about the Ruby on Rails? It turns out to be a great choice. While a complete distribution takes lots of disk space, it is easy to customize so that we only ship what we need.
Here is how I build my minimum ruby distribution that rail can run on(use windows as example):
1. Have ruby installed to C:\ruby. Later we need to copy files from it.
2. Download rails stand-alone packages, uncompress it to C:\rails, and empty doc/ folder to save space.
3. Copy ruby.exe and msvcrt-ruby18.dll from C:\ruby\bin to C:\rails.
4. Copy the following OS independent libraries (implemented in pure ruby) from C:\ruby\lib\ruby\1.8 to C:\rails\lib\ruby\1.8:
cgi.rb and cgi/
drb.rb and drb/
irb.rb and irb/
optparse.rb and optparse/
rexml.rb and rexml/
soap.rb and soap/
uri.rb and uri/
webrick.rb and webrick/
yaml.rb and yaml/
5. Copy the following OS dependent libraries from C:\ruby\lib\ruby\1.8\i386-mswin32 to C:\rails\lib\ruby\1.8\i386-mswin32:
6. Now we may still need a database (optional). Here is how I get sqlite3 installed:
a) Download precompiled binaries. Copy sqlite3.exe and sqlite3.dll into C:\rails folder.
b) Download SQLite-Ruby. Copy sqlite3_api.so to C:\rails\lib\ruby\site_ruby\1.8\i386-msvcrt\, copy sqlite3.rb and sqlite3/ to C:\rails\lib\ruby\site_ruby\1.8
That's it! You can start WEBrick now:
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2005-12-16 15:23:09] INFO WEBrick 1.3.1
[2005-12-16 15:23:09] INFO ruby 1.8.2 (2004-12-25) [i386-mswin32]
[2005-12-16 15:23:09] INFO WEBrick::HTTPServer#start: pid=440 port=3000
And do whatever rails developement as you want.
This distribution takes 6.28M on disk. If you zip it, it shrinks to a 2.3M file.