|
PeanutButter
|
The Windows Service Utility contract. More...
Public Member Functions | |
| void | Start () |
| Start the service and wait for it to be running. | |
| void | Start (bool wait) |
| Start the service Explicitly wait or not for it to start. | |
| void | Stop () |
| Stop the service and wait for it to be running. | |
| void | Stop (bool wait) |
| Start the service Explicitly wait or not for it to stop. | |
| void | Stop (ControlOptions options) |
| Stop the service with the provided control options. | |
| void | Pause () |
| Pause the service, waiting for it to enter the paused state. | |
| void | Pause (bool wait) |
| Pause the service Explicitly wait or not for it to pause. | |
| void | Continue () |
| Continue the service, waiting for it to enter the continued state. | |
| void | Continue (bool wait) |
| Continue the service Explicitly wait or not for it to continue. | |
| void | ConfigureStartup (ServiceStartupTypes startupType) |
| Configure the service's startup type. | |
| void | Install () |
| Installs the service with automatic start. Will error if the service is already found by name. | |
| void | Install (ServiceStartupTypes startupType) |
| Install with the provided startup type. | |
| void | Uninstall () |
| Uninstalls the service. If the service is not found by name, does nothing. | |
| void | Uninstall (bool wait) |
| Uninstalls the service. If the service is not found by name, does nothing. Will wait for the uninstallation to complete. | |
| void | Uninstall (ControlOptions options) |
| More control over uninstallation. | |
| void | InstallAndStart () |
| Installs the service as AutoStart and starts it, waiting for the service to report that it's running. | |
| void | InstallAndStart (bool wait) |
| Install and start the service as AutoStarting, with control over whether to wait for the service to have properly started. | |
| void | InstallAndStart (ServiceStartupTypes startupType, bool wait) |
| Install and start the service, with control over whether to wait for the service to have properly started. | |
| void | Disable () |
| Disable the service from running. | |
| void | SetAutomaticStart () |
| Set the service to automatically start with the host system. | |
| void | SetManualStart () |
| Set the service to require manual start. | |
| KillServiceResult | KillService () |
| Kills the service, if running. | |
Properties | |
| string | ServiceName [get] |
| The name of the service, usable from, eg 'net stop {name}'. | |
| string | DisplayName [get] |
| The name displayed in the service manager (service.msc) | |
| string | ServiceExe [get] |
| The path to the service executable. | |
| string[] | Arguments [get] |
| The arguments that the service is started with. | |
| string | Commandline [get] |
| The full commandline for this service. | |
| ServiceState | State [get] |
| The current state of this service. | |
| ServiceStartupTypes | StartupType [get] |
| The startup type of the service. | |
| bool | IsDisabled [get] |
| Whether or not the service is disabled -> this is a shortcut to check the startup type vs the disabled startup type. | |
| bool | IsInstalled [get] |
| Whether or not the service is installed -> this is a shortcut to check startup type vs unknown. | |
| bool | IsRunning [get] |
| Whether or not the service is running. | |
| bool | IsPaused [get] |
| Whether or not the service is paused. | |
| bool | IsMarkedForDelete [get] |
| Test if the service is marked for deletion. | |
| bool | IsStoppable [get] |
| True if the service is in a stoppable state. | |
| bool | IsStartable [get] |
| True if the service is in a startable state. | |
| int | ServicePID [get] |
| The process id for a running process (0 when not running) | |
The Windows Service Utility contract.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.ConfigureStartup | ( | ServiceStartupTypes | startupType | ) |
Configure the service's startup type.
| startupType |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Continue | ( | ) |
Continue the service, waiting for it to enter the continued state.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Continue | ( | bool | wait | ) |
Continue the service Explicitly wait or not for it to continue.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Disable | ( | ) |
Disable the service from running.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Install | ( | ) |
Installs the service with automatic start. Will error if the service is already found by name.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Install | ( | ServiceStartupTypes | startupType | ) |
Install with the provided startup type.
| startupType |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.InstallAndStart | ( | ) |
Installs the service as AutoStart and starts it, waiting for the service to report that it's running.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.InstallAndStart | ( | bool | wait | ) |
Install and start the service as AutoStarting, with control over whether to wait for the service to have properly started.
| wait |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.InstallAndStart | ( | ServiceStartupTypes | startupType, |
| bool | wait ) |
Install and start the service, with control over whether to wait for the service to have properly started.
| startupType | |
| wait |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| KillServiceResult PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.KillService | ( | ) |
Kills the service, if running.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Pause | ( | ) |
Pause the service, waiting for it to enter the paused state.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Pause | ( | bool | wait | ) |
Pause the service Explicitly wait or not for it to pause.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.SetAutomaticStart | ( | ) |
Set the service to automatically start with the host system.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.SetManualStart | ( | ) |
Set the service to require manual start.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Start | ( | ) |
Start the service and wait for it to be running.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Start | ( | bool | wait | ) |
Start the service Explicitly wait or not for it to start.
| wait |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Stop | ( | ) |
Stop the service and wait for it to be running.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Stop | ( | bool | wait | ) |
Start the service Explicitly wait or not for it to stop.
| wait |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Stop | ( | ControlOptions | options | ) |
Stop the service with the provided control options.
| options |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Uninstall | ( | ) |
Uninstalls the service. If the service is not found by name, does nothing.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Uninstall | ( | bool | wait | ) |
Uninstalls the service. If the service is not found by name, does nothing. Will wait for the uninstallation to complete.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
| void PeanutButter.WindowsServiceManagement.IWindowsServiceUtil.Uninstall | ( | ControlOptions | options | ) |
More control over uninstallation.
| options |
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The arguments that the service is started with.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The full commandline for this service.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The name displayed in the service manager (service.msc)
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
Whether or not the service is disabled -> this is a shortcut to check the startup type vs the disabled startup type.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
Whether or not the service is installed -> this is a shortcut to check startup type vs unknown.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
Test if the service is marked for deletion.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
Whether or not the service is paused.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
Whether or not the service is running.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
True if the service is in a startable state.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
True if the service is in a stoppable state.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The path to the service executable.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The name of the service, usable from, eg 'net stop {name}'.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The process id for a running process (0 when not running)
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The startup type of the service.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.
|
get |
The current state of this service.
Implemented in PeanutButter.WindowsServiceManagement.NativeWindowsServiceUtil, and PeanutButter.WindowsServiceManagement.WindowsServiceUtil.