title: Avoid proceeding to the next dialog with a condition in a WiX installer
body: <p>Does anyone know if/how I can stop a WiX-based MSI installer from proceeding to the next dialog when a certain condition is met? I have the following code:</p>
  
  <pre><code>&lt;Dialog Id="SelectIISApplicationPoolUserDialog" Width="370" Height="270" Title="$(var.ApplicationPoolUserDialogTitle)"&gt;
    &lt;Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"&gt;
      &lt;Publish Property="APPLICATIONPOOLUSER" Value="{}"&gt;WEBSITE_APPLICATIONPOOLUSERTYPE = "local"&lt;/Publish&gt;
      &lt;Publish Property="APPLICATIONPOOLUSER" Value="1"&gt;WEBSITE_APPLICATIONPOOLUSERTYPE = "domain"&lt;/Publish&gt;
      &lt;Publish Event="DoAction" Value="CheckPortNumber"&gt;1&lt;/Publish&gt;
    &lt;/Control&gt;
  </code></pre>
  
  <p>CheckPortNumber refers to this:</p>
  
  <pre><code>&lt;Binary Id="IISCA" SourceFile="binaries/MyCustomActions.IIS.CA.dll" /&gt;
  &lt;CustomAction Id="CheckPortNumber" 
                BinaryKey="IISCA" 
                DllEntry="IsFreePort" 
                Execute="immediate" /&gt;
  </code></pre>
  
  <p>Also, somewhere else, we have this declare:</p>
  
  <pre><code>&lt;Publish Dialog="SelectIISApplicationPoolUserDialog" 
           Control="Next" 
           Event="NewDialog" 
           Value="SetSqlServerConnectionDialog"&gt;ISPORTFREE&lt;/Publish&gt;
  </code></pre>
  
  <p>When I run the installer and get to the dialog to select the application pool user, I click next. The custom action then checks the portnumber and sets the ISPORTFREE variable. However, the next dialog isn't shown, regardless of the result of ISPORTFREE. But when I click Next a second time, the next dialog is shown.</p>
  
  <p>So what I want is: when I click next and the entered portnumber is in use, I get a warning and don't proceed to the next dialog. If it isn't in use, I proceed to the next dialog.</p>