private static void Launch(LaunchArgs launchArgs, bool waitForExit)
{
try
{
Process process = Process.Start(launchArgs.Program, launchArgs.Arguments);
if (waitForExit)
{
process.WaitForExit();
}
}
catch (Win32Exception e)
{
throw new Exception(
"Unable to launch: {0} with arguments {1}\nError Message: {2}".FormatWith(
launchArgs.Program,
launchArgs.Arguments,
e.Message),
e);
}
}
}