title: WiX Custom action not executing
body: <p>I am having trouble with a Wix custom action not executing. The installer continually rolls itself back even when the custom action returns ActionResult.Success.</p>
  
  <p><strong>Custom Action (C#)</strong></p>
  
  <pre><code>[CustomAction]
  public static ActionResult SetPermissionsToAppDataFolder(Session session)
  {
      return ActionResult.Success;
  }
  </code></pre>
  
  <p><strong>Custom Action Definition in Wix</strong></p>
  
  <pre><code>&lt;!-- Custom Action --&gt;
  &lt;Binary Id="CustomActionLibrary" SourceFile="$(var.CustomActionFolder)InstallerCustomActions.CA.dll" /&gt;
  &lt;CustomAction Id="CustomActionInstallDirectoryPermission"
                BinaryKey="CustomActionLibrary"
                DllEntry="SetPermissionsToAppDataFolder"
                Execute="deferred"
                Return="check" /&gt;
  </code></pre>
  
  <p><strong>Install sequence calling the custom action</strong> </p>
  
  <pre><code>&lt;!-- Install Sequences --&gt;
  &lt;InstallExecuteSequence&gt;
          &lt;Custom Action="CustomActionInstallDirectoryPermission" Before="InstallFinalize"&gt;NOT Installed&lt;/Custom&gt;
  &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p>The installer compiles fine so there is no problem finding the custom action library file. The issue is that the installer gets to the final stage of installation before rolling back. When we remove the call to the custom action in the install sequence the installer completes.</p>
  
  <p>From my understanding the custom action CA.dll gets embedded into the final installer. Initially I'd thought the CA.dll needed to be distributed alongside the installer but later discovered the installer compiles it into the final .msi.</p>
  
  <p>I have "wired" the custom action library using the code found at:
  <a href="http://www.codeproject.com/Articles/132918/Creating-Custom-Action-for-WIX-Written-in-Managed" rel="nofollow">http://www.codeproject.com/Articles/132918/Creating-Custom-Action-for-WIX-Written-in-Managed</a></p>
  
  <p>No matter what I do I cannot get the installer to complete, even when the custom action returns "success". Any help is appreciated.</p>