Class AdminRunner
Runs one instance with admin rights and then runs other programmes under this instance. That is why user get only one request for admin rights. It works this way:
- Run main program which listens IPC. This instance needs admin rights
- Send this program name of "what to run" and "arguments"
Inheritance
object
AdminRunner
Namespace: BuildSystem.Utils.AdminRunner
Assembly: BuildSystem.Utils.AdminRunner.dll
Syntax
public class AdminRunner : Object
Constructors
AdminRunner(bool)
Runs one instance with admin rights and then runs other programmes under this instance. That is why user get only one request for admin rights. It works this way:
- Run main program which listens IPC. This instance needs admin rights
- Send this program name of "what to run" and "arguments"
Declaration
public AdminRunner(bool adminAccess = true)
Parameters
Type | Name | Description |
---|---|---|
bool | adminAccess | Server will be started with admin rights. The false value exists for tests |
Properties
ServiceId
Id of process of server
Declaration
public Nullable<int> ServiceId { get; }
Property Value
Type | Description |
---|---|
System.Nullable<><int> |
ServiceStarted
Flag that listener already started
Declaration
public bool ServiceStarted { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Finalize()
Stop service
Declaration
protected override void Finalize()
RunFile(ILogger?, string, string, int)
Run program under admin rights
Declaration
public int RunFile(ILogger? logger, string filePath, string arguments = "", int waitTime = -1)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | Logging object |
string | filePath | Running program |
string | arguments | Arguments of running program |
int | waitTime | Value provided to System.Diagnostics.Process.WaitForExit |
Returns
Type | Description |
---|---|
int |
Start()
Start program with admin rights. This instance will listen through IPC
Declaration
public void Start()
Stop()
Stop execution of listening program
Declaration
public void Stop()