For the past couple of days, I’ve been trying to upgrade a "simple" WiX installer to work with Windows Server 2008 (note that the installer works fine on Windows Server 2003).  This has proven to be an exercise in PAIN, and here’s why.

What’s changed?

Well, lots.  First, IIS was completely rewritten between Windows Server 2003 and Windows Server 2008.  Out of the box, WiX cannot perform any tasks on IIS 7; you have to enable the legacy IIS 6 metabase stuff first.  That’s easy enough to do, just follow the steps listed here.

That’s just the tip of the iceberg though.  In addition, IIS 7 anonymous users run under the "IIS_IUSRS" *group*, not the "IUSR_[ComputerName]" account like they did in IIS 6.  This is where I’m currently stuck.  WiX-baked MSI installers "gracefully" explode if you try to assign permissions to a user/group that doesn’t exist, so you have to do some sort of conditional install.  I first tried storing the account name in a property, but if it is a Windows Server 2003 machine on a domain, you have to specify "[ComputerName]" as the domain, like so:

<util:PermissionEx User="IUSR_[ComputerName]" 
Domain="[ComputerName]" GenericRead="yes" GenericExecute="yes"/>

However, on Windows Server 2008, the installer explodes if you specify a domain.  So, properties are out.  I next turned to conditional installation.

I created two components, one for each PermissionEx entry, and placed them into two different features.  I gave each feature a condition that should enable/disable the feature correctly based on the OS version:

   1:  <Feature Id="Iis7" Title="IIS 7 Stuff" Level="0">
   2:      <Condition Level="1"><![CDATA[NOT Installed AND VersionNT = 600]]></Condition>
   3:      <ComponentRef Id="Iis7Permissions"/>
   4:  </Feature>
   6:  <Feature Id="Iis6" Title="IIS 6 Stuff" Level="0">
   7:      <Condition Level="1"><![CDATA[NOT Installed AND VersionNT <> 600]]></Condition>
   8:      <ComponentRef Id="Iis6Permissions"/>
   9:  </Feature>

Sadly though, this doesn’t work either.  As near as I can tell, the features are enabled/disabled correctly, and it even works fine on Windows Server 2003, but on Windows Server 2003, the Iis6Permissions are installed no matter what I do. 

So, if you found this post looking for answers, I’m sorry, but at this time I have none.  I’ve never been all that impressed with WiX.  It’s built on top of MSI, which near as I can tell is a convoluted mess, so it isn’t like there was a lot to work with I suppose.  Instead, I’m looking at perhaps using PowerShell or something to automate our deployments… but wait!  The IIS extensions for PowerShell only work on Windows Server 2008!  Stay tuned for more tales of things that Do Not Work!

UPDATE: Check out my latest post for my solution.