using System; using System.ComponentModel; using System.Configuration.Install; using System.ServiceProcess; //Tilføj System.Configuration.Install assembly reference // Denne cklasse bruges namespace DaoMqPump2 { //[RunInstaller(true)] public class PumpServiceInstaller : System.Configuration.Install.AssemblyInstaller { public PumpServiceInstaller() { ServiceProcessInstaller process = new ServiceProcessInstaller(); process.Account = ServiceAccount.LocalSystem; ServiceInstaller serviceAdmin = new ServiceInstaller(); serviceAdmin.StartType = ServiceStartMode.Manual; serviceAdmin.ServiceName = "DaoMqPump2"; serviceAdmin.DisplayName = "DAO MQ Pump v2"; // Microsoft didn't add the ability to add a // description for the services we are going to install // To work around this we'll have to add the // information directly to the registry but I'll leave // this exercise for later. // now just add the installers that we created to our // parents container, the documentation // states that there is not any order that you need to // worry about here but I'll still // go ahead and add them in the order that makes sense. Installers.Add( process ); Installers.Add( serviceAdmin ); } } }