public EventMessagesInstaller()
        {
            // Create event log installer object.
            m_ELI = new EventLogInstaller();

            // Set the source name of the event log
            m_ELI.Source = EVENT_SOURCE;

            // Set the event log that the source write entries to.
            m_ELI.Log = APP_LOG;

            // Set the message file.
            m_ELI.MessageResourceFile = Directory.GetCurrentDirectory() + MESSAGE_FILE;

            // Set the category file.
            m_ELI.CategoryCount        = CATEGORY_COUNT;
            m_ELI.CategoryResourceFile = Directory.GetCurrentDirectory() + MESSAGE_FILE;

            // Add to installer collection.
            Installers.Add(m_ELI);
        }
示例#2
0
        public CoAppServiceInstaller(bool useUserAccount)
        {
            _serviceProcessInstaller.Account  = useUserAccount ? ServiceAccount.User : ServiceAccount.LocalSystem;
            _serviceProcessInstaller.Password = null;
            _serviceProcessInstaller.Username = null;

            _serviceInstaller.ServiceName = EngineServiceManager.CoAppServiceName;
            _serviceInstaller.DisplayName = EngineServiceManager.CoAppDisplayName;

            _serviceInstaller.StartType = ServiceStartMode.Manual;

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

            // works around a goofy bug in the installer stack.
            int n = 0;

            foreach (var eli in FindInstaller(Installers))
            {
                eli.Source = "CoAppLog" + (++n);
            }
        }
示例#3
0
        public ServiceInstaller()
        {
            serviceInstaller = new System.ServiceProcess.ServiceInstaller();
            serviceInstaller.AfterInstall += ServiceInstaller_AfterInstall;

            processInstaller =
                new System.ServiceProcess.ServiceProcessInstaller();


            serviceInstaller.Description = "iRacing Settings Server";
            serviceInstaller.DisplayName = "iRacing Settings Server";
            serviceInstaller.ServiceName = "iRacingSettingsServer";
            serviceInstaller.StartType   = System.ServiceProcess.ServiceStartMode.Automatic;

            processInstaller.Account  = System.ServiceProcess.ServiceAccount.LocalSystem;
            processInstaller.Password = null;
            processInstaller.Username = null;

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
示例#4
0
        public Installer()
        {
            InitializeComponent();

            // Instantiate installers for process and services.
            processInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

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

            // The services are started manually.
            serviceInstaller.StartType = ServiceStartMode.Manual;

            // ServiceName must equal those on ServiceBase derived classes.
            serviceInstaller.ServiceName = "LedWallViewport";

            // Add installers to collection. Order is not important.
            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
示例#5
0
        public ServiceInstallerUtility()
        {
            //InitializeComponent();
            processInstaller = new ServiceProcessInstaller
            {
                Account = ServiceAccount.LocalSystem
            };

            serviceInstaller = new ServiceInstaller
            {
                StartType = ServiceStartMode.Automatic,
                //DelayedAutoStart = true,
                ServiceName = serviceName,
                DisplayName = serviceDisplayName,
                Description = serviceDescription
            };
            serviceInstaller.AfterInstall += new InstallEventHandler(ServiceInstaller_AfterInstall);

            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);
        }
示例#6
0
        public Installer1()
        {
            InitializeComponent();
            serviceInstaller = new ServiceInstaller();
            processInstaller = new ServiceProcessInstaller();

            processInstaller.Account     = ServiceAccount.LocalSystem;
            serviceInstaller.StartType   = ServiceStartMode.Manual;
            serviceInstaller.ServiceName = "SynchronizerService";
            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);

            //RegistryKey ckey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\SynchronizerService", true);
            //if (ckey != null)
            //{
            //    if (ckey.GetValue("Type") != null)
            //    {
            //        ckey.SetValue("Type", ((int)ckey.GetValue("Type") | 256));
            //    }
            //}
        }
示例#7
0
        public WinServiceInstaller()
        {
            var spi = new ServiceProcessInstaller();
            var si  = new ServiceInstaller();

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

            si.DisplayName = Assembly.GetExecutingAssembly().GetName().Name;
            si.ServiceName = Assembly.GetExecutingAssembly().GetName().Name;
            si.StartType   = ServiceStartMode.Automatic;

            if (EventLog.SourceExists(Assembly.GetExecutingAssembly().GetName().Name))
            {
                EventLog.DeleteEventSource(Assembly.GetExecutingAssembly().GetName().Name);
            }

            Installers.Add(spi);
            Installers.Add(si);
        }
