title: WiX Service Install with user credentials or LocalSystem depending on UI input
body: <p>Below is a section of my .wxs installer file which installed my service. I have a WiX UI dialog where the user can either choose to install the service to run under the <code>LocalSystem</code> account or input the credentials of the account they want. The UI has two text boxes (one bound to the <code>ACCOUNT</code> property and one to the <code>PASSWORD</code> property) and a checkbox that is bound to a property called <code>USELOCALSYSTEMACCOUNT</code>.</p>
  
  <p>Individually, these service installers work fine, you can see both <code>ServiceInstall</code> sections below. However I want the installer to install the service with the user input credentials if <code>USELOCALSYSTEMACCOUNT</code> is not set to 1, or to use the <code>LocalSystem</code> account if <code>USELOCALSYSTEMACCOUNT</code> is set to 1, but I am unsure how to do this. the <code>Condition</code> tag doesn't work within a <code>ServiceInstall</code> tag so I'm a bit lost on how to achieve this.</p>
  
  <p>WiX component section below:</p>
  
  <pre><code>&lt;Component Id='MainExe' Guid='*'&gt;
    &lt;File Id='MainService' 
          Name='MyService.exe'
          Source='$(var.ServiceRoot2)\SA.MyService.exe'/&gt;
      &lt;ServiceInstall Id='MyService' 
                      Type='ownProcess' 
                      Vital='yes' Name='MyService' 
                      Name='$(var.HumanProductName)' 
                      Description='$(var.ProductDescription)' 
                      Start='demand' 
                      Account='[ACCOUNT]' 
                      Password='[PASSWORD]' 
                      ErrorControl='ignore' 
                      Interactive='no'/&gt;
      &lt;ServiceInstall Id='MyService' 
                      Type='ownProcess' 
                      Vital='yes' 
                      Name='$(var.HumanProductName)'  
                      Description='$(var.ProductDescription)' 
                      Start='demand' 
                      Account='LocalSystem' 
                      ErrorControl='ignore' 
                      Interactive='no'/&gt;
      &lt;ServiceControl Id='MyServiceServiceControl' 
                      Stop='both' 
                      Remove='both' 
                      Name='$(var.HumanProductName)' 
                      Wait='yes'/&gt;
  &lt;/Component&gt;
  </code></pre>