title: Inserting Custom Action between Dialogs (InstallUISequence) in WiX
body: <p>I have two custom dialog boxes (plus the required ones <code>ExitDlg</code>, <code>FatalErrorDlg</code>, etc.), the first one sets a property using an Edit control and the second one shows this property using a Text control. Here is the meaningful code:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Dialog Id="DialogA" ...&gt;
    &lt;Control Id="ControlEdit" Type="Edit" Property="MY_PROPERTY" .../&gt;
    &lt;Control Id="ControlNext" Type="PushButton" ...&gt;
      &lt;Publish Event="EndDialog" Value="Return" /&gt;&lt;/Control&gt;
  &lt;/Dialog&gt;
  </code></pre>
  
  <p>And then the second dialog:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Dialog Id="DialogB" ...&gt;
    &lt;Control Id="ControlText" Type="Text" Text="[MY_PROPERTY]" .../&gt;
    &lt;Control Id="ControlBack" Type="PushButton" ...&gt;
      &lt;Publish Event="EndDialog" Value="Return" /&gt;&lt;/Control&gt;
    &lt;Control Id="ControlNext" Type="PushButton" ...&gt;
      &lt;Publish Event="EndDialog" Value="Return" /&gt;&lt;/Control&gt;
  &lt;/Dialog&gt;
  </code></pre>
  
  <p>And the action sequence:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;InstallUISequence&gt;
     &lt;Show Dialog="DialogA" Before="MyCustomAction" /&gt;
     &lt;Custom Action="MyCustomAction" Before="DialogB" /&gt;
     &lt;Show Dialog="DialogB" Before="ExecuteAction" /&gt;
  &lt;/InstallUISequence&gt;
  </code></pre>
  
  <p>The custom action changes the value of <code>MY_PROPERTY</code>. My problem is how to make the Back button in <code>DialogB</code>get back to <code>DialogA</code>. Using <code>NewDialog</code> is simple, but then I can't get the custom action to be executed between the dialogs, or can I?</p>
  
  <hr>
  
  <p><strong>edit - 2013-05-02</strong></p>
  
  <p>After the answer from @caveman_dick, I tried to change the <code>DialogA</code> almost like he said, but instead of using <code>EndDialog</code>, I changed to <code>Action="NewDialog" Value="DialogB"</code>. But now the Custom Action isn't being called. If I remove the Publish event to go to next dialog, then the CA is called. If I leave as @caveman_dick said, I can't get back to <code>DialogA</code> from <code>DialogB</code>.</p>
  
  <hr>
  
  <p><strong>edit - 2013-05-02</strong></p>
  
  <p>After searching in book <em>WiX 3.6: A Developer's Guide to Windows Installer XML</em>, I found the following: "if you have more than one Publish event, they must have conditional statements as their inner text. Otherwise, all of the events simply won't be published."</p>
  
  <p>So the answer from @caveman_dick is correct, except that you need to change to the following:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Publish ...&gt;1&lt;/Publish&gt;
  </code></pre>