title: Wix UI conditionals best practices
body: <p>I have a fairly complicated installer that I'm writing in Wix that has a lot of custom dialog options based on which components you're installing.  Generally, defaults are fine, and thus an unattended install would succeed, but having this customization helps things.</p>
  
  <p>What I'm wondering is, what are best practices in Wix for doing UI conditionals?  I've noticed that Wix evaluates all <code>&lt;Publish&gt;</code> tags, regardless of whether or not the last one evaluated to true, which is leading to a lot of code like this:</p>
  
  <pre><code>&lt;Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component1Questions" Order="1"&gt;INSTALLCOMPONENT1&lt;/Publish&gt;
  &lt;Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component2Questions" Order="2"&gt;NOT INSTALLCOMPONENT1 AND INSTALLCOMPONENT2&lt;/Publish&gt;
  &lt;Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component3Questions" Order="3"&gt;NOT INSTALLCOMPONENT1  AND NOT INSTALLCOMPONENT2 AND INSTALLCOMPONENT3&lt;/Publish&gt;
  &lt;Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4"&gt;NOT INSTALLCOMPONENT1  AND NOT INSTALLCOMPONENT2 AND NOT INSTALLCOMPONENT3&lt;/Publish&gt;
  </code></pre>
  
  <p>And similarly on the "back' sections for each dialog.  Is this best practice for this?  Is there a way to short circuit evaluation of Publish elements and take the first one that returns true?</p>