Class ExeRunner
Run .exe file with arguments. Also logs all output
Inheritance
object
ExeRunner
Namespace: BuildSystem.Utils.Executor
Assembly: BuildSystem.Utils.Executor.dll
Syntax
public class ExeRunner : Object
Constructors
ExeRunner(ILogger?, string, string, bool)
Run .exe file with arguments. Also logs all output
Declaration
public ExeRunner(ILogger? logger, string fileName, string arguments, bool runAsAdmin = false)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | Logging object |
string | fileName | Running program |
string | arguments | Params provided to running program |
bool | runAsAdmin | Run with admin rights |
Properties
Arguments
Arguments for run
Declaration
public string Arguments { get; }
Property Value
Type | Description |
---|---|
string |
FileName
Running program
Declaration
public string FileName { get; }
Property Value
Type | Description |
---|---|
string |
Logger
Logging object
Declaration
public ILogger? Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
Loggers
List of additional loggers
Declaration
public List<ILogger> Loggers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<><ILogger> |
ProcessDescription
Description of process - would be logged as verbose level message
Declaration
public string? ProcessDescription { get; set; }
Property Value
Type | Description |
---|---|
string |
RunAsAdmin
Run with admin rights
Declaration
public bool RunAsAdmin { get; }
Property Value
Type | Description |
---|---|
bool |
WorkingDirectory
Value for ProcessStartInfo.WorkingDirectory
Declaration
public string WorkingDirectory { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Execute(int)
Execute program from constructor params
Declaration
public bool Execute(int milliseconds = -1)
Parameters
Type | Name | Description |
---|---|---|
int | milliseconds | Value provided to System.Diagnostics.Process.WaitForExit |
Returns
Type | Description |
---|---|
bool |
Execute(out int, int)
Execute program from constructor params
Declaration
public bool Execute(out int exitCode, int milliseconds = -1)
Parameters
Type | Name | Description |
---|---|---|
int | exitCode | Exit code of running program |
int | milliseconds | Value provided to System.Diagnostics.Process.WaitForExit |
Returns
Type | Description |
---|---|
bool |