示例#8
0
        public ProjectInstaller()
        {
            InitializeComponent();
            serviceInstaller1.Description = Properties.strings.Service_Description;

            // Eventlog Installer
            EventLogInstaller eventLogInstaller1 = new EventLogInstaller();

            eventLogInstaller1.Source = EvictPowerSrv.LOG_SOURCE;
            eventLogInstaller1.Log    = EvictPowerSrv.LOG_NAME;
            Installers.Add(eventLogInstaller1);

            EventLogInstaller eventLogInstaller2 = new EventLogInstaller();

            eventLogInstaller2.Source = LoopThread.LOG_SOURCE;
            eventLogInstaller2.Log    = LoopThread.LOG_NAME;
            Installers.Add(eventLogInstaller2);

            // Start service after installing
            serviceInstaller1.AfterInstall += (sender, args) => new ServiceController(serviceInstaller1.ServiceName).Start();
        }
// <Snippet3>
// <Snippet2>
    public override void Uninstall(IDictionary savedState)
    {
        Console.Write("Enter a source from log to uninstall(eg: MySource ): ");
        myInstaller.Source = Console.ReadLine();

        Console.Write("Do you want to uninstall, press 'y' for 'YES' and 'n' for 'NO':");
        string myUninstall = Console.ReadLine();

        if (myUninstall == "n")
        {
            // No action to be taken on the resource in the event log.
            myInstaller.UninstallAction = System.Configuration.Install.UninstallAction.NoAction;
        }
        else
        {
            // Remove the resource from the event log.
            myInstaller.UninstallAction = System.Configuration.Install.UninstallAction.Remove;
        }
        Installers.Add(myInstaller);
        base.Uninstall(savedState);
    }
        /// <summary>

        /// Public Constructor for WindowsServiceInstaller.

        /// - Put all of your Initialization code here.

        /// </summary>

        public AggregatorServiceInstaller()
        {
            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 = AggregatorService.AscMailCollectionServiceName;
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

            serviceInstaller.ServiceName = AggregatorService.AscMailCollectionServiceName;
            Installers.Add(serviceProcessInstaller);
            Installers.Add(serviceInstaller);
        }
        public WindowsServiceInstaller()
        {
            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();

            processInstaller.Account = ServiceAccount.LocalSystem;

            ServiceInstaller serviceInstaller = new ServiceInstaller();

            processInstaller.Password = "";
            processInstaller.Username = "";
            processInstaller.Account  = ServiceAccount.LocalSystem;

            serviceInstaller.DisplayName = "Служба обработки автоответов УЗ";
            serviceInstaller.ServiceName = "ServiceConcentParseMes";
            serviceInstaller.Description = "Сервис обрабатывает данные и передает их в сервис записи в БД";

            serviceInstaller.StartType = ServiceStartMode.Automatic;

            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);
        }
        public TServiceInstaller()
        {
            serviceInstaller = new ServiceInstaller
            {
                DisplayName = "TServiceNew6",
                ServiceName = "TServiceNew6",
                StartType   = ServiceStartMode.Automatic,
                Description = "T Service New6"
            };

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

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);

            InitializeComponent();

            AfterInstall += new InstallEventHandler(TServiceInstaller_AfterInstall);
        }
示例#13
0
        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 = "P1BroadcastService";
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

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

            Installers.Add(serviceProcessInstaller);
            Installers.Add(serviceInstaller);
        }
示例#14
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);
        }
示例#15
0
        public WindowsService2Installer()
        {
            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();

            Installers.Add(processInstaller);

            processInstaller.Account = ServiceAccount.LocalService;

            ServiceInstaller installerA = new ServiceInstaller();

            installerA.ServiceName = "WindowsService2a";
            installerA.DisplayName = "[Test] Windows Service #2-A";
            Installers.Add(installerA);


            ServiceInstaller installerB = new ServiceInstaller();

            installerB.ServiceName = "WindowsService2b";
            installerB.DisplayName = "[Test] Windows Service #2-B";
            Installers.Add(installerB);
        }
        /// <summary>
        /// Initializes a new instance of LogbusDaemonInstaller
        /// </summary>
        public LogbusDaemonInstaller()
        {
            _serviceProcessInstaller = new ServiceProcessInstaller
            {
                Account  = ServiceAccount.LocalSystem,
                Username = null,
                Password = null,
            };

            _serviceInstaller = new ServiceInstaller
            {
                ServiceName = "Logbus-ng",
                StartType   = ServiceStartMode.Automatic
            };

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

            var serviceProcessInstaller = new ServiceProcessInstaller()
            {
                Account = ServiceAccount.LocalSystem,
                //Password = null,
                //Username = null,
            };

            var serviceInstaller = new ServiceInstaller()
            {
                StartType   = ServiceStartMode.Automatic,
                DisplayName = DisplayName,
                ServiceName = ServiceName,
                Description = "Monitors file system according configuration and stores file backup upon file modification.",
            };

            Installers.AddRange(new Installer[] { serviceProcessInstaller, serviceInstaller });
        }
