title: WiX Custom Bootstrapper - Single Instance Check
body: <p>I use the following code to check if a Single Instance of the CustomBA is already running in the Run block of the CustomBA.</p>
  
  <p>When the user starts the "setup.exe" (CustomBA) by double clicking it the code below returns true which is the expected behaviour.</p>
  
  <p>However when the user right clicks and starts it as administrator the code returns false. Why is that?</p>
  
  <pre class="lang-cs prettyprint-override"><code>private bool IsSingleInstanceOfSetupRunning()
  {
      bool result = true;
  
      Process currentProcess = Process.GetCurrentProcess();
      if (Process.GetProcessesByName(currentProcess.ProcessName).Length &gt; 1)
      {
          result = false;
      }
  
      return result;
  }
  </code></pre>