Example #1
0
        /// <summary>
        /// This method creates the service and service process installer based on the information passed in the ServiceInstallerAttribute class.
        /// </summary>
        protected virtual void InitializeService(ServiceInstallerAttribute servAttr)
        {
            ServiceProcessInstaller serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            ServiceInstaller serviceInstaller = new System.ServiceProcess.ServiceInstaller();

            // 
            // serviceInstaller
            // 
            serviceInstaller.DisplayName = servAttr.DisplayName;
            serviceInstaller.ServiceName = servAttr.ServiceName;
            serviceInstaller.Description = servAttr.Description;
            serviceInstaller.StartType = servAttr.StartMode;

            //this.serviceInstaller.DisplayName = "Budubu Analysis Engine";
            //this.serviceInstaller.ServiceName = "BudubuAnalysisEngine";
            //this.serviceInstaller.Description = "This is the Snagsta.com analysis service.";
            //this.serviceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;

            // 
            // serviceProcessInstaller
            // 
            serviceProcessInstaller.Account = servAttr.Account;
            serviceProcessInstaller.Username = servAttr.Username;
            serviceProcessInstaller.Password = servAttr.Password;

            // 
            // ProjectInstaller
            // 
            this.Installers.AddRange(
                new System.Configuration.Install.Installer[] { serviceProcessInstaller, serviceInstaller }
                );

        }
Example #2
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
     this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
     //
     // serviceProcessInstaller1
     //
     this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller1.Password = null;
     this.serviceProcessInstaller1.Username = null;
     //
     // serviceInstaller1
     //
     this.serviceInstaller1.ServiceName = "XPLLogger";
     this.serviceInstaller1.ServicesDependedOn = new string[] {
                                                                  ""};
     this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
     this.serviceInstaller1.BeforeUninstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_BeforeUninstall);
     this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                                                                               this.serviceProcessInstaller1,
                                                                               this.serviceInstaller1});
 }
        private void InitializeComponent()
        {
            this.serviceInstaller = new global::System.ServiceProcess.ServiceInstaller();
            this.serviceProcessInstaller = new ServiceProcessInstaller();

            //
            // serviceInstaller
            //
            this.serviceInstaller.Description = "Graphite System Monitoring";
            this.serviceInstaller.DisplayName = "Graphite System Monitoring";
            this.serviceInstaller.ServiceName = "GraphiteSystemMonitoring";
            this.serviceInstaller.StartType = ServiceStartMode.Automatic;

            //
            // serviceProcessInstaller
            //
            this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            this.serviceProcessInstaller.Password = null;
            this.serviceProcessInstaller.Username = null;

            //
            // ServiceInstaller
            //
            this.Installers.AddRange(new Installer[]
            {
                this.serviceInstaller,
                this.serviceProcessInstaller
            });
        }
Example #4
0
        /// <summary>
        /// 安装
        /// </summary>
        public ProjectInstaller()
        {
            InitializeComponent(); //在安装中取得配置中的名字必须。
            Committed += ServiceInstallerCommitted;

            var serviceName = ConfigurationManager.AppSettings["ServiceName"].Trim();
            var displayName = ConfigurationManager.AppSettings["ServiceDisplayName"].Trim();
            var desc = ConfigurationManager.AppSettings["ServiceDescription"].Trim();
            if (!string.IsNullOrEmpty(serviceName)) ConfigServiceName = serviceName;
            if (!string.IsNullOrEmpty(displayName)) DisplayName = displayName;
            if (!string.IsNullOrEmpty(desc)) ConfigDescription = desc;

            var processInstaller = new ServiceProcessInstaller { Account = ServiceAccount.LocalSystem };
            var serviceInstaller = new ServiceInstaller
            {
                //自动启动服务,手动的话,每次开机都要手动启动。
                StartType = ServiceStartMode.Automatic,

                DisplayName = DisplayName,
                ServiceName = ConfigServiceName,
                Description = ConfigDescription
            };

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
        public ServiceDeploy()
        {
            string serviceName = Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location);

            //string[] splitValues = serviceName.Split('.');

            //string displayName = "RestServiceHost - " + splitValues[splitValues.Length - 1];
            string displayName = "RestServiceHost - TestService";

            var processInstaller = new ServiceProcessInstaller();
            var serviceInstaller = new ServiceInstaller();

            //set the privileges
            processInstaller.Account = ServiceAccount.User;

            serviceInstaller.DisplayName = displayName;
            serviceInstaller.StartType = ServiceStartMode.Automatic;
            serviceInstaller.DelayedAutoStart = true;
            serviceInstaller.Description = "Seld Hosted Rest Service";

            //must be the same as what was set in Program's constructor
            serviceInstaller.ServiceName = serviceName;
            this.Installers.Add(processInstaller);
            this.Installers.Add(serviceInstaller);
        }
Example #6
0
 public ServiceBusInstaller()
 {
     process = new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem};
     service = new ServiceInstaller {ServiceName = "WCF Service Bus"};
     Installers.Add(process);
     Installers.Add(service);
 }
Example #7
0
        public PollServerInstaller()
        {
            InitializeComponent();

            ServiceProcessInstaller serviceProcessInstaller =
                               new ServiceProcessInstaller();
            ServiceInstaller serviceInstaller = new ServiceInstaller();

            //# Service Account Information

            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;

            //# Service Information

            serviceInstaller.DisplayName = "ILS PollServer";
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            //# This must be identical to the WindowsService.ServiceBase name

            //# set in the constructor of WindowsService.cs

            serviceInstaller.ServiceName = "PollServer";

            this.Installers.Add( serviceProcessInstaller );
            this.Installers.Add( serviceInstaller );
        }
Example #8
0
        public Installer()
        {
            InitializeComponent();

            string name = "WordGuessServer";

            this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
            //
            // serviceProcessInstaller1
            //
            this.serviceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.serviceProcessInstaller1.Password = null;
            this.serviceProcessInstaller1.Username = null;
            //
            // serviceInstaller1
            //
            string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.serviceInstaller1.Description = string.Format("{0} - {1}", name, version);
            this.serviceInstaller1.DisplayName = name;
            this.serviceInstaller1.ServiceName = name;

            this.serviceInstaller1.ServicesDependedOn = new string[] { "" };
            //
            // Installer
            //
            this.Installers.AddRange(new System.Configuration.Install.Installer[]
            {
                this.serviceProcessInstaller1,
                this.serviceInstaller1
            }
                                     );
        }
