title: WIX Installer do not run C# process properly
body: <p>We have a big WIX Installer. After the installation, there are around 2800 scripts that should be run to upgrade the database. For that purpose, a special application is created. It just goes to the SQL machine, installs prerequisites like SQL SMO and SQL Sys Clr Types, and executes scripts. This small application is run in custom actions in WIX. Logically, it should be run with elevated privileges. In this custom action, I am using c# Processes to start the app. However, I have tried everything, and the application is still not working properly. It opens the app and app tries to install prerequisites and just exits - nothing is installed. What I have tried:
  1. Running process with elevated privileges (process.StartInfo.UseShellExecute = true)
  2. Running process with user privileges (standardinput/output with UseShellExecute=false)
  3. Running the app with a batch file.</p>
  
  <p>Overall process should be as following:
  Installer is run with elevated privileges -> After installation, special application is run to upgrade the database -> the app installs prerequisites -> the app executes scripts.</p>
  
  <p>The interesting part is that application is working properly when I do it manually with cmd. However, when installer's custom action opens cmd.exe (c# Process) and it is still waiting, then manually opening application via cmd is not working. In other words, I have cmd (with elevated rights) opened by installer and another cmd opened by myself manually. Then, manual running the application is not working. As soon as I close the cmd opened by the installer, and run manually the application via cmd that was opened by myself, then again everything is fine, everything is working.</p>
  
  <p>I need a help how can I fix this?</p>
  
  <p>P.S. The installer's prerequisites cannot be extracted and installed separately. We do not have source code of upgrade database application.</p>