Ejemplo n.º 1
0
        public ProjectInstaller()
        {
            InitializeComponent();

            var service = new RunAsService();

            serviceInstaller1.DisplayName = service.DisplayName;
            serviceInstaller1.Description = service.Description;
            serviceInstaller1.ServiceName = service.ServiceName;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        private static void Main()
        {
            XmlConfigurator.ConfigureAndWatch(
                new FileInfo(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
            );

            #if !DEBUG
            ServiceBase[] ServicesToRun;

            // More than one user Service may run within the same process. To add
            // another service to this process, change the following line to
            // create a second service object. For example,
            //
            //   ServicesToRun = new ServiceBase[] {new Service1(), new MySecondUserService()};
            //
            ServicesToRun = new ServiceBase[] { new RunAsService() };

            ServiceBase.Run(ServicesToRun);
            #else
            var service = new RunAsService();
            service.StartCommand();
            System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            #endif
        }