Example #9
0
        /// <summary>
        /// Public Constructor for WindowsServiceInstaller.
        /// - Put all of your Initialization code here.
        /// </summary>
        public WindowsServiceInstaller()
        {
            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 ="IMES.WatchFolder.Service";
            serviceInstaller.Description = "IMES Watch Folder Service "; 
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            // This must be identical to the WindowsService.ServiceBase name
            // set in the constructor of WindowsService.cs
            //serviceInstaller.ServiceName = "IMES.WatchFolder.Service";
            serviceInstaller.ServiceName = GetConfigurationValue("ServiceName");
            serviceInstaller.DisplayName = GetConfigurationValue("ServiceName");
            serviceInstaller.Description = " IMES Watch Folder/File Service ";
            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }
Example #10
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
     this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
     //
     // serviceProcessInstaller1
     //
     this.serviceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller1.Password = null;
     this.serviceProcessInstaller1.Username = null;
     //
     // serviceInstaller1
     //
     this.serviceInstaller1.ServiceName        = "XPLLogger";
     this.serviceInstaller1.ServicesDependedOn = new string[] {
         ""
     };
     this.serviceInstaller1.StartType        = System.ServiceProcess.ServiceStartMode.Automatic;
     this.serviceInstaller1.BeforeUninstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_BeforeUninstall);
     this.serviceInstaller1.AfterInstall    += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
         this.serviceProcessInstaller1,
         this.serviceInstaller1
     });
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            // Construct components as a Container instance
            this.components = new System.ComponentModel.Container();

            this.serviceInstaller        = new System.ServiceProcess.ServiceInstaller();
            this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();

            // serviceInstaller
            this.serviceInstaller.Description = "ConstantsSystemServiceDesc";
            this.serviceInstaller.DisplayName = "ConstantsSystemServiceName";
            this.serviceInstaller.ServiceName = "ConstantsSystemNtServiceName";
            this.serviceInstaller.StartType   = System.ServiceProcess.ServiceStartMode.Automatic;

            // serviceProcessInstaller
            this.serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;

            // ServiceInstaller
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });

            // Add handler to automatically start service on install
            serviceInstaller.AfterInstall += new System.Configuration.Install.InstallEventHandler(serviceInstaller_AfterInstall);
        }
        private void InitializeComponent()
        {
            this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            this.dnsFlushInstaller       = new System.ServiceProcess.ServiceInstaller();
            //
            // serviceProcessInstaller1
            //
            this.serviceProcessInstaller.Password = null;
            this.serviceProcessInstaller.Username = null;
            //
            // serviceInstaller1
            //
            this.dnsFlushInstaller.ServiceName = "DnsFlusher";
            //
            // ProjectInstaller
            //
            this.dnsFlushInstaller.StartType     = ServiceStartMode.Automatic;
            this.dnsFlushInstaller.Description   = "Flushes the dns every 3 hours";
            this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem;

            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller,
                this.dnsFlushInstaller
            }
                                     );
        }
Example #13
0
 private void InitializeComponent()
 {
     this.WatchMSMQServiceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
     this.WatchMSMQInstaller = new System.ServiceProcess.ServiceInstaller();
     //
     // WatchMSMQServiceProcessInstaller
     //
     this.WatchMSMQServiceProcessInstaller.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.WatchMSMQServiceProcessInstaller.Password = null;
     this.WatchMSMQServiceProcessInstaller.Username = null;
     //
     // WatchMSMQInstaller
     //
     this.WatchMSMQInstaller.DisplayName        = "C# How-To Watch MSMQ";
     this.WatchMSMQInstaller.ServiceName        = "WatchMSMQ";
     this.WatchMSMQInstaller.ServicesDependedOn = new string[] {
         "MSMQ"
     };
     this.WatchMSMQInstaller.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.WatchMSMQInstaller_AfterInstall);
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
         this.WatchMSMQInstaller,
         this.WatchMSMQServiceProcessInstaller
     });
 }
Example #14
0
        /// <summary>
        /// Public Constructor for WindowsServiceInstaller.
        /// - Put all of your Initialization code here.
        /// </summary>
        public WindowsServiceInstaller()
        {
            SpaceEngineersGame.SetupPerGameSettings();

            ServiceProcessInstaller serviceProcessInstaller =
                               new ServiceProcessInstaller();
            m_serviceInstaller = new ServiceInstaller();

            //# Service Account Information
            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            serviceProcessInstaller.Username = null;
            serviceProcessInstaller.Password = null;



            m_serviceInstaller.DisplayName = MyPerServerSettings.GameName + " dedicated server";
            //# This must be identical to the WindowsService.ServiceBase name
            //# set in the constructor of WindowsService.cs
            m_serviceInstaller.ServiceName = m_serviceInstaller.DisplayName;
            m_serviceInstaller.Description = MyPerServerSettings.GameDSDescription;

            this.Installers.Add(m_serviceInstaller);

            //# Service Information            
            m_serviceInstaller.StartType = ServiceStartMode.Automatic;
            this.Installers.Add(serviceProcessInstaller);
        }
Example #15
0
        public Installer()
        {
            InitializeComponent();

            this.ServiceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
            // 
            // ServiceProcessInstaller1
            // 
            this.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.ServiceProcessInstaller1.Password = null;
            this.ServiceProcessInstaller1.Username = null;
            // 
            // serviceInstaller1
            // 
            this.serviceInstaller1.DisplayName = "dp2 Kernel Service";
            this.serviceInstaller1.ServiceName = "dp2KernelService";
            this.serviceInstaller1.Description = "dp2内核,数字平台北京软件有限责任公司 http://dp2003.com";
            this.serviceInstaller1.StartType = ServiceStartMode.Automatic;
            /*
            this.serviceInstaller1.ServicesDependedOn = new string[] {
                "W3SVC"};
             * */
            // 
            // ProjectInstaller
            // 
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
				this.ServiceProcessInstaller1,
				this.serviceInstaller1});

            this.serviceInstaller1.Committed += new InstallEventHandler(serviceInstaller1_Committed); 
        }
