ConfigureIIS running on systems without IIS

Posted by Jason on April 1, 2008 at 10:53 am

These days I always seem to find myself writing installers for clients using WiX. What usually happens is I get there to find they are really struggling to maintain their current installers, more often then not in InstallShield. So I go and tell them they should try WiX since it has so many advantages over certain other products. For a start it’s actually maintained by several Microsoft guys and enjoys a big support community. Also since the source code is written in XML it is much easier to check in to source control and maintain.

Anyway, to cut a long story short, my evangelising on the subject usually ends in the words ‘here you go then, write an installer for that’. And so I end up with the job yet again.

That’s not to say it doesn’t have its issues like so many other things in the world of software development, especially when you end up writing some monster installer that installs a web-client, web-services, windows-services and the odd database or two.

Today’s issue was ConfigureIIS which is a custom action executed if you are creating a <WebVirtualDir>. Unfortunately even if you are not installing the web component that needs IIS to be configured it will still attempt to execute ConfigureIIS which causes an error to appear if IIS is not installed. Just having a web component in your installer is enough to fire it off.

Looking on the WiX mailing lists it seems that it is a known issue and the only way around it currently is by modifying and recompiling the source code for WiX itself. Not a lot of fun when you just want to write an installer and it takes you away from the currently released code, which I find it is best to avoid when working for other clients.

However, in the process of modifying the source I found the property SKIPCONFIGUREIIS. Set this to true and it no longer runs the ConfigureIIS custom action. Obviously you need to make sure it’s only turned off for the relevant features of your installer. It’s just a shame they didn’t make it a little more widely known!

To be honest I could have kicked myself since I already knew of the SKIPINSTALLSQLDATA for turning off the database activity when not required. That one is a little more published though.