title: How to prevent MSI error: Another program is being installed?
body: <p>I wrote a little PowerShell script that invokes different MSI files to install software. Sometimes I got the following error from Windows Installer:</p>
  
  <blockquote>
    <p>Another program is being installed. Please wait until that installation is complete, and then try installing this software again.</p>
  </blockquote>
  
  <p>How could I prevent this error before I invoke the MSI files? I tried to associate this with the process TrustedInstaller. I thought that the process would come up when the PC is installing something that blocks my installation. But unfortunately, sometimes my installations work fine although the process is running. Is there a definitive indication which could be caught with PS?</p>