mirror of https://github.com/winsw/winsw
Merge pull request #321 from jeacott1/hidewindow
Add a new `hidewindow` option to suppress windows popup on legacy platformspull/331/head
commit
831c7fbb7e
|
@ -453,7 +453,8 @@ namespace winsw
|
||||||
priority: _descriptor.Priority,
|
priority: _descriptor.Priority,
|
||||||
callback: processCompletionCallback,
|
callback: processCompletionCallback,
|
||||||
logHandler: logHandler,
|
logHandler: logHandler,
|
||||||
redirectStdin: redirectStdin);
|
redirectStdin: redirectStdin,
|
||||||
|
hideWindow: _descriptor.HideWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int Main(string[] args)
|
public static int Main(string[] args)
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace winsw.Configuration
|
||||||
public string Caption { get { return null; } }
|
public string Caption { get { return null; } }
|
||||||
public string Description { get { return null; } }
|
public string Description { get { return null; } }
|
||||||
public string Executable { get { return null; } }
|
public string Executable { get { return null; } }
|
||||||
|
public bool HideWindow { get { return false; } }
|
||||||
|
|
||||||
public string ExecutablePath
|
public string ExecutablePath
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace winsw.Configuration
|
||||||
string Description { get; }
|
string Description { get; }
|
||||||
string Executable { get; }
|
string Executable { get; }
|
||||||
string ExecutablePath { get; }
|
string ExecutablePath { get; }
|
||||||
|
bool HideWindow { get; }
|
||||||
|
|
||||||
// Installation
|
// Installation
|
||||||
bool AllowServiceAcountLogonRight { get; }
|
bool AllowServiceAcountLogonRight { get; }
|
||||||
|
|
|
@ -175,6 +175,13 @@ namespace winsw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool HideWindow
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
return SingleBoolElement("hidewindow", Defaults.HideWindow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optionally specify a different Path to an executable to shutdown the service.
|
/// Optionally specify a different Path to an executable to shutdown the service.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -132,13 +132,13 @@ namespace winsw.Util
|
||||||
/// <param name="logHandler">Log handler. If enabled, logs will be redirected to the process and then reported</param>
|
/// <param name="logHandler">Log handler. If enabled, logs will be redirected to the process and then reported</param>
|
||||||
/// <param name="redirectStdin">Redirect standard input</param>
|
/// <param name="redirectStdin">Redirect standard input</param>
|
||||||
public static void StartProcessAndCallbackForExit(Process processToStart, String executable = null, string arguments = null, Dictionary<string, string> envVars = null,
|
public static void StartProcessAndCallbackForExit(Process processToStart, String executable = null, string arguments = null, Dictionary<string, string> envVars = null,
|
||||||
string workingDirectory = null, ProcessPriorityClass? priority = null, ProcessCompletionCallback callback = null, bool redirectStdin = true, LogHandler logHandler = null)
|
string workingDirectory = null, ProcessPriorityClass? priority = null, ProcessCompletionCallback callback = null, bool redirectStdin = true, LogHandler logHandler = null, bool hideWindow = false)
|
||||||
{
|
{
|
||||||
var ps = processToStart.StartInfo;
|
var ps = processToStart.StartInfo;
|
||||||
ps.FileName = executable ?? ps.FileName;
|
ps.FileName = executable ?? ps.FileName;
|
||||||
ps.Arguments = arguments ?? ps.Arguments;
|
ps.Arguments = arguments ?? ps.Arguments;
|
||||||
ps.WorkingDirectory = workingDirectory ?? ps.WorkingDirectory;
|
ps.WorkingDirectory = workingDirectory ?? ps.WorkingDirectory;
|
||||||
ps.CreateNoWindow = false;
|
ps.CreateNoWindow = hideWindow;
|
||||||
ps.UseShellExecute = false;
|
ps.UseShellExecute = false;
|
||||||
ps.RedirectStandardInput = redirectStdin;
|
ps.RedirectStandardInput = redirectStdin;
|
||||||
ps.RedirectStandardOutput = logHandler != null;
|
ps.RedirectStandardOutput = logHandler != null;
|
||||||
|
|
Loading…
Reference in New Issue