Index: tools/install/Installer.cs ================================================================== --- tools/install/Installer.cs +++ tools/install/Installer.cs @@ -4100,10 +4100,34 @@ { Version version = (Version)value; result = String.Format("v{0}", version); } + else if (type == typeof(ProcessStartInfo)) + { + ProcessStartInfo startInfo = (ProcessStartInfo)value; + + result = String.Format( + "fileName = {0}, arguments = {1}, workingDirectory = {2}, " + + "useShellExecute = {3}, redirectStandardOutput = {4}, " + + "redirectStandardError = {5}", startInfo.FileName, + startInfo.Arguments, startInfo.WorkingDirectory, + startInfo.UseShellExecute, startInfo.RedirectStandardOutput, + startInfo.RedirectStandardError); + } + else if (type == typeof(Process)) + { + Process process = (Process)value; + + result = process.Id.ToString(); + } + else if (type == typeof(DataReceivedEventArgs)) + { + DataReceivedEventArgs eventArgs = (DataReceivedEventArgs)value; + + result = eventArgs.Data; + } else { result = value.ToString(); if (result.Length == 0) @@ -6187,12 +6211,12 @@ { Process process = sender as Process; TraceOps.DebugAndTrace(TracePriority.Medium, debugCallback, traceCallback, String.Format( - VsDevEnvSetupFormat, process.Id, e.Data), - traceCategory); + VsDevEnvSetupFormat, ForDisplay(process), + ForDisplay(e)), traceCategory); } /////////////////////////////////////////////////////////////////////// private static void VsDevEnvSetupErrorDataReceived( @@ -6202,12 +6226,12 @@ { Process process = sender as Process; TraceOps.DebugAndTrace(TracePriority.Medium, debugCallback, traceCallback, String.Format( - VsDevEnvSetupFormat, process.Id, e.Data), - traceCategory); + VsDevEnvSetupFormat, ForDisplay(process), + ForDisplay(e)), traceCategory); } /////////////////////////////////////////////////////////////////////// private static bool AddVsDevEnvSetup( @@ -6256,36 +6280,37 @@ startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardError = true; Process process = new Process(); + + process.StartInfo = startInfo; process.OutputDataReceived += new DataReceivedEventHandler( VsDevEnvSetupOutputDataReceived); process.ErrorDataReceived += new DataReceivedEventHandler( VsDevEnvSetupErrorDataReceived); if (verbose) TraceOps.DebugAndTrace(TracePriority.Highest, - debugCallback, traceCallback, String.Format( - "fileName = {0}, arguments = {1}, " + - "workingDirectory = {2}, useShellExecute = {3}, " + - "redirectStandardOutput = {4}, " + - "redirectStandardError = {5}", ForDisplay( - startInfo.FileName), ForDisplay(startInfo.Arguments), - ForDisplay(startInfo.WorkingDirectory), ForDisplay( - startInfo.UseShellExecute), ForDisplay( - startInfo.RedirectStandardOutput), ForDisplay( - startInfo.RedirectStandardError)), traceCategory); + debugCallback, traceCallback, ForDisplay(startInfo), + traceCategory); // // NOTE: In 'what-if' mode, do not actually start the process. // if (!whatIf) { process.Start(); + + if (verbose) + TraceOps.DebugAndTrace(TracePriority.Highest, + debugCallback, traceCallback, String.Format( + "process = {0}", ForDisplay(process)), + traceCategory); + process.BeginOutputReadLine(); process.BeginErrorReadLine(); process.WaitForExit(); }