Scott Guthrie has a monster 20+ page article on installing a Web Site using a Web Deployment project. I’ve written before about how I feel about MSIs but this takes the lunacy to a new level in my opinon.
Scott starts but building a dummy web application then builds an MSI installer to do the following:
- copy it to disk
- install a web application
- inject a connection string
Scott defines a scenario where your client wants to install your application on their servers and would like an installer. As it happens I built something very similar and Scott missed something critical: you need a Database. Well, real-world applications need a Database. So the MSI I built installed a DB also and unlike Scott’s example it had to support updating.
The end result was that the MSI became massive. As much time ended up being spent developing the MSI as the application. However, an MSI cannot predict subtle changes that people have made on their servers, or the indexing service locking your files while you try to upgrade, or the company’s Application pool policy etc. etc.
So you end up with an automatic installer that requires a consultant to go on site and run it. At which point you start teaching the consultant the foibles of the installer and not the structure of the application. Then the chap who wrote the installer leaves and the installer project can’t be maintained because it’s a whirlwind of cryptic property settings and code fragments.
Any why? Why has we travelled down this long, painful and pointless path? To save the 3 steps at the top of the post. 3 very simple steps that anyone who runs a Web Server for a living should take in their stride. Sorry Scott, but your tutorial is a hideous example of over-engineering.
The cardinal rule is: you can’t automate through uncertainty. Automatic scripts which I spoke about in a previous post can help enormously in many situations but only if you own the environment end to end. And a GUI-based wizard will never help in these situations. Installers are useful for Joe Public user who want Notepad 2 not for Joe Businessman who wants your payroll product.