Example #16
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            //
            // serviceProcessInstaller1
            //
            serviceProcessInstaller1          = new System.ServiceProcess.ServiceProcessInstaller();
            serviceProcessInstaller1.Account  = ServiceAccount.LocalSystem;
            serviceProcessInstaller1.Password = null;
            serviceProcessInstaller1.Username = null;
            //
            // serviceInstaller1
            //
            serviceInstaller1             = new System.ServiceProcess.ServiceInstaller();
            serviceInstaller1.ServiceName = "StationMockService";
            serviceInstaller1.StartType   = ServiceStartMode.Automatic;

            //
            // ProjectInstaller
            //
            this.Installers.AddRange(
                new System.Configuration.Install.Installer[]
            {
                this.serviceProcessInstaller1,
                this.serviceInstaller1
            }
                );
        }
Example #17
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.spInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            this.srvcInstaller = new System.ServiceProcess.ServiceInstaller();
            // 
            // spInstaller
            // 
            this.spInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.spInstaller.Password = null;
            this.spInstaller.Username = null;
            // 
            // srvcInstaller
            // 
            this.srvcInstaller.ServiceName = "WMS 3.0 WCF Service";
            this.srvcInstaller.Description = "Manage the WCF Service (Communication Foundation).";
            this.srvcInstaller.DisplayName = "WMS 3.0 WCF Service";
            this.srvcInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;

            // 
            // ProjectInstaller
            // 
            this.Installers.AddRange(new System.Configuration.Install.Installer[] 
            { this.spInstaller, this.srvcInstaller });

        }
        private void InitializeComponent()
        {
            this.components = new Container();

            this.serviceProcessInstaller = new ServiceProcessInstaller();
            this.serviceInstaller = new ServiceInstaller();

            // serviceProcessInstaller
            this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            this.serviceProcessInstaller.Password = null;
            this.serviceProcessInstaller.Username = null;

            // serviceInstaller
            this.serviceInstaller.DisplayName = ServiceHostSettings.ServiceName;
            this.serviceInstaller.ServiceName = ServiceHostSettings.ServiceName;
            this.serviceInstaller.Description = ServiceHostSettings.ServiceDescription;
            this.serviceInstaller.StartType = ServiceStartMode.Manual;

            // ProjectInstaller
            this.Installers.AddRange(new Installer[]
            {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });
        }
        public ProjectInstaller(string svcname, string username, string password)
        {
            System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            System.ServiceProcess.ServiceInstaller        serviceInstaller        = new System.ServiceProcess.ServiceInstaller();

            //  check for special users as localsystem, networkservice and localservice
            if (username == null || username.ToLower() == "localsystem")
            {
                serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            }
            else if (username.ToLower() == "networkservice")
            {
                serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.NetworkService;
            }
            else if (username.ToLower() == "localservice")
            {
                serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalService;
            }
            else
            {
                serviceProcessInstaller.Account  = System.ServiceProcess.ServiceAccount.User;
                serviceProcessInstaller.Username = username;
                serviceProcessInstaller.Password = password;
            }

            serviceInstaller.ServiceName = svcname;
            serviceInstaller.StartType   = System.ServiceProcess.ServiceStartMode.Automatic;
            serviceInstaller.Description = "Service broker external activator";
            serviceInstaller.DisplayName = "External Activator - " + svcname;

            Installers.AddRange(new System.Configuration.Install.Installer[] { serviceProcessInstaller, serviceInstaller });
        }
Example #20
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.PdfCombinerServiceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
     this.PdfConbinerServiceInstaller        = new System.ServiceProcess.ServiceInstaller();
     //
     // PdfCombinerServiceProcessInstaller
     //
     this.PdfCombinerServiceProcessInstaller.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.PdfCombinerServiceProcessInstaller.Password = null;
     this.PdfCombinerServiceProcessInstaller.Username = null;
     //
     // PdfConbinerServiceInstaller
     //
     this.PdfConbinerServiceInstaller.Description   = "Сервис формирования интерактивного PDF";
     this.PdfConbinerServiceInstaller.DisplayName   = "PdfCombiner v1.0";
     this.PdfConbinerServiceInstaller.ServiceName   = "PdfCombiner";
     this.PdfConbinerServiceInstaller.StartType     = ServiceStartMode.Automatic;
     this.PdfConbinerServiceInstaller.AfterInstall += ServiceInstaller_AfterInstall;
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new Installer[]
     {
         this.PdfCombinerServiceProcessInstaller,
         this.PdfConbinerServiceInstaller
     });
 }
 public CassetteHostServiceInstaller()
 {
     var process = new ServiceProcessInstaller { Account = ServiceAccount.LocalSystem };
     var service = new ServiceInstaller { ServiceName = CassetteHostingService.CassetteServiceName };
     Installers.Add(process);
     Installers.Add(service);
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            // Construct components as a Container instance
            this.components = new System.ComponentModel.Container();

            this.serviceInstaller        = new System.ServiceProcess.ServiceInstaller();
            this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();

            // serviceInstaller
            this.serviceInstaller.Description = Constants.System.ServiceDesc;
            this.serviceInstaller.DisplayName = Constants.System.NtServiceName;
            this.serviceInstaller.ServiceName = Constants.System.ServiceKey;
            this.serviceInstaller.StartType   = System.ServiceProcess.ServiceStartMode.Automatic;

            // serviceProcessInstaller - uncomment the next line and comment the one after if you need to run this with a regular user account
            // Setting this up as a NetworkService makes it run under a Service account, with email sent via a service account too - password in CorpMailman.exe.config
//            this.serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.User;
            this.serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.NetworkService;

            // ServiceInstaller
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });

            // Add handler to automatically start service on install
            serviceInstaller.AfterInstall += new System.Configuration.Install.InstallEventHandler(serviceInstaller_AfterInstall);
        }
