Friday, April 17, 2009

WiX 3.0 beta allows to set SiteId

When deploying web applications distributed in multiple servers, you may need to have them all configured with the same SiteId (to share the session DB, etc...). WiX now offers a nice little piece of markup that configures all this for you (instead of having to recur to unreliable VBS calls).

<iis:website id="YourSite" description="Something" directory="YourSite" dirproperties="RootDir" startoninstall="yes" autostart="yes" configureifexists="no" SiteId="10">
...
</iis:WebSite>


Just a word of caution: altough this attribute is included in the Schema for 3.0, it is not actually implemented until WiX v3.0.4805.0. Attempting to use it in any version earlier than this will eventually give you compile errors, since the WiX compiler does not know how to hanlde this attribute.