title: WiX Toolset run custom action after file copy
body: <p>I have a custom action in a C# custom action assembly I want to run at the end of the install, or at least after the files have been copied.  I need to update a config file with information that was entered in the dialogs during the first part of the install.  It's a remoting config file, so there are several  lines that have to be updated.  Currently I have XmlFile entries for each of the line items, but I want to generically replace localhost:8001 with [servername]:[serverport].  I have not found a generic search and replace in WiX, so I wrote a custom action to do it.  Problem is I cannot get it to run.  I am using a custom UI (UI Sequence XML bellow), so that might be why the After="InstallFiles" does not work.</p>
  
  <pre><code>    &lt;InstallUISequence&gt;
          &lt;Custom Action="SetInstallFolder" Sequence="1" /&gt;
          &lt;!--&lt;Custom Action="UpdateRemotingConfigFile" After='InstallFiles' /&gt;--&gt;
          &lt;Show Dialog="UserExitForm" OnExit="cancel" /&gt;
          &lt;Show Dialog="FatalErrorForm" OnExit="error"&gt;&lt;![CDATA[NOT HideFatalErrorForm]]&gt;&lt;/Show&gt;
          &lt;Show Dialog="MaintenanceForm" Sequence="999"&gt;&lt;![CDATA[Installed &lt;&gt; ""]]&gt;&lt;/Show&gt;
          &lt;Show Dialog="ResumeForm" Sequence="998"&gt;&lt;![CDATA[Installed="" AND RESUME]]&gt;&lt;/Show&gt;
          &lt;Show Dialog="FinishedForm" OnExit="success" /&gt;
          &lt;Show Dialog="WelcomeForm" Sequence="1001"&gt;&lt;![CDATA[Installed="" AND NOT RESUME]]&gt;&lt;/Show&gt;
          &lt;Custom Action="VSDCA_AllUsers" After="CostInitialize"&gt;&lt;![CDATA[Installed="" AND NOT RESUME AND ALLUSERS=1]]&gt;&lt;/Custom&gt;
      &lt;/InstallUISequence&gt;
  
      &lt;AdminUISequence&gt;
          &lt;Custom Action="SetInstallFolder" Sequence="1" /&gt;
          &lt;!--&lt;Custom Action="UpdateRemotingConfigFile" After='InstallFiles' /&gt;--&gt;
          &lt;Show Dialog="UserExitForm" OnExit="cancel" /&gt;
          &lt;Show Dialog="FatalErrorForm" OnExit="error"&gt;&lt;![CDATA[NOT HideFatalErrorForm]]&gt;&lt;/Show&gt;
          &lt;Show Dialog="MaintenanceForm" Sequence="999"&gt;&lt;![CDATA[Installed&lt;&gt;""]]&gt;&lt;/Show&gt;
          &lt;Show Dialog="ResumeForm" Sequence="998"&gt;&lt;![CDATA[Installed="" AND RESUME]]&gt;&lt;/Show&gt;
          &lt;Show Dialog="FinishedForm" OnExit="success" /&gt;
          &lt;Show Dialog="WelcomeForm" Sequence="1001"&gt;&lt;![CDATA[Installed="" AND NOT RESUME]]&gt;&lt;/Show&gt;
      &lt;/AdminUISequence&gt;
  </code></pre>
  
  <p>If I uncomment the custom action above, I get the following error:</p>
  
  <blockquote>
    <p>error LGHT0094: Unresolved reference to symbol 'WixAction:InstallUISequence/InstallFiles' in section 'Product:{...</p>
  </blockquote>
  
  <p>If I change it to "FinishedForm", I get the following error:</p>
  
  <blockquote>
    <p>error LGHT0177: The AdminUISequence table contains an action 'UpdateRemotingConfigFile' that is scheduled to come before or after action 'FinishedForm', which is a special action which only occurs when the installer terminates.  These special actions can be identified by their negative sequence numbers.  Please schedule the action 'UpdateRemotingConfigFile' to come before or after a different action.</p>
  </blockquote>
  
  <p><strong>Update:</strong>
  I have the custom action defined as follows:</p>
  
  <pre><code>&lt;Binary Id="WebApiSetupHelper" SourceFile="..\WebApiSetupHelper\bin\$(var.Configuration)\WebApiSetupHelper.CA.dll" /&gt;
  &lt;CustomAction Id="UpdateRemotingConfigFile" BinaryKey="WebApiSetupHelper" DllEntry="UpdateRemotingConfigFile" Return="check" /&gt;
  </code></pre>
  
  <p>What do I need to change to get the custom action to run?</p>
  
  <p>Thanks.</p>