Example #23
0
        public Installer1()
        {
            InitializeComponent();

            this.ServiceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
            //
            // ServiceProcessInstaller1
            //
            this.ServiceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalSystem; // LocalSystem
            this.ServiceProcessInstaller1.Password = null;
            this.ServiceProcessInstaller1.Username = null;
            //
            // serviceInstaller1
            //
            this.serviceInstaller1.DisplayName = "dp2 Library Service";
            this.serviceInstaller1.ServiceName = "dp2LibraryService";
            this.serviceInstaller1.Description = "dp2图书馆应用服务器,数字平台北京软件有限责任公司 http://dp2003.com";
            this.serviceInstaller1.StartType   = ServiceStartMode.Automatic;

            /* // dp2Library和dp2Kernel可以不在同一台机器,所以不能设定依赖关系
             * this.serviceInstaller1.ServicesDependedOn = new string[] {
             *  "dp2KernelService"};
             * */
            //
            // ProjectInstaller
            //
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.ServiceProcessInstaller1,
                this.serviceInstaller1
            });

            this.serviceInstaller1.Committed += new InstallEventHandler(serviceInstaller1_Committed);
        }
Example #24
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
     this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
     //
     // serviceProcessInstaller1
     //
     this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller1.Password = null;
     this.serviceProcessInstaller1.Username = null;
     this.serviceProcessInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_AfterInstall);
     //
     // serviceInstaller1
     //
     this.serviceInstaller1.ServiceName = "CardReaderService";
     this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
     this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
     this.serviceProcessInstaller1,
     this.serviceInstaller1});
     this.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.ProjectInstaller_AfterInstall);
 }
Example #25
0
        private void InitializeComponent()
        {
            this.serviceRefProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceRefInstaller        = new System.ServiceProcess.ServiceInstaller();
            //
            // serviceRefProcessInstaller
            //
            this.serviceRefProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.serviceRefInstaller.StartType      = System.ServiceProcess.ServiceStartMode.Automatic;

            //
            // serviceRefInstaller
            //
            this.serviceRefInstaller.DisplayName = ReflectorMgr.ReflectorServiceName;
            this.serviceRefInstaller.ServiceName = ReflectorMgr.ReflectorServiceName;
            //
            // ProjectInstaller
            //
            this.Installers.AddRange(new System.Configuration.Install.Installer[]
            {
                this.serviceRefProcessInstaller,
                this.serviceRefInstaller
            }
                                     );
        }
Example #26
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
     this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
     //
     // serviceProcessInstaller1
     //
     this.serviceProcessInstaller1.Account       = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller1.Password      = null;
     this.serviceProcessInstaller1.Username      = null;
     this.serviceProcessInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_AfterInstall);
     //
     // serviceInstaller1
     //
     this.serviceInstaller1.ServiceName   = "CardReaderService";
     this.serviceInstaller1.StartType     = System.ServiceProcess.ServiceStartMode.Automatic;
     this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
         this.serviceProcessInstaller1,
         this.serviceInstaller1
     });
     this.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.ProjectInstaller_AfterInstall);
 }
 public ProjectInstaller()
 {
     _process = new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem};
     _service = new ServiceInstaller { ServiceName = GlobalSettings.ApplicationName };
     Installers.Add(_process);
     Installers.Add(_service);
 }
Example #28
0
 private void InitializeComponent()
 {
     this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
     this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
     //
     // serviceInstaller1
     //
     this.serviceInstaller1.Description = "Management Service by Roger Zander";
     this.serviceInstaller1.DisplayName = "Device Commander Agent";
     this.serviceInstaller1.ServiceName = "DevCDRAgent";
     this.serviceInstaller1.StartType   = System.ServiceProcess.ServiceStartMode.Automatic;
     //
     // serviceProcessInstaller1
     //
     this.serviceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller1.Password = null;
     this.serviceProcessInstaller1.Username = null;
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
         this.serviceInstaller1,
         this.serviceProcessInstaller1
     });
 }
Example #29
0
        //private FileLogger _logger;
        public EFxServiceInstaller()
        {
            //InitializeComponent();
            _serviceProcessInstaller = new ServiceProcessInstaller
            {
                Account = ServiceAccount.NetworkService,
                Username = null,
                Password = null
            };

            _serviceInstaller = new ServiceInstaller
            {
                DisplayName = ConfigurationManager.AppSettings["serviceName"],
                ServiceName = ConfigurationManager.AppSettings["serviceName"],
                Description = ConfigurationManager.AppSettings["serviceName"],
                StartType = ServiceStartMode.Automatic
            };

            Installers.AddRange(new Installer[]
            {
                _serviceProcessInstaller,
                _serviceInstaller
            });

            //_logger = new FileLogger();
        }
Example #30
0
        public InstallerSrv()
        {
            string logname = "GranityLog";

            InitializeComponent();
            //��װ��־
            if (EventLog.Exists(logname))
                EventLog.Delete(logname);
            if (EventLog.SourceExists(logname))
                EventLog.DeleteEventSource(logname);
            EventLogInstaller log = new EventLogInstaller();
            log.Source = logname;
            log.Log = logname;
            this.Installers.Add(log);

            //��װ����
            ServiceProcessInstaller prsInstaller = new ServiceProcessInstaller();
            ServiceInstaller srvInstall = new ServiceInstaller();

            // The services run under the system account.
            prsInstaller.Account = ServiceAccount.LocalSystem;
            prsInstaller.Username = null;
            prsInstaller.Password = null;

            // The services are started manually.
            srvInstall.StartType = ServiceStartMode.Automatic;
            srvInstall.ServiceName = "Granity�ļ�����";
            srvInstall.Description = "�Ϻ�����˾��ͣ����ץ��ͼƬ�ļ�����";

            // Add installers to collection. Order is not important.
            Installers.Add(srvInstall);
            Installers.Add(prsInstaller);
        }
        private void Init()
        {
            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 = "Audio Windows Service";
            serviceInstaller.Description = "Audio C# Windows Service";
            serviceInstaller.StartType = ServiceStartMode.Manual;

            //# This must be identical to the WindowsService.ServiceBase name

            //# set in the constructor of AudioService.cs

            serviceInstaller.ServiceName = "Audio Windows Service";

            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }
