func (c *Concierge) Disable() error {
	var service *mgr.Service
	ok, err := c.ServiceExists()
	if err != nil {
		return errors.Wrap(err, "error checking if the service exists")
	}
	if !ok {
		return errors.Errorf("service %s not found", c.path)
	}

	if service, err = c.fetchService(); err != nil {
		return errors.Wrap(err, "error fetching the service")
	}
	defer service.Close()

	if _, err := service.Control(svc.Stop); err != nil {
		return errors.Wrap(err, "error stopping the service")
	}
	return nil
}
// Disable will stop the Windows Service.
Disable will stop the Windows Service.
// Disable will stop the Windows Service .
func (c *Concierge) Disable() error {
	var service *mgr.Service
	ok, err := c.ServiceExists()
	if err != nil {
		return errors.Wrap(err, "error checking if the service exists")
	}
	if !ok {
		return errors.Errorf("service %s not found", c.path)
	}
	if service, err = c.fetchService(); err != nil {
		return errors.Wrap(err, "error fetching the service")
	}
	defer service.Close()
	if _, err := service.Control(svc.Stop); err != nil {
		return errors.Wrap(err, "error stopping the service")
	}
	return nil
}
func ( c * Concierge ) Disable ( ) error { var service * mgr . Service ok , err := c . ServiceExists ( ) if err != nil { return errors . Wrap ( err , " " ) } if ! ok { return errors . Errorf ( " " , c . path ) } if service , err = c . fetchService ( ) ; err != nil { return errors . Wrap ( err , " " ) } defer service . Close ( ) if _ , err := service . Control ( svc . Stop ) ; err != nil { return errors . Wrap ( err , " " ) } return nil }
Disable will stop the Windows Service.
Disable will stop the Windows Service .