title: Can WiX custom actions be imported from a setup library or is there another method to achieve the same functionality?
body: <p>I have a program that is composed of 4 different setup libraries. What I would like to do is completely compartmentalize these libraries so that I can easily reuse them or limit the functionality of the program based on what gets installed. Currently, all of my custom actions are declared inside the installer itself. I would like to have these custom actions reside in their respective setup libraries as well as specify them in the installexecutesequence. Is this something that is possible with WiX? So far, this is what I have tried to no avail.</p>
  
  <p><strong>Project A SetupLibrary</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
      &lt;Fragment&gt;
      &lt;?if $(var.Platform) = x86?&gt;*See note
          &lt;CustomAction Id="MyCustomAction" FileKey="Somefile.exe" Execute="deferred" ExeCommand="CmdLineArgs" Return="check"/&gt;
          &lt;InstallExecuteSequence&gt;
              &lt;Custom Action="MyCustomAction" After="StartServices"/&gt;
          &lt;/InstallExecuteSequence&gt;
      &lt;?endif ?&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p>*<em>I have this condition to prevent this custom action from generating twice in my main project since I import both the 32 bit and 64bit version of this setup library.</em></p>
  
  <p>Using this above method, my project compiles just fine, but the custom action is nowhere to be found in the Custom Actions table of the MSI upon compilation. If I explicitly list the custom action inside the InstallExecuteSequence inside my installer, it works, however that defeats my end goal of having all these components wrapped up in their own setup libraries. </p>