diff --git a/src/WinSW.Core/Util/ProcessHelper.cs b/src/WinSW.Core/Util/ProcessHelper.cs index 1be3550..66e58c7 100644 --- a/src/WinSW.Core/Util/ProcessHelper.cs +++ b/src/WinSW.Core/Util/ProcessHelper.cs @@ -185,7 +185,6 @@ namespace WinSW.Util /// Working directory /// Priority /// Completion callback. If null, the completion won't be monitored - /// Redirect standard input /// Log handler. If enabled, logs will be redirected to the process and then reported public static void StartProcessAndCallbackForExit( Process processToStart, @@ -195,7 +194,6 @@ namespace WinSW.Util string? workingDirectory = null, ProcessPriorityClass? priority = null, ProcessCompletionCallback? callback = null, - bool redirectStdin = true, LogHandler? logHandler = null, bool hideWindow = false) { @@ -205,7 +203,6 @@ namespace WinSW.Util ps.WorkingDirectory = workingDirectory ?? ps.WorkingDirectory; ps.CreateNoWindow = hideWindow; ps.UseShellExecute = false; - ps.RedirectStandardInput = redirectStdin; ps.RedirectStandardOutput = logHandler?.OutFileDisabled == false; ps.RedirectStandardError = logHandler?.ErrFileDisabled == false; diff --git a/src/WinSW/WrapperService.cs b/src/WinSW/WrapperService.cs index a0587e7..afe9938 100644 --- a/src/WinSW/WrapperService.cs +++ b/src/WinSW/WrapperService.cs @@ -330,10 +330,8 @@ namespace WinSW this.ExtensionManager.FireOnWrapperStarted(); var executableLogHandler = this.CreateExecutableLogHandler(); - this.StartProcess(this.process, startArguments, this.descriptor.Executable, executableLogHandler, true); + this.StartProcess(this.process, startArguments, this.descriptor.Executable, executableLogHandler); this.ExtensionManager.FireOnProcessStarted(this.process); - - this.process.StandardInput.Close(); // nothing for you to read! } /// @@ -371,7 +369,7 @@ namespace WinSW executable ??= this.descriptor.Executable; // TODO: Redirect logging to Log4Net once https://github.com/kohsuke/winsw/pull/213 is integrated - this.StartProcess(stopProcess, stopArguments, executable, null, false); + this.StartProcess(stopProcess, stopArguments, executable, null); Log.Debug("WaitForProcessToExit " + this.process.Id + "+" + stopProcess.Id); this.WaitForProcessToExit(this.process); @@ -449,7 +447,7 @@ namespace WinSW ServiceApis.SetServiceStatus(handle, this.wrapperServiceStatus); } - private void StartProcess(Process processToStart, string arguments, string executable, LogHandler? logHandler, bool redirectStdin) + private void StartProcess(Process processToStart, string arguments, string executable, LogHandler? logHandler) { // Define handler of the completed process void OnProcessCompleted(Process proc) @@ -496,7 +494,6 @@ namespace WinSW priority: this.descriptor.Priority, callback: OnProcessCompleted, logHandler: logHandler, - redirectStdin: redirectStdin, hideWindow: this.descriptor.HideWindow); } }