title: Wix Bootstrapper custom Failure Page Message dependent on error code
body: <p>Having the following WIX Bootstrapper theme:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010"&gt;
      &lt;Window Width="485" Height="300" HexStyle="100a0000" FontId="0"&gt;#(loc.Caption)&lt;/Window&gt;
      &lt;Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="FFFFFF"&gt;Segoe UI&lt;/Font&gt;
      &lt;Font Id="1" Height="-24" Weight="500" Foreground="000000"&gt;Segoe UI&lt;/Font&gt;
      &lt;Font Id="2" Height="-22" Weight="500" Foreground="666666"&gt;Segoe UI&lt;/Font&gt;
      &lt;Font Id="3" Height="-12" Weight="500" Foreground="000000" Background="FFFFFF"&gt;Segoe UI&lt;/Font&gt;
      &lt;Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="FFFFFF" Underline="yes"&gt;Segoe UI&lt;/Font&gt;
  
      &lt;Image X="11" Y="11" Width="64" Height="64" ImageFile="logo.png" Visible="yes"/&gt;
      &lt;Text X="80" Y="11" Width="-11" Height="64" FontId="1" Visible="yes"&gt;#(loc.Title)&lt;/Text&gt;
  
      &lt;Page Name="Install"&gt;
          &lt;Richedit Name="EulaRichedit" X="11" Y="80" Width="-11" Height="-70" TabStop="yes" FontId="0" HexStyle="0x800000" /&gt;
          &lt;Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="246" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes"&gt;#(loc.InstallAcceptCheckbox)&lt;/Checkbox&gt;
          &lt;Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes"&gt;#(loc.InstallOptionsButton)&lt;/Button&gt;
          &lt;Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.InstallInstallButton)&lt;/Button&gt;
          &lt;Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.InstallCloseButton)&lt;/Button&gt;
      &lt;/Page&gt;
  
      &lt;Page Name="Options"&gt;
          &lt;Text X="11" Y="80" Width="-11" Height="30" FontId="2"&gt;#(loc.OptionsHeader)&lt;/Text&gt;
          &lt;Text X="11" Y="121" Width="-11" Height="17" FontId="3"&gt;#(loc.OptionsLocationLabel)&lt;/Text&gt;
          &lt;Editbox Name="FolderEditbox" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" /&gt;
          &lt;Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="3"&gt;#(loc.OptionsBrowseButton)&lt;/Button&gt;
          &lt;Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.OptionsOkButton)&lt;/Button&gt;
          &lt;Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.OptionsCancelButton)&lt;/Button&gt;
      &lt;/Page&gt;
  
      &lt;Page Name="Progress"&gt;
          &lt;Text X="11" Y="80" Width="-11" Height="30" FontId="2"&gt;#(loc.ProgressHeader)&lt;/Text&gt;
          &lt;Text X="11" Y="121" Width="70" Height="17" FontId="3"&gt;#(loc.ProgressLabel)&lt;/Text&gt;
          &lt;Text Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3"&gt;#(loc.OverallProgressPackageText)&lt;/Text&gt;
          &lt;Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" /&gt;
          &lt;Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.ProgressCancelButton)&lt;/Button&gt;
      &lt;/Page&gt;
  
      &lt;Page Name="Modify"&gt;
          &lt;Text X="11" Y="80" Width="-11" Height="30" FontId="2"&gt;#(loc.ModifyHeader)&lt;/Text&gt;
          &lt;Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes"&gt;#(loc.ModifyRepairButton)&lt;/Button&gt;
          &lt;Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.ModifyUninstallButton)&lt;/Button&gt;
          &lt;Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.ModifyCloseButton)&lt;/Button&gt;
      &lt;/Page&gt;
  
      &lt;Page Name="Success"&gt;
          &lt;Text X="11" Y="80" Width="-11" Height="30" FontId="2"&gt;#(loc.SuccessHeader)&lt;/Text&gt;
          &lt;Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes"&gt;#(loc.SuccessLaunchButton)&lt;/Button&gt;
          &lt;Text Name="SuccessRestartText" X="-11" Y="-51" Width="400" Height="34" FontId="3" HideWhenDisabled="yes"&gt;#(loc.SuccessRestartText)&lt;/Text&gt;
          &lt;Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes"&gt;#(loc.SuccessRestartButton)&lt;/Button&gt;
          &lt;Button Name="SuccessCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.SuccessCloseButton)&lt;/Button&gt;
      &lt;/Page&gt;
  
      &lt;Page Name="Failure"&gt;
          &lt;Text X="11" Y="80" Width="-11" Height="30" FontId="2"&gt;#(loc.FailureHeader)&lt;/Text&gt;
          &lt;Hypertext Name="FailureLogFileLink" X="11" Y="121" Width="-11" Height="42" FontId="3" TabStop="yes" HideWhenDisabled="yes"&gt;#(loc.FailureHyperlinkLogText)&lt;/Hypertext&gt;
          &lt;Hypertext Name="FailureMessageText" X="22" Y="163" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes" /&gt;
          &lt;Text Name="FailureRestartText" X="-11" Y="-51" Width="400" Height="34" FontId="3" HideWhenDisabled="yes"&gt;#(loc.FailureRestartText)&lt;/Text&gt;
          &lt;Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes"&gt;#(loc.FailureRestartButton)&lt;/Button&gt;
          &lt;Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"&gt;#(loc.FailureCloseButton)&lt;/Button&gt;
      &lt;/Page&gt;
  &lt;/Theme&gt;
  </code></pre>
  
  <p>What do I need to do to have a custom error message when user clicks cancel?</p>
  
  <p>I basically need a condition to evaluate the case where FailureMessageText is "0x80070642 - User cancelled installation"</p>
  
  <p>The failure window should then display "Installation Cancelled by User" instead of "Setup Failed"</p>
  
  <p>Is there any way to evaluate above expression inside the theme and display controls based on a certain condition ?</p>
  
  <p>*<em>EDIT - 30 jan 2014 *</em></p>
  
  <p>Here is the problem element:</p>
  
  <pre><code>&lt;Page Name="Failure"&gt;
  ...
    &lt;Hypertext Name="FailureMessageText" X="22" Y="163" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes" /&gt;
  ...
  &lt;/Page&gt;
  </code></pre>
  
  <p>I could write:</p>
  
  <pre><code>&lt;Page Name="Failure"&gt;
  ...
    &lt;Text Name="MyCustomText" X="-11" Y="-51" Width="400" Height="34" FontId="3" HideWhenDisabled="yes"&gt; My custom message &lt;/Text&gt;
  ...
  &lt;/Page&gt;
  </code></pre>
  
  <p>but this will not check if error code is 0x80070642 (user cancelled installation), it is just another hard-coded message.</p>