title: Install SQL Server silently from application setup file
body: <p>As part of installing my application (WPF application), need to install SQL Server as well as a prerequisite. So when the user choose the option to install SQL Server, during the course of application installation, it need to get installed silently using the configuration.ini file provided with the setup.</p>
  
  <p>So what i did was prepare a batch file called "InstallSQL.bat" through code which has the command to execute SQL server.</p>
  
  <p>Now when the user choose to install SQL server, from installation code, the batch file  is to be executed. The code is as below</p>
  
  <pre><code>        int ExitCode;
          ProcessStartInfo ProcessInfo;
          Process process;            
  
          ProcessInfo = new ProcessStartInfo(batchFilePath);
          ProcessInfo.CreateNoWindow = true;
          ProcessInfo.UseShellExecute = false;
  
          ProcessInfo.WorkingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
          // *** Redirect the output ***
          ProcessInfo.RedirectStandardError = true;
          ProcessInfo.RedirectStandardOutput = true;
          process = Process.Start(ProcessInfo);
          process.WaitForExit();
          MessageBox.Show("ExitCode: " + process.ExitCode);
  </code></pre>
  
  <p>When execute the setup, at the point of SQL Server installation, the SQL Server setup files are extracted and a console window opens up indicating installation is in progress.
  The issue is, after some time in this console window a message appears saying "Process is terminated due to stackoverflowexception". Can someone please help me with an alternative for installing SQL Server silently (without user interaction).</p>
  
  <p>Thanks
  Nishitha</p>