title: CustomAction Called Twice
body: <p>I use Wix, and have a customAction and a anb installSequence:</p>
  
  <pre><code> &lt;CustomAction Id='PreInstallAction' BinaryKey='PreInstallBinary' DllEntry='MyCustomAction1' Execute='immediate'
                    Return='check'/&gt;
        &lt;Binary Id='PreInstallBinary' SourceFile='E:\...\MyCustomAction\bin\Release\MyCustomAction.CA.dll'/&gt;
  
        &lt;InstallExecuteSequence&gt;
           &lt;Custom Action='PreInstallAction' Before='InstallInitialize'/&gt;
        &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p><strong>The problem is that my custom action is called twice</strong> - (In the custom action I print things into the log file and I see them twice)</p>
  
  <p>I tried to comment the line:</p>
  
  <pre><code> &lt;MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" DowngradeErrorMessage="Can't downgrade from newer version"  /&gt;
  </code></pre>
  
  <p>And it solved the problem.
  But I need the major update so I tried uncomment the above line and add a condition to the customAction:</p>
  
  <pre><code>&lt;InstallExecuteSequence&gt;
           &lt;Custom Action='PreInstallAction' Before='InstallInitialize'&gt;
              NOT Installed AND NOT PATCH
           &lt;/Custom&gt;
        &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p>But now ny customAction is called twice again...
  Is anything wrong with my condition? I s there any other solution?</p>