示例#18
0
        public HelperInstaller()
        {
            ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller();
            ServiceInstaller        serviceInstaller        = new ServiceInstaller();

            serviceProcessInstaller.Account = ServiceAccount.User;

            serviceProcessInstaller.Username = @"MILK\FUDGE_FX_COMPILER";
            serviceProcessInstaller.Password = @"fxcompiler";

            //serviceProcessInstaller.Username = Framework.GetCompilerUserName();
            //serviceProcessInstaller.Password = Framework.GetCompilerUserPassword().ToString();

            serviceInstaller.DisplayName = "Fudge Framework Helper Service";
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

            serviceInstaller.ServiceName = "Fudge Framework Helper Service";

            Installers.Add(serviceProcessInstaller);
            Installers.Add(serviceInstaller);
        }
        private void AcsServiceInit()
        {
            String path       = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            String executable = Path.GetFullPath(Assembly.GetExecutingAssembly().Location);

            Console.WriteLine("Path = {0}", path);
            Console.WriteLine("Executable = {0}", executable);

            String configFilePath = String.Format("{0}.config", executable);

            using (AppConfig.Change(configFilePath))
            {
                Installers.Clear();


                WorkloadContainerProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
                WorkloadContainerServiceInstaller = new System.ServiceProcess.ServiceInstaller();

                // Default to LocalService account.  Admins can reset to domain account after install
                // if needed.
                WorkloadContainerProcessInstaller.Account  = System.ServiceProcess.ServiceAccount.LocalService;
                WorkloadContainerProcessInstaller.Password = null;
                WorkloadContainerProcessInstaller.Username = null;

                Console.WriteLine("Parsing config file");
                foreach (String key in ConfigurationManager.AppSettings.AllKeys)
                {
                    Console.WriteLine("{0} = '{1}'", key, ConfigurationManager.AppSettings[key]);
                }

                WorkloadContainerServiceInstaller.Description = Helpers.GetSetting("ServiceDescription") ?? WorkloadContainerServiceInstaller.Description;
                WorkloadContainerServiceInstaller.DisplayName = Helpers.GetSetting("ServiceDisplayName") ?? WorkloadContainerServiceInstaller.DisplayName;
                WorkloadContainerServiceInstaller.ServiceName = Helpers.GetSetting("ServiceName") ?? WorkloadContainerServiceInstaller.ServiceName;

                Installers.AddRange(new System.Configuration.Install.Installer[] {
                    WorkloadContainerProcessInstaller,
                    WorkloadContainerServiceInstaller
                });
            }
        }
示例#20
0
        public ProjectInstaller()
            : base()// Setup Base Class
        {
            //Instantiate Installers
            processInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

            //Configure Installers
            //processInstaller.Account = ServiceAccount.User;
            this.processInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            //processInstaller.Username = "******"
            //processInstaller.Password = ""
            //Singular.SystemSettings.GetSystemSetting(Of CSLib.SystemSettings.CorrespondenceSettings).GetDecryptedOutgoingMailPassword.ToString

            serviceInstaller.StartType   = ServiceStartMode.Manual;
            serviceInstaller.ServiceName = SchedulerServiceName;
            //serviceInstaller.ServicesDependedOn = New String() {"MSSQL$SQL2012"}

            //Add them to the list of installers to install
            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
示例#21
0
        public ProjectInstaller()
        {
            InitializeComponent();
            // Instantiate installers for process and services.
            processInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

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

            // The services are started automatically.
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            // ServiceName must equal those on ServiceBase derived classes.
            serviceInstaller.ServiceName = "Adaptive firewall";

            serviceInstaller.Description = "Monitors event log entries to block IP addresses with Windows Firewall after unsuccessful logins.";

            // Add installers to collection. Order is not important.
            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
示例#22
0
        public override void Install(IDictionary stateSaver)
        {
            Installers.AddRange(_installers);

            if (_log.IsInfoEnabled)
            {
                _log.InfoFormat("Installing {0} service", _settings.DisplayName);
            }

            base.Install(stateSaver);

            if (_log.IsDebugEnabled)
            {
                _log.Debug("Opening Registry");
            }

            using (RegistryKey system = Registry.LocalMachine.OpenSubKey("System"))
                using (RegistryKey currentControlSet = system.OpenSubKey("CurrentControlSet"))
                    using (RegistryKey services = currentControlSet.OpenSubKey("Services"))
                        using (RegistryKey service = services.OpenSubKey(_settings.ServiceName, true))
                        {
                            service.SetValue("Description", _settings.Description);

                            var imagePath = (string)service.GetValue("ImagePath");

                            _log.DebugFormat("Service path: {0}", imagePath);

                            imagePath += _arguments;

                            _log.DebugFormat("Image path: {0}", imagePath);

                            service.SetValue("ImagePath", imagePath);
                        }

            if (_log.IsDebugEnabled)
            {
                _log.Debug("Closing Registry");
            }
        }
示例#23
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public ApplicationInstaller()
        {
            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller
            {
                Account = ServiceAccount.NetworkService
            };

            string           version          = IrbisConnection.ClientVersion.ToString();
            ServiceInstaller serviceInstaller = new ServiceInstaller
            {
                Description = "IRBIS64 compatible open source network service",
                DisplayName = IrbisService.IrbisNet + " v" + version,
                ServiceName = IrbisService.IrbisNet,
                StartType   = ServiceStartMode.Automatic,
#if FW4
                DelayedAutoStart = true
#endif
            };

            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);
        }
示例#24
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);
        }
