Tuesday, October 05, 2010

Creating WIX Installer for ASP.NET Web Application

Table of Contents
  • Introduction
  • Why Do We Need Installer for Web Application?
  • Creating a web application
  • Creating WIX Code
  • ConfigurationInitialize.wxi – Definition of variables
  • Product.wxs – the main code of the installer
  • IISConfiguration.wxs – configuration of IIS
  • UIDialogs.wxs – Customized UI screens
  • MyWebUI.wxs
  • WebSiteContent.wxs
  • The way to building msi package
  • Why is there an exclamation mark in harvesting web application content?
  • From bat file to msbuild
  • Conclusion
  • References
  • History

Introduction
It is a couple of months I started to write an installer for a web application. I decided to learn how to write it in WIX because I’ve heard positive reviews about it. It wasn’t so easy at the very beginning but the time I’ve spent in that platform is very valuable for me. Since then I realized that having an installer is important part of software delivery process. After writing an installer for a few projects, this activity become easy and fast. In this article I introduce a code for creating an installer for a web application in WIX and I show you how to compile it using commands from command line. I also introduce msbuild script for creating an installer for a web application starts from publishing a web application through harvesting the application content finished by compiling the installer. You will understand the process and thus you will be able to extend it according to the demands of your web application.
Why Do We Need Installer for Web Application?
In my professional career I’ve been mostly developing ASP.NET web applications. Not all of them but most of them. The software delivery process was always pushed to be secondary activity and therefore underestimated by almost all of the team members. Not only in the early days but also today I meet good programmers with the vision that building installer is not necessary. Xcopy (robocopy) will always work well and raised issues will be solved ad-hoc in the production environment. But that’s not professional, isn’t it? Well, if you are creating a blog page for you or friend of yours which should be deployed to a hosting service then you probably don’t need to create an installer for it. You will probably have no option to execute the installer on the hosting service because of lacking privileges. The only thing you will have available is FTP access. So, why is needed to write an installer for a web application anyway? I would consider to write an installer for a web application which should be installed more than once and by someone else than the author of the web application. I would also consider to write an installer for a web application if there is the continuous integration or continuous delivery process as the part of the development.
Read more: Codeproject