Method | Description | |
---|---|---|
GetServiceStatus ( string ServiceName ) : ServiceState |
Takes a service name and returns the
|
|
Install ( string ServiceName, string DisplayName, string FileName ) : void |
Takes a service name, a service display name and the path to the service executable and installs the windows service.
|
|
InstallAndStart ( string ServiceName, string DisplayName, string FileName ) : void |
Takes a service name, a service display name and the path to the service executable and installs / starts the windows service.
|
|
ServiceInstaller ( ) : System |
|
|
ServiceIsInstalled ( string ServiceName ) : bool |
Accepts a service name and returns true if the service with that service name exists
|
|
StartService ( string Name ) : void |
Takes a service name and starts it
|
|
StopService ( string Name ) : void |
Stops the provided windows service
|
|
Uninstall ( string ServiceName ) : void |
Takes a service name and tries to stop and then uninstall the windows serviceError
|
Method | Description | |
---|---|---|
CloseServiceHandle ( |
||
ControlService ( |
||
CreateService ( |
||
DeleteService ( |
||
GetServiceStatus ( |
Gets the service state by using the handle of the provided windows service
|
|
OpenSCManager ( ServiceManagerRights Rights ) : |
Opens the service manager
|
|
OpenSCManager ( string lpMachineName, string lpDatabaseName, ServiceManagerRights dwDesiredAccess ) : |
||
OpenService ( |
||
QueryServiceStatus ( |
||
StartService ( |
||
StartService ( |
Stars the provided windows service
|
|
StopService ( |
Stops the provided windows service
|
|
WaitForServiceStatus ( |
Returns true when the service status has been changes from wait status to desired status ,this method waits around 10 seconds for this operation.
|
public static GetServiceStatus ( string ServiceName ) : ServiceState | ||
ServiceName | string | The service name that we will check for his ServiceState |
return | ServiceState |
public static Install ( string ServiceName, string DisplayName, string FileName ) : void | ||
ServiceName | string | The service name that this service will have |
DisplayName | string | The display name that this service will have |
FileName | string | The path to the executable of the service |
return | void |
public static InstallAndStart ( string ServiceName, string DisplayName, string FileName ) : void | ||
ServiceName | string | The service name that this service will have |
DisplayName | string | The display name that this service will have |
FileName | string | The path to the executable of the service |
return | void |
public static ServiceIsInstalled ( string ServiceName ) : bool | ||
ServiceName | string | The service name that we will check for existence |
return | bool |
public static StartService ( string Name ) : void | ||
Name | string | The service name |
return | void |
public static StopService ( string Name ) : void | ||
Name | string | The service name that will be stopped |
return | void |
public static Uninstall ( string ServiceName ) : void | ||
ServiceName | string | The windows service name to uninstall |
return | void |