/// <summary> /// Rollback any changes /// </summary> public bool Rollback(SanteDBConfiguration configuration) { var appSection = configuration.GetSection <ApplicationServiceContextConfigurationSection>(); foreach (var svc in SERVICE_TYPES.Reverse()) { appSection.ServiceProviders.RemoveAll(o => o.Type == svc); } return(true); }
/// <summary> /// Execute the installation /// </summary> public bool Execute(SanteDBConfiguration configuration) { var appSection = configuration.GetSection <ApplicationServiceContextConfigurationSection>(); int i = 0; foreach (var svc in SERVICE_TYPES.Reverse()) { this.ProgressChanged?.Invoke(this, new ProgressChangedEventArgs((float)i++ / SERVICE_TYPES.Length, $"Installing {svc.Name}")); appSection.ServiceProviders.RemoveAll(o => o.Type == svc); appSection.ServiceProviders.Insert(0, new TypeReferenceConfiguration(svc)); } return(true); }
public static extern ServiceControlHandle CreateService(ServiceControlHandle serviceControlManagerHandler, string lpSvcName, string lpDisplayName, SERVICE_ACCESS dwDesiredAccess, SERVICE_TYPES dwServiceType, SERVICE_START_TYPES dwStartType, SERVICE_ERROR_CONTROL dwErrorControl, string lpPathName, string lpLoadOrderGroup, IntPtr lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword);
public override void Parse(byte[] data, int offset) { base.Parse(data, offset); this.serviceType = (SERVICE_TYPES)data[offset + 2]; this.serviceProviderNameLength = data[offset + 3]; char[] serviceProviderName = new char[this.serviceProviderNameLength]; Array.Copy(data, offset + 4, serviceProviderName, 0, this.serviceProviderNameLength); this.serviceProviderName = new string(serviceProviderName); this.serviceNameLength = data[offset + 4 + this.serviceProviderNameLength]; char[] serviceName = new char[this.serviceNameLength]; Array.Copy(data, offset + 5 + this.serviceProviderNameLength, serviceName, 0, this.serviceNameLength); this.serviceName = new string(serviceName); }
public override void Parse(byte[] data, int offset) { base.Parse(data, offset); this.serviceType = (SERVICE_TYPES)data[offset + 2]; this.serviceProviderNameLength = data[offset + 3]; char[] serviceProviderName = new char[this.serviceProviderNameLength]; Array.Copy(data, offset + 4, serviceProviderName, 0, this.serviceProviderNameLength); this.serviceProviderName = new string(serviceProviderName); this.serviceNameLength = data[offset + 4 + this.serviceProviderNameLength]; char[] serviceName = new char[this.serviceNameLength]; Array.Copy(data, offset + 5 + this.serviceProviderNameLength, serviceName, 0, this.serviceNameLength); foreach (var c in serviceName) if (c >= 32) this.serviceName += c; //this.serviceName = new string(serviceName); }