func (c *Concierge) ServiceExists() (bool, error) {
	m, err := mgr.Connect()
	if err != nil {
		return false, errors.Wrap(err, "could not open SCM")
	}
	defer func(m *mgr.Mgr) {
		_ = m.Disconnect()
	}(m)

	services, err := m.ListServices()
	if err != nil {
		return false, errors.Wrap(err, "could not list services.")
	}

	for _, service := range services {
		if service == c.name {
			return true, nil
		}
	}

	return false, nil
}
// ServiceExists retrieves the Windows service if exists.
ServiceExists retrieves the Windows service if exists.
// ServiceExists retrieves the Windows service if exists .
func (c *Concierge) ServiceExists() (bool, error) {
	m, err := mgr.Connect()
	if err != nil {
		return false, errors.Wrap(err, "could not open SCM")
	}
	defer func(m *mgr.Mgr) {
		_ = m.Disconnect()
	}(m)
	services, err := m.ListServices()
	if err != nil {
		return false, errors.Wrap(err, "could not list services.")
	}
	for _, service := range services {
		if service == c.name {
			return true, nil
		}
	}
	return false, nil
}
func ( c * Concierge ) ServiceExists ( ) ( bool , error ) { m , err := mgr . Connect ( ) if err != nil { return false , errors . Wrap ( err , " " ) } defer func ( m * mgr . Mgr ) { _ = m . Disconnect ( ) } ( m ) services , err := m . ListServices ( ) if err != nil { return false , errors . Wrap ( err , " " ) } for _ , service := range services { if service == c . name { return true , nil } } return false , nil }
ServiceExists retrieves the Windows service if exists.
ServiceExists retrieves the Windows service if exists .