04 September, 2006 / Installation of .NET Server-Side Application With NSIS

2 comments

Usually customer begins acquaintance with new program by installing it. The first impression is very important therefore program installation must be smooth and easy. Most ASP.NET applications do not have installers, but we want to have one. I would like to share our experience with installation developing in this article.

First thing we should do is writing of installation scenario for our program. For first version of TP 2.0 it is quiet short and simple:

  • Show ‘Hello’ page
  • Ask to select virtual directory name and installation folder
  • Ask about database connection string (user name, password etc)
  • Copy working files to destination folder
  • Create Virtual Directory
  • Create Database
  • Show ‘Installation complete’ page
  • Open installed application in web browser

Uninstall option required as well (all except database).

To make such installation we decided to use NSIS (Nullsoft Scriptable Install System). The reasons were following:

  1. It is free (powerful installers cost about $1k per one title)
  2. It is script-based and allows changing installation scenario freely (while standard Microsoft solution is Data Driven and do not allow many things)
  3. There are lot plug-ins and examples for NSIS

Full source code of installation script for TP2.0 is here. Code completely covers scenario described above. Developing of this code (including research) took about 3 working days.

The following links were useful: Forum: http://forums.winamp.com/forumdisplay.php?s=&forumid=65 XML Plugin: http://nsis.sourceforge.net/XML_plug-in Create Virtual directory: http://nsis.sourceforge.net/Setting_up_a_virtual_directory

What next?

There are many things should be improved in installer. First is improvement of virtual folder creation. User should have possibility to choose between different virtual servers. Also correct default installation directory should be suggested (now it hardcoded as “C:\Inetpub\wwwroot\TargetProcess2”). Installer should detect if .Net 2.0 is installed and help to download and install it. Installer should upgrade old version of TargetProcess to new.

2 Comments:

At September 05, 2006 6:49 PM, Blogger lytri said...

Thanks for posting this! I have been looking at creating an installer for the server portion of a software project I'm working on and it's great to see current examples of people working with NSIS. I have found NSIS to be very flexible so far, but haven't pushed it to do anything too interesting yet, mostly just file copying and folder creation.

 
At September 13, 2007 6:51 PM, Anonymous Jonah said...

I understand that this article is a year old now, but it's one of the very few on this topic I could find. Unfortunately for me, the .nsi file downloadable above simply doesn't compile. I keep getting errors about being unable to resolve an uninstall-related function. In addition to that, the .ini files are missing, which could be useful in demonstrating how those work to an NSIS newbie like me.

In any case, thank you for posting the article, the effort and intentions are appreciated.

 

Post a Comment

Links to this post:

Create a Link

<< Home

 

We are developing TargetProcess agile project management software and blogging about our progress.

Subscribe to the RSS feed
Stay tuned by having the latest updates via RSS
Follow TargetProcess on Twitter
Get in touch with our team

Try TargetProcess
TargetProcess quick tour