The blog of Rahoul Baruah from 3hv Ltd

What's going on?

My name is Rahoul Baruah (aka Baz) and I'm a software developer in Leeds (England).

This is a log of things I've discovered while writing software in Ruby on Rails. In other words, geek stuff.

However, I've decided to put this blog on ice - I would ask you to check out my business blog here (or subscribe here).

03 March, 2006

The all-singing, all-dancing, all-in-one WEBrick web application installer!

The "all-singing, all-dancing, all-in-one WEBrick Web Application Installer", version 0.1 is now available for you to play with (under the terms of the LGPL). You can read the instructions here but I've provided a quick summary, below. In order to use this you must download the excellent (and free) InnoSetup.

The major grief with installation is when things go well they go well. When things go wrong it's because something unexpected happened! This installer has worked absolutely fine on every machine I've used it on. However, my instructions for setting up IIS have also worked fine on every machine I've used it on. Just because it works for me doesn't mean it will work for you. So please download the installer, use it, break it, fix it and let me know how you get on.


This InnoSetup file compiles a Ruby on Rails application and the Ruby 1.8.2-15 installer into a single Setup.EXE file. When run on a customer's machine it will install Ruby, if required, install your Rails application, copy some database and email configuration parameters into your application and then create a Windows Service that will start your application on machine startup. It expects your application to use SQL Server although it wouldn't be hard to change it to something else.

What does it do?
The installation will require administration rights as it sets up Windows Services.

Firstly, it checks to see if Ruby is installed - if not then it invokes the standard Ruby installer.

Next it asks for some configuration details:
Your Web Server configuration - the port number to use and when to clean up the session files (defaulting to 80 and at 4:00 every day respectively).
Your Database configuration - the database server, database name and username and password to use to log in.
Your Email configuration - the email server, port number and domain name to use.

Then it unpacks your application to the specified folder (by default C:\MyAppName) and writes the configuration parameters collected above to the relevant configuration files.

Lastly it, optionally, asks if you want to install the Windows Service (called MyAppName), to start it automatically and whether you want to schedule a task to clean up the session files.
instsrv and srvany (from the Windows Server Resource kit) are used to create the service.
net start is used to start the service.
at is used to create a scheduled task to clean up the session files.

Potential Future Enhancements
At present the installer is designed for SQL Server databases only. It generates an ADO specific set of database connection parameters. This should be amended to ask for an adapter and generate the parameters accordingly.

The installer could detect if any migrations are included and run them at the end of the installation process to ensure that the database is at the correct version. However, on new installations it will require that the database is created before the installer is run.

A separate version of this installer is planned that will install the web application into IIS using FastCGI.

No comments:

eXTReMe Tracker