Ejemplo n.º 1
0
        /// <summary>
        /// Rolls back to the state of the counter, and performs the normal rollback.
        /// </summary>
        /// <param name="savedState">The saved state for the installation.</param>
        public override void Rollback(IDictionary savedState)
        {
            ConsoleHarness.WriteToConsole(ConsoleColor.White, "Rolling back service {0}.", this.Configuration.Name);

            this.ConfigureInstallers();

            base.Rollback(savedState);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Installs the service.
        /// </summary>
        /// <param name="savedState">The saved state for the installation.</param>
        public override void Install(IDictionary savedState)
        {
            ConsoleHarness.WriteToConsole(ConsoleColor.White, "Installing service {0}.", this.Configuration.Name);

            this.ConfigureInstallers();

            base.Install(savedState);

            if (!string.IsNullOrWhiteSpace(this.Configuration.EventLogSource))
            {
                if (!EventLog.SourceExists(this.Configuration.EventLogSource))
                {
                    EventLog.CreateEventSource(this.Configuration.EventLogSource, "Application");
                }
            }
        }