当前位置: 首页>>代码示例>>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;未经允许,请勿转载。