I am starting an installer from my application and then synchronously waiting for it to complete.
Process installerProcess = Process.Start("TheProcessName");
// Must EnableRaisingEvents before calling synchronous method WaitForExit
// according to MSDN documentation.
installerProcess.EnableRaisingEvents = true;
installerProcess.WaitForExit();
My application needs to know if this installer completed successfully or not. If the user cancelled it or it failed for any reason, I need to find out.
I tried the ExitCode
property of the process thinking that '0' would signify success and all other codes would signify failure but it showed the same exit code for a successful or unsuccessful install so now I am stumped. Any ideas? Or is there a better way of doing this than I am currently doing it?