I’ve been through a lot trying to get NSIS to install prerequisites and deploy a web application, and all I can say is, I miss the simplicity of WAR deployment. So let me explain to you what my installer had to do:
- Install SQLServer Express 2008, with certain settings
- Install my SQL scripts
- Install IIS, and all necessary components
- Install .Net 4
- Deploy the web application
- and change the database settings to point to the installed database
Surprisingly enough, the thing that gave me the most heartburn was deploying the web application on IIS. The NSIS plugin to help with deployment was erroring out and I didn’t have any messages to help me diagnose what was going on. So I went to use the “appcmd” command line tool. I could at least try it at the command line and then execute it in the installer. Needless to say, the whole process was a little more involved than I like.
One of the best things Java did with Servlets was to create the WAR deployment file. It’s really nothing more than a ZIP file with a Manifest. Because everything is specified where it belongs in the zip file the server knows exactly what to do. Some web servers will “auto-deploy” when you drop the WAR file in a specific directory. I really wish there was that kind of ease of use with IIS.
The basics are all there. MS Visual Studio even knows how to make something like that. The downside to what VS does is that it requires a tool that you won’t find by default on a fresh IIS install: msdeploy. That’s a separate installer, and I can’t figure out how to make it do exactly what I want: Deploy my application as the web site. There’s two drawbacks to the deployment package (other than the non-standard program):
- The directory hierarchy is repeated from the root drive all the way to the object directory. That’s a lot of unnecessary directories, when all that’s needed is the web site itself (and potentially SQL scripts that need running).
- The deployment package generated by VS adds your application as a child of the “Default Web Site”, and you have no real way of controlling it. You can’t make it be the default web site, but only be inside it. And the default name is the project name + “_deploy”.
Microsoft, you are almost there. Just a couple steps forward and you can have one of the easiest deployment stories out there. I’d like to just drop a ZIP file and tell IIS: “there’s my web site!” It shouldn’t even have to unpack it. Just serve the files from inside the ZIP. Oh, I almost forgot, it uses Kernel space routines to send files through IIS for performance reasons. Unzipping it is fine, I just want easy deployment.