Example #32
0
 /// <summary>
 ///    Required method for Designer support - do not modify
 ///    the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.serviceInstaller        = new System.ServiceProcess.ServiceInstaller();
     this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
     //
     // serviceInstaller
     //
     this.serviceInstaller.Description = "YUpdatePricePart";
     this.serviceInstaller.DisplayName = "YUpdatePricePart";
     this.serviceInstaller.ServiceName = "YUpdatePricePart";
     this.serviceInstaller.StartType   = System.ServiceProcess.ServiceStartMode.Automatic;
     //
     // serviceProcessInstaller
     //
     this.serviceProcessInstaller.Account  = System.ServiceProcess.ServiceAccount.LocalService;
     this.serviceProcessInstaller.Password = null;
     this.serviceProcessInstaller.Username = null;
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
         this.serviceProcessInstaller,
         this.serviceInstaller
     });
 }
        /// <summary>
        /// Constructor e instalador de servcios.
        /// </summary>
        public WCFAPIServerInstaller()
        {
            ServiceProcessInstaller serviceProcessInstaller =
                               new ServiceProcessInstaller();
            ServiceInstaller serviceInstaller = new ServiceInstaller();

            //# Cuenta local de Usuario para ejecucion del servicio
            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            serviceProcessInstaller.Username = null;
            serviceProcessInstaller.Password = null;

            string name = System.Configuration.ConfigurationManager.AppSettings["ServiceInstaller.Name"];
            string description = System.Configuration.ConfigurationManager.AppSettings["ServiceInstaller.Description"];

            if (string.IsNullOrEmpty(name))
            {
                name = "WCF-API Server Provider";
            }
            if (string.IsNullOrEmpty(description))
            {
                description = "WCF-API Server Provider. Provider/Publisher WCF interfaces Service .";
            }
            //# Informacion del servicio
            serviceInstaller.DisplayName = name;  //Cambiar este valor con el nombre del servicio
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            serviceInstaller.ServiceName = name; //Cambiar este valor con el nombre del servicio
            serviceInstaller.Description = description;
                ; //Descripcion del servicio (opcional)

            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.SBWinSVcServiceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
     this.SBWinSvcServiceInstaller        = new System.ServiceProcess.ServiceInstaller();
     //
     // SBWinSVcServiceProcessInstaller
     //
     //this.SBWinSVcServiceProcessInstaller.Password = null;
     //this.SBWinSVcServiceProcessInstaller.Username = null;
     this.SBWinSVcServiceProcessInstaller.Account = ServiceAccount.LocalSystem;
     //
     // SBWinSvcServiceInstaller
     //
     this.SBWinSvcServiceInstaller.ServiceName = "SBWinSvc";
     this.SBWinSvcServiceInstaller.DisplayName = "SpeechBridge Process Manager";
     this.SBWinSvcServiceInstaller.StartType   = ServiceStartMode.Automatic;
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(
         new System.Configuration.Install.Installer[]
     {
         this.SBWinSVcServiceProcessInstaller,
         this.SBWinSvcServiceInstaller
     }
         );
 }
Example #35
0
        public NDockServiceInstaller()
        {
            InitializeComponent();

            processInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

            processInstaller.Account = ServiceAccount.LocalSystem;
            serviceInstaller.StartType = ServiceStartMode.Automatic;
            serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"];

            var serviceDescription = ConfigurationManager.AppSettings["ServiceDescription"];
            if (!string.IsNullOrEmpty(serviceDescription))
                serviceInstaller.Description = serviceDescription;

            var servicesDependedOn = new List<string> { "tcpip" };
            var servicesDependedOnConfig = ConfigurationManager.AppSettings["ServicesDependedOn"];

            if (!string.IsNullOrEmpty(servicesDependedOnConfig))
                servicesDependedOn.AddRange(servicesDependedOnConfig.Split(new char[] { ',', ';' }));

            serviceInstaller.ServicesDependedOn = servicesDependedOn.ToArray();

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
Example #36
0
        public Installer1()
        {
            InitializeComponent();

            this.ServiceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
            //
            // ServiceProcessInstaller1
            //
            this.ServiceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalSystem; // LocalSystem
            this.ServiceProcessInstaller1.Password = null;
            this.ServiceProcessInstaller1.Username = null;
            //
            // serviceInstaller1
            //
            this.serviceInstaller1.DisplayName = "dp2 Router Service";
            this.serviceInstaller1.ServiceName = "dp2RouterService";
            this.serviceInstaller1.Description = "dp2 网关服务器,数字平台北京软件有限责任公司 http://dp2003.com";
            this.serviceInstaller1.StartType   = ServiceStartMode.Automatic;
            //
            // ProjectInstaller
            //
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.ServiceProcessInstaller1,
                this.serviceInstaller1
            });

            this.serviceInstaller1.Committed += new InstallEventHandler(serviceInstaller1_Committed);
        }
Example #37
0
        public void Install()
        {
            if (ServiceExists())
            {
                logger.Warn("The service is already installed!");
            }
            else
            {
                var installer = new ServiceProcessInstaller
                {
                    Account = ServiceAccount.LocalSystem
                };

                var serviceInstaller = new ServiceInstaller();

                var exePath = Path.Combine(configService.ApplicationFolder(), SERVICEEXE);
                if (!File.Exists(exePath) && Debugger.IsAttached)
                {
                    exePath = Path.Combine(configService.ApplicationFolder(), "..\\..\\..\\Jackett.Service\\bin\\Debug", SERVICEEXE);
                }

                string[] cmdline = { @"/assemblypath=" + exePath};

                var context = new InstallContext("jackettservice_install.log", cmdline);
                serviceInstaller.Context = context;
                serviceInstaller.DisplayName = NAME;
                serviceInstaller.ServiceName = NAME;
                serviceInstaller.Description = DESCRIPTION;
                serviceInstaller.StartType = ServiceStartMode.Automatic;
                serviceInstaller.Parent = installer;

                serviceInstaller.Install(new ListDictionary());
            }
        }
Example #38
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new System.ComponentModel.Container();

            this.BeforeInstall   += new System.Configuration.Install.InstallEventHandler(ProjectInstaller_BeforeInstall);
            this.BeforeUninstall += new System.Configuration.Install.InstallEventHandler(ProjectInstaller_BeforeUninstall);


            this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
            //
            // serviceProcessInstaller1
            //
            this.serviceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.serviceProcessInstaller1.Password = null;
            this.serviceProcessInstaller1.Username = null;
            //
            // serviceInstaller1
            //
            this.serviceInstaller1.Description   = "MSB Virus Sentry";
            this.serviceInstaller1.DisplayName   = "MSB Virus Sentry";
            this.serviceInstaller1.ServiceName   = "MSB_Virus_Sentry";
            this.serviceInstaller1.StartType     = System.ServiceProcess.ServiceStartMode.Automatic;
            this.serviceInstaller1.AfterInstall += SentryInstaller_AfterInstall;


            //
            // ProjectInstaller
            //

            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller1,
                this.serviceInstaller1
            });
        }