示例#25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IRServerInstaller"/> class.
        /// </summary>
        public IRServerInstaller()
        {
            Committing += IRServerInstaller_Committing;
            //this.AfterInstall += new InstallEventHandler(IRServerInstaller_AfterInstall);

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

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

            // Service Information
            serviceInstaller.ServiceName = Shared.ServerName;
            serviceInstaller.DisplayName = Shared.ServerDisplayName;
            serviceInstaller.Description = Program.ServiceDescription;
            serviceInstaller.StartType   = ServiceStartMode.Automatic;

            Installers.Add(serviceProcessInstaller);
            Installers.Add(serviceInstaller);
        }
示例#26
0
        public ServicesInstaller()
        {
            try
            {
                process         = new ServiceProcessInstaller();
                process.Account = ServiceAccount.LocalSystem;

                Installers.Add(WorkflowActionService.Installer);
                Installers.Add(BulkOperationService.Installer);
                Installers.Add(APILeadSubmissionService.Installer);
                Installers.Add(CampaignService.Installer);
                Installers.Add(FormSubmissionService.Installer);
                Installers.Add(IndexingService.Installer);
                Installers.Add(ImportLeadService.Installer);
                Installers.Add(LeadAdapterService.Installer);
                Installers.Add(LeadScoreService.Installer);
                Installers.Add(process);
            }
            catch (Exception ex)
            {
            }
        }
 public MyPerformanceCounterInstaller()
 {
     try
     {
         // Create an instance of 'PerformanceCounterInstaller'.
         PerformanceCounterInstaller myPerformanceCounterInstaller =
             new PerformanceCounterInstaller();
         // Set the 'CategoryName' for performance counter.
         myPerformanceCounterInstaller.CategoryName =
             "MyPerformanceCounter";
         CounterCreationData myCounterCreation = new CounterCreationData();
         myCounterCreation.CounterName = "MyCounter";
         myCounterCreation.CounterHelp = "Counter Help";
         // Add a counter to collection of  myPerformanceCounterInstaller.
         myPerformanceCounterInstaller.Counters.Add(myCounterCreation);
         Installers.Add(myPerformanceCounterInstaller);
     }
     catch (Exception e)
     {
         this.Context.LogMessage("Error occurred :" + e.Message);
     }
 }
示例#28
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MailServer_Service_Installer()
        {
            // This call is required by the Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitComponent call
            processInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

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

            // The services will be started manually.
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            // ServiceName must equal those on ServiceBase derived classes.
            serviceInstaller.ServiceName = "LumiSoft Mail Server";

            // Add installers to collection. Order is not important.
            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
示例#29
0
        public TTInstaller()
        {
            if (!Enum.TryParse(AppSettingsHelper.ReadValue("service-install-as"), true, out _serviceAccount))
            {
                _serviceAccount = ServiceAccount.LocalSystem;
            }

            var process = new ServiceProcessInstaller
            {
                Account = _serviceAccount
            };
            var service = new ServiceInstaller
            {
                ServiceName = ServiceName,
                DisplayName = DisplayName,
                Description = Description,
                StartType   = ServiceStartMode.Automatic,
            };

            Installers.Add(process);
            Installers.Add(service);
        }
示例#30
0
        // Constructor
        public ServiceInstaller()
        {
            // Define the runtime user
            var process = new ServiceProcessInstaller
            {
                Account  = ServiceAccount.LocalSystem,
                Username = null,
                Password = null
            };

            Installers.Add(process);

            // Define the service configuration
            var installer = new System.ServiceProcess.ServiceInstaller
            {
                StartType   = ServiceStartMode.Automatic,
                ServiceName = "CiscoListener",
                DisplayName = "Cisco Smart Call Home Listener"
            };

            Installers.Add(installer);
        }