예제 #1
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 = Constants.DisplayName;
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

            //# This must be identical to the WindowsService.ServiceBase name set in the constructor of WindowsService.cs
            serviceInstaller.ServiceName = Constants.ServiceName;

            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }
예제 #2
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 = "******";
            serviceProcessInstaller.Password = "******";

            //# Service Information
            serviceInstaller.DisplayName = "ImpulsoviService";
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

            //# This must be identical to the WindowsService.ServiceBase name
            //# set in the constructor of WindowsService.cs
            serviceInstaller.ServiceName = "ImpulsoviService";

            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }
예제 #3
0
        /// <summary>Public Constructor for WindowsServiceInstaller.</summary>
        public WindowsServiceInstaller()
        {
            ServiceProcessInstaller spInstaller = new ServiceProcessInstaller
            {
                Account  = ServiceAccount.LocalSystem,
                Username = null,
                Password = null
            };

            ServiceInstaller sInstaller = new ServiceInstaller
            {
                DisplayName = "Test AutoUpdate Service in C#",
                Description = "A simple service that writes to \"C:\\NETWinService.txt\"",
                StartType   = ServiceStartMode.Manual,

                // This must be identical to the WindowsService.ServiceBase name
                // set in the constructor of WindowsService.cs
                ServiceName = "Test AutoUpdate Service"
            };

            Installers.Add(spInstaller);
            Installers.Add(sInstaller);
        }
예제 #4
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 = "InfoHub Service";
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

            // This must be identical to the WindowsService.ServiceBase name
            // set in the constructor of WindowsService.cs
            serviceInstaller.ServiceName = "InfoHubService";


            this.AfterInstall += new InstallEventHandler(ServiceInstaller_AfterInstall);
            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }