I would like to deploy mutually exclusive applications into mutually exclusive environments based on User Input in a WIX project. The research I've done tells me I can't do this using conditions http://www.joyofsetup.com/2007/05/30/feature-conditions-and-ui/ This seems like a fairly common question and a definitive best practice would be valuable.
I've implemented this using features and publishing events per the above article. The events in my UI are below.
In my situation I'm installing one of two mutually exclusive web applications into one of three different environments. I did this by creating 8 features, 1 each for the applications and all files except web.config and 6 for the web.config files depending on the application being installed and the environment being installed into. I had to include a condition in each of the features to pass ICE validation even though they are controlled by publish elements below because they are being installed to a directory named the same on different servers. Is there a better way or is this the standard practice for this sort of situation?
<Publish Event="AddLocal" Value="WebApp"><![CDATA[ServerType="Web"]]></Publish>
<Publish Event="Remove" Value="WebApp"><![CDATA[ServerType<>"Web"]]></Publish>
<Publish Event="AddLocal" Value="DataApp"><![CDATA[ServerType="App"]]></Publish>
<Publish Event="Remove" Value="DataApp"><![CDATA[ServerType<>"App"]]></Publish>
<Publish Event="AddLocal" Value="WebDevConfigFeature"><![CDATA[ServerType="Web" AND Environment="Dev" ]]></Publish>
<Publish Event="Remove" Value="WebDevConfigFeature"><![CDATA[ServerType<>"Web" OR Environment<>"Dev"]]></Publish>
<Publish Event="AddLocal" Value="WebQAConfigFeature"><![CDATA[ServerType="Web" AND Environment="QA" ]]></Publish>
<Publish Event="Remove" Value="WebQAConfigFeature"><![CDATA[ServerType<>"Web" OR Environment<>"QA"]]></Publish>
<Publish Event="AddLocal" Value="WebProdConfigFeature"><![CDATA[ServerType="Web" AND Environment="Prod" ]]></Publish>
<Publish Event="Remove" Value="WebProdConfigFeature"><![CDATA[ServerType<>"Web" OR Environment<>"Prod"]]></Publish>
<Publish Event="AddLocal" Value="AppDevConfigFeature"><![CDATA[ServerType="App" AND Environment="Dev" ]]></Publish>
<Publish Event="Remove" Value="AppDevConfigFeature"><![CDATA[ServerType<>"App" OR Environment<>"Dev"]]></Publish>
<Publish Event="AddLocal" Value="AppQAConfigFeature"><![CDATA[ServerType="App" AND Environment="QA" ]]></Publish>
<Publish Event="Remove" Value="AppQAConfigFeature"><![CDATA[ServerType<>"App" OR Environment<>"QA"]]></Publish>
<Publish Event="AddLocal" Value="AppProdConfigFeature"><![CDATA[ServerType="App" AND Environment="Prod" ]]></Publish>
<Publish Event="Remove" Value="AppProdConfigFeature"><![CDATA[ServerType<>"App" OR Environment<>"Prod"]]></Publish>
<Publish Event="EndDialog" Value="Return">1</Publish>