Example #39
0
        public virtual void Install(string serviceName)
        {
            _logger.Info("Installing service '{0}'", serviceName);

            var installer = new ServiceProcessInstaller
                                {
                                    Account = ServiceAccount.LocalSystem
                                };

            var serviceInstaller = new ServiceInstaller();

            String[] cmdline = { @"/assemblypath=" + Process.GetCurrentProcess().MainModule.FileName };

            var context = new InstallContext("service_install.log", cmdline);
            serviceInstaller.Context = context;
            serviceInstaller.DisplayName = serviceName;
            serviceInstaller.ServiceName = serviceName;
            serviceInstaller.Description = "NzbDrone Application Server";
            serviceInstaller.StartType = ServiceStartMode.Automatic;
            serviceInstaller.ServicesDependedOn = new[] { "EventLog", "Tcpip" };

            serviceInstaller.Parent = installer;

            serviceInstaller.Install(new ListDictionary());

            _logger.Info("Service Has installed successfully.");
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     _serviceProcessInstaller = new ServiceProcessInstaller();
     _serviceInstaller = new ServiceInstaller();
     // 
     // _serviceProcessInstaller
     // 
     _serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
     _serviceProcessInstaller.Password = null;
     _serviceProcessInstaller.Username = null;
     // 
     // _serviceInstaller
     // 
     _serviceInstaller.DelayedAutoStart = true;
     _serviceInstaller.Description = "Эта служба собирает почту с различный ящиков";
     _serviceInstaller.DisplayName = "Служба сбора почты";
     _serviceInstaller.ServiceName = "TopCrawler";
     _serviceInstaller.StartType = ServiceStartMode.Automatic;
     // 
     // ProjectInstaller
     // 
     Installers.AddRange(new Installer[] {
     _serviceProcessInstaller,
     _serviceInstaller});
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new System.ComponentModel.Container();
            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();
            ServiceInstaller serviceInstaller = new ServiceInstaller();
            EventLogInstaller logInstaller = new EventLogInstaller();

            logInstaller.Log = "Application";
            logInstaller.Source = "sdsupportsvc";

            processInstaller.Account = ServiceAccount.LocalSystem;
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            serviceInstaller.ServiceName = "sdsupportsvc";
            serviceInstaller.DisplayName = "SD Support Host Service";
            serviceInstaller.Description = "Hosts an Azure Net Relay WCF service which support sdsupport.apphb.com";

            for (var t = 0; t < Installers.Count; t++)
            {
                if (Installers[t] is EventLogInstaller)
                {
                    Installers.Remove(Installers[t]);
                    break;
                }
            }

            Installers.Add(logInstaller);
            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);
            
        }
 /// <summary>
 /// Initalizes the service installer.
 /// </summary>
 private void InitalizeServiceInstaller()
 {
     this.zentityServiceProcessInstaller = new ServiceProcessInstaller();
     this.zentityServiceInstaller        = new  ServiceInstaller();
     //
     // zentityServiceProcessInstaller
     //
     this.zentityServiceProcessInstaller.Account  = ServiceAccount.User;
     this.zentityServiceProcessInstaller.Password = null;
     this.zentityServiceProcessInstaller.Username = null;
     //
     // zentityServiceInstaller
     //
     this.zentityServiceInstaller.ServiceName = "Zentity Notification Service";
     this.zentityServiceInstaller.Description = "Zentity Notification Service is responsible for publishing Pivot collections from Zentity when there are updates to the database.";
     this.zentityServiceInstaller.StartType   = ServiceStartMode.Automatic;
     //
     // Project Installer
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[]
     {
         this.zentityServiceProcessInstaller,
         this.zentityServiceInstaller
     });
 }
Example #43
0
        /// <summary>
        /// Public Constructor for WindowsServiceInstaller.
        /// - Put all of your Initialization code here.
        /// </summary>
        public WindowsServiceInstaller()
        {
            var serviceProcessInstaller =
                               new ServiceProcessInstaller();
            var serviceInstaller
                = new ServiceInstaller();

            //# Service Account Information

            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            serviceProcessInstaller.Username = null;
            serviceProcessInstaller.Password = null;

            //# Service Information

            serviceInstaller.DisplayName = "NP2COMService";
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            //# This must be identical to the WindowsService.ServiceBase name

            //# set in the constructor of WindowsService.cs

            serviceInstaller.ServiceName = "NP2COMService";

            Installers.Add(serviceProcessInstaller);
            Installers.Add(serviceInstaller);
        }
        public ArchiServiceInstaller()
        {
            ServiceInstaller serviceInstaller = new ServiceInstaller();
            ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller();

            serviceInstaller.ServiceName = SharedInfo.ServiceName;
            serviceInstaller.DisplayName = SharedInfo.ServiceName;
            serviceInstaller.Description = SharedInfo.ServiceDescription;

            // Defaulting to only starting when a user starts it, can be easily changed after install
            serviceInstaller.StartType = ServiceStartMode.Manual;

            // System account, requires admin privilege to install
            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;

            serviceInstaller.Installers.Clear();

            EventLogInstaller logInstaller = new EventLogInstaller {
                Log = SharedInfo.EventLog,
                Source = SharedInfo.EventLogSource
            };

            Installers.Add(serviceInstaller);
            Installers.Add(serviceProcessInstaller);
            Installers.Add(logInstaller);
        }
   public SocketServiceInstaller()
   {
       this.InitializeComponent();
       this.processInstaller = new ServiceProcessInstaller();
       this.serviceInstaller = new ServiceInstaller();
       this.processInstaller.Account = ServiceAccount.LocalSystem;
       this.serviceInstaller.StartType = ServiceStartMode.Automatic;
       this.serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"];
       string str1 = ConfigurationManager.AppSettings["ServiceDescription"];
       if (!string.IsNullOrEmpty(str1))
           this.serviceInstaller.Description = str1;
       List<string> list = new List<string>()
 {
   "tcpip"
 };
       string str2 = ConfigurationManager.AppSettings["ServicesDependedOn"];
       if (!string.IsNullOrEmpty(str2))
           list.AddRange((IEnumerable<string>)str2.Split(new char[2]
   {
     ',',
     ';'
   }));
       this.serviceInstaller.ServicesDependedOn = list.ToArray();
       this.Installers.Add((Installer)this.serviceInstaller);
       this.Installers.Add((Installer)this.processInstaller);
   }
