Class SingleRunner
Singleton version of BuildSystem.Utils.AdminRunner.SingleRunner._adminRunner
Inheritance
Namespace: BuildSystem.Utils.AdminRunner
Assembly: BuildSystem.Utils.AdminRunner.dll
Syntax
public static class SingleRunner : Object
Methods
Execute(ILogger?, string, string, out int, int)
Execute program. Run with admin params if need. Run through BuildSystem.Utils.AdminRunner.SingleRunner._adminRunner if it is possible to avoid asking admin access
Declaration
public static bool Execute(ILogger? logger, string filePath, string arguments, out int exitCode, int milliseconds = 60000)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | Logging object |
string | filePath | Running program |
string | arguments | Arguments of running program |
int | exitCode | Exit code of program |
int | milliseconds | Value provided to System.Diagnostics.Process.WaitForExit |
Returns
Type | Description |
---|---|
bool |
Execute(ILogger?, string, string)
Execute program. Run with admin params if need. Run through BuildSystem.Utils.AdminRunner.SingleRunner._adminRunner if it is possible to avoid asking admin access
Declaration
public static bool Execute(ILogger? logger, string filePath, string arguments)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | Logging object |
string | filePath | Running program |
string | arguments | Arguments of running program |
Returns
Type | Description |
---|---|
bool | Flag that there is no errors |
ExecuteWithoutAdminRights(ILogger?, string, string, out int, int)
Calls Execute(ILogger?, string, string) but without admin rights. This method exists only fot testing the main one. Its code must be same as main.
Declaration
public static bool ExecuteWithoutAdminRights(ILogger? logger, string filePath, string arguments, out int exitCode, int milliseconds = 60000)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | Logging object |
string | filePath | Running program |
string | arguments | Arguments of running program |
int | exitCode | Exit code of program |
int | milliseconds | Value provided to System.Diagnostics.Process.WaitForExit |
Returns
Type | Description |
---|---|
bool |
Stop()
Finish admin process, so next request will start new process
Declaration
public static void Stop()