當前位置: 首頁>>代碼示例>>C#>>正文


C# ServiceProcess.ServiceInstaller類代碼示例

本文整理匯總了C#中System.ServiceProcess.ServiceInstaller的典型用法代碼示例。如果您正苦於以下問題:C# ServiceInstaller類的具體用法?C# ServiceInstaller怎麽用?C# ServiceInstaller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ServiceInstaller類屬於System.ServiceProcess命名空間,在下文中一共展示了ServiceInstaller類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PollServerInstaller

        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 );
        }
開發者ID:itproto,項目名稱:ilsrep,代碼行數:26,代碼來源:PollServerInstaller.cs

示例2: Install

        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());
            }
        }
開發者ID:sdesbure,項目名稱:Jackett,代碼行數:34,代碼來源:ServiceConfigService.cs

示例3: WindowsServiceInstaller

        /// <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);
        }
開發者ID:fluxit,項目名稱:SpaceEngineers,代碼行數:31,代碼來源:MyProgram.cs

示例4: NDockServiceInstaller

        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);
        }
開發者ID:weitaoxiao,項目名稱:NDock,代碼行數:26,代碼來源:NDockServiceInstaller.cs

示例5: TfsDeployerInstaller

 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);
 }
開發者ID:hopenbr,項目名稱:HopDev,代碼行數:26,代碼來源:TfsDeployerInstaller.cs

示例6: InstallerSrv

        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);
        }
開發者ID:BillyWu,項目名稱:Granitypark,代碼行數:33,代碼來源:InstallerSrv.cs

示例7: WindowsServiceInstaller

        /// <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);
        }
開發者ID:saeidmh83,項目名稱:PipeToCom,代碼行數:31,代碼來源:NP2COMService.cs

示例8: ServiceDeploy

        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);
        }
開發者ID:volkanytu,項目名稱:HostRestService,代碼行數:25,代碼來源:ServiceDeploy.cs

示例9: ServiceBusInstaller

 public ServiceBusInstaller()
 {
     process = new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem};
     service = new ServiceInstaller {ServiceName = "WCF Service Bus"};
     Installers.Add(process);
     Installers.Add(service);
 }
開發者ID:rexwhitten,項目名稱:Siege,代碼行數:7,代碼來源:ServiceBusInstaller.cs

示例10: InitializeComponent

 /// <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});
 }
開發者ID:ErykB2000,項目名稱:xplproject,代碼行數:30,代碼來源:ProjectInstaller.cs

示例11: InitializeComponent

        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
            });
        }
開發者ID:begemod,項目名稱:MultipleHostsForNorthwindServices,代碼行數:25,代碼來源:ProjectInstaller.cs

示例12: CassetteHostServiceInstaller

 public CassetteHostServiceInstaller()
 {
     var process = new ServiceProcessInstaller { Account = ServiceAccount.LocalSystem };
     var service = new ServiceInstaller { ServiceName = CassetteHostingService.CassetteServiceName };
     Installers.Add(process);
     Installers.Add(service);
 }
開發者ID:Zocdoc,項目名稱:cassette,代碼行數:7,代碼來源:CassetteHostServiceInstaller.cs

示例13: InitializeComponent

        /// <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 });

        }
開發者ID:erwin-hamid,項目名稱:LogPro,代碼行數:29,代碼來源:WMSServiceInstaller.cs

示例14: Installer

        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); 
        }
開發者ID:renyh1013,項目名稱:dp2,代碼行數:32,代碼來源:Installer.cs

示例15: DefaultInstaller_BeforeInstall

        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);
        }
開發者ID:crowleym,項目名稱:MSMQ.Monitor,代碼行數:26,代碼來源:DefaultInstaller.cs


注:本文中的System.ServiceProcess.ServiceInstaller類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。