Example #46
0
    private void InitializeComponent()
    {
        this.myServiceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();

        this.myWindowsServiceInstaller = new System.ServiceProcess.ServiceInstaller();

        //

        //myServiceProcessInstaller

        //

        this.myServiceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;

        this.myServiceProcessInstaller.Password = null;

        this.myServiceProcessInstaller.Username = null;

        //

        //myWindowsServiceInstaller

        //

        this.myWindowsServiceInstaller.ServiceName = "C#_NET_HowTo_TimeTrackerService";

        //

        //ProjectInstaller

        //

        this.Installers.AddRange(new System.Configuration.Install.Installer[] { this.myServiceProcessInstaller, this.myWindowsServiceInstaller });
    }
Example #47
0
 public TfsDeployerInstaller()
 {
     _processInstaller = new ServiceProcessInstaller();
     this._eventLogInstaller = new System.Diagnostics.EventLogInstaller();
     this._tfsIntegratorInstaller = new System.ServiceProcess.ServiceInstaller();
     //
     // _eventLogInstaller
     //
     this._eventLogInstaller.CategoryCount = 0;
     this._eventLogInstaller.CategoryResourceFile = null;
     this._eventLogInstaller.Log = "Application";
     this._eventLogInstaller.MessageResourceFile = null;
     this._eventLogInstaller.ParameterResourceFile = null;
     this._eventLogInstaller.Source = "Readify.TfsDeployer";
     //
     // _tfsIntegratorInstaller
     //
     this._tfsIntegratorInstaller.DisplayName = "TFS Deployer";
     this._tfsIntegratorInstaller.ServiceName = "TfsDeployer";
     this._tfsIntegratorInstaller.Description = "Performs Deployment for Team Foundation Server";
     this._tfsIntegratorInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
     _processInstaller.Account = ServiceAccount.LocalSystem;
     this.Installers.Add(_eventLogInstaller);
     this.Installers.Add(_tfsIntegratorInstaller);
     this.Installers.Add(_processInstaller);
 }
Example #48
0
        private void DefaultInstaller_BeforeInstall(object sender, InstallEventArgs e)
        {
            ServiceInstaller serviceInstaller = new ServiceInstaller()
            {
                Description = "MSMQ Monitor",
                StartType = ServiceStartMode.Automatic,
            };

            string name = Context.Parameters["name"];
            if (!string.IsNullOrEmpty(name))
            {
                serviceInstaller.ServiceName = name;
            }
            else
            {
                serviceInstaller.ServiceName = "MSMQ.Monitor";
            }

            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller()
            {
                Account = ServiceAccount.LocalSystem
            };

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
        public BackgroundServiceInstaller()
        {
            var process = new ServiceProcessInstaller
            {
                Account = ServiceAccount.LocalSystem
            };

            var serviceAdmin = new ServiceInstaller
            {
                StartType = ServiceStartMode.Manual,
                ServiceName = BackgroundService.Name,
                DisplayName = BackgroundService.DisplayName,

                DelayedAutoStart = true,

                Description = "The windows background service for Media Browser Server.",

                // Will ensure the network is available
                ServicesDependedOn = new[] { "LanmanServer" }
            };

            // 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);
        }
Example #50
0
        /// <summary>
        /// Default Installation Logic
        /// </summary>
        #region Installer Functions
        private void InitializeComponent()
        {
            _serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            _serviceInstaller        = new System.ServiceProcess.ServiceInstaller();

            Installers.Add(_serviceProcessInstaller);
            Installers.Add(_serviceInstaller);
        }
Example #51
0
        public Installer()
        {
            InitializeComponent();

            _serviceInstaller = new ServiceProcessInstaller();
            _processInstaller = new System.ServiceProcess.ServiceInstaller();

            _serviceInstaller.Account     = ServiceAccount.LocalSystem;
            _processInstaller.StartType   = ServiceStartMode.Manual;
            _processInstaller.ServiceName = "Info Collector Service";
            Installers.Add(_processInstaller);
            Installers.Add(_serviceInstaller);
        }
Example #52
0
        void Install(String ServiceName, String DisplayName, String Description,
                     System.ServiceProcess.ServiceAccount Account,
                     System.ServiceProcess.ServiceStartMode StartMode)
        {
            System.ServiceProcess.ServiceProcessInstaller ProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            ProcessInstaller.Account = Account;

            System.ServiceProcess.ServiceInstaller SINST = new System.ServiceProcess.ServiceInstaller();

            System.Configuration.Install.InstallContext Context = new System.Configuration.Install.InstallContext();
            string processPath = Process.GetCurrentProcess().MainModule.FileName;

            if (processPath != null && processPath.Length > 0)
            {
                System.IO.FileInfo fi = new System.IO.FileInfo(processPath);

                String   path    = String.Format("/assemblypath={0}", fi.FullName);
                String[] cmdline = { path };
                Context = new System.Configuration.Install.InstallContext("", cmdline);
            }

            SINST.Context     = Context;
            SINST.DisplayName = String.Format("{0}", DisplayName);
            SINST.Description = String.Format("{0}", Description);
            SINST.ServiceName = String.Format("{0}", ServiceName);
            SINST.StartType   = StartMode;
            SINST.Parent      = ProcessInstaller;

            //          SINST.ServicesDependedOn = new String[] { "Spooler", "Netlogon", "Netman" };
            SINST.ServicesDependedOn = null;

            System.Collections.Specialized.ListDictionary state = new System.Collections.Specialized.ListDictionary();
            SINST.Install(state);

            using (RegistryKey oKey = Registry.LocalMachine.OpenSubKey(String.Format(@"SYSTEM\CurrentControlSet\Services\{0}", ServiceName), true))
            {
                try
                {
                    //                  Object sValue = oKey.GetValue("ImagePath");
                    Object sValue = oKey.GetValue("ImagePath");
                    string str    = string.Format("{0} service", sValue.ToString());
                    oKey.SetValue("ImagePath", str);
                }
                catch (Exception Ex)
                {
                    // System.Windows.Forms.MessageBox.Show(Ex.Message);
                    System.Console.WriteLine("Failed to install {0}", Ex.Message);
                }
            }
        }
        public QikIDHeavyBiometricsServiceInstaller()
        {
            this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();

            this.serviceProcessInstaller1.Account  = System.ServiceProcess.ServiceAccount.LocalService;
            this.serviceProcessInstaller1.Password = null;
            this.serviceProcessInstaller1.Username = null;

            this.serviceInstaller1.ServiceName   = DAEMON_NAME;
            this.serviceInstaller1.StartType     = System.ServiceProcess.ServiceStartMode.Automatic;
            this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);

            this.Installers.AddRange(new System.Configuration.Install.Installer[] { this.serviceProcessInstaller1, this.serviceInstaller1 });
        }
        public ServiceInstaller()
        {
            var processInstaller    = new System.ServiceProcess.ServiceProcessInstaller();
            var serviceInstaller    = new System.ServiceProcess.ServiceInstaller();
            var assemblyDescription = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false).OfType <AssemblyDescriptionAttribute>().FirstOrDefault();

            processInstaller.Account     = ServiceAccount.LocalSystem;
            serviceInstaller.DisplayName = typeof(Service).FullName;
            serviceInstaller.StartType   = ServiceStartMode.Manual;
            serviceInstaller.ServiceName = typeof(Service).FullName;
            serviceInstaller.Description = assemblyDescription != null ? assemblyDescription.Description : null;

            this.Installers.Add(processInstaller);
            this.Installers.Add(serviceInstaller);
        }
Example #55
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        protected void InitializeComponent(string serviceName, string displayName, string description)
        {
            this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller        = new System.ServiceProcess.ServiceInstaller();

            this.serviceInstaller.ServiceName = serviceName;
            this.serviceInstaller.DisplayName = displayName;
            this.serviceInstaller.Description = description;

            this.serviceInstaller.StartType = ServiceStartMode.Automatic;

            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller,
                this.serviceInstaller
            });
        }
Example #56
0
 /// <summary>
 ///    Required method for Designer support - do not modify
 ///    the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
     //
     // serviceProcessInstaller
     //
     this.serviceProcessInstaller.Account       = System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller.Password      = null;
     this.serviceProcessInstaller.Username      = null;
     this.serviceProcessInstaller.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller_AfterInstall);
     //
     // ProjectInstaller
     //
     this.Installers.AddRange(new System.Configuration.Install.Installer[] {
         this.serviceProcessInstaller
     });
 }
        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.spi = new System.ServiceProcess.ServiceProcessInstaller();
            this.si  = new System.ServiceProcess.ServiceInstaller();

            this.spi.Account  = System.ServiceProcess.ServiceAccount.LocalService;
            this.spi.Password = null;
            this.spi.Username = null;

            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.spi,
                this.si
            });

            this.BeforeInstall   += new InstallEventHandler(ServiceInstaller_BeforeInstall);
            this.BeforeUninstall += new InstallEventHandler(ServiceInstaller_BeforeUninstall);
        }
Example #58
0
            public void Install(String ServiceName, String DisplayName, String Description,
                                System.ServiceProcess.ServiceAccount Account,
                                System.ServiceProcess.ServiceStartMode StartMode)
            {
                System.ServiceProcess.ServiceProcessInstaller ProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
                ProcessInstaller.Account = Account;

                System.ServiceProcess.ServiceInstaller SINST = new System.ServiceProcess.ServiceInstaller();

                System.Configuration.Install.InstallContext Context = new System.Configuration.Install.InstallContext();
                string processPath = Process.GetCurrentProcess().MainModule.FileName;

                if (processPath != null && processPath.Length > 0)
                {
                    System.IO.FileInfo fi = new System.IO.FileInfo(processPath);

                    String   path    = String.Format("/assemblypath={0}", fi.FullName);
                    String[] cmdline = { path };
                    Context = new System.Configuration.Install.InstallContext("", cmdline);
                }

                SINST.Context     = Context;
                SINST.DisplayName = DisplayName;
                SINST.Description = Description;
                SINST.ServiceName = ServiceName;
                SINST.StartType   = StartMode;
                SINST.Parent      = ProcessInstaller;

                System.Collections.Specialized.ListDictionary state = new System.Collections.Specialized.ListDictionary();
                SINST.Install(state);

                using (RegistryKey oKey = Registry.LocalMachine.OpenSubKey(String.Format(@"SYSTEM\CurrentControlSet\Services\{0}", SINST.ServiceName), true))
                {
                    try
                    {
                        Object sValue = oKey.GetValue("ImagePath");
                        oKey.SetValue("ImagePath", sValue);
                    }
                    catch (Exception Ex)
                    {
                    }
                }
            }
        private void InitializeComponent()
        {
            this.serviceInstaller1        = new System.ServiceProcess.ServiceInstaller();
            this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();

            this.serviceInstaller1.DisplayName = "CPC";                                               //**5**
            this.serviceInstaller1.ServiceName = "CPC";                                               //**6**

            this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;      //**7**

            this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem; //**8**
            //this.serviceProcessInstaller1.Password = null;  //**9**
            //this.serviceProcessInstaller1.Username = null;

            //**10**
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller1,
                this.serviceInstaller1
            });
        }
Example #60
0
        public ServiceInstaller()
        {
            InitializeComponent();
            // Instantiate installers for process and services.
            _cInstaller        = new System.ServiceProcess.ServiceInstaller();
            _cProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();

            // The services run under the system account.
            _cProcessInstaller.Account = ServiceAccount.LocalSystem;

            _cInstaller.StartType        = ServiceStartMode.Automatic;
            _cInstaller.DelayedAutoStart = true;

            // ServiceName must equal those on ServiceBase derived classes.
            _cInstaller.ServiceName = "ingenie.initiator";


            // Add installers to collection. Order is not important.
            Installers.Add(_cInstaller);
            Installers.Add(_cProcessInstaller);
        }