public WindowsServiceManager()
{
var processInstaller = new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem};
var serviceInstaller = new ServiceInstaller
{
StartType = ServiceStartMode.Automatic,
ServiceName = AppSettings.ServiceName
};
while (Installers.Count > 0)
{
Installers.RemoveAt(0);
}
Installers.AddRange(serviceInstaller.Installers);
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}