using System; using System.ComponentModel; using System.Configuration.Install; using System.ServiceProcess; namespace WorkhorseWhip { [RunInstaller(true)] public class Harness : Installer { public Harness() { ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller(); ServiceInstaller serviceInstaller = new ServiceInstaller(); //# Service Account Information serviceProcessInstaller.Account = ServiceAccount.LocalSystem; serviceProcessInstaller.Username = null; serviceProcessInstaller.Password = null; //# Service Information serviceInstaller.DisplayName = "Workhorse Whip Service"; serviceInstaller.Description = "Prevents the machine from going into sleep, standby or hibernation"; serviceInstaller.StartType = ServiceStartMode.Automatic; //# This must be identical to the WindowsService.ServiceBase name //# set in the constructor of WindowsService.cs serviceInstaller.ServiceName = "Workhorse Whip"; this.Installers.Add(serviceProcessInstaller); this.Installers.Add(serviceInstaller); } } }