public void Uninstall() { using (WinServiceNative native = new WinServiceNative()) { native.Lock(); native.Open(this.ServiceName); native.Delete(); } }
public new void Stop() { using (WinServiceNative native = new WinServiceNative()) { native.Lock(); native.Open(this.ServiceName); ApiStructs.ServiceStatus ss = native.QueryStatus(); if (ss.CurrentState != ApiEnums.ServiceState.SERVICE_RUNNING) { throw new Win32Exception("Cannot start the service because it is not running"); } } }