/// <summary>
        /// Method OnWindowsServiceInstallerCommitted.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Instance of InstallEventArgs.</param>
        private void OnWindowsServiceInstallerCommitted(object sender, InstallEventArgs e)
        {
            if (this.InstallerSetupInfo.RestartOnFailure)
            {
                try
                {
                    ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(Environment.SystemDirectory, "cmd.exe"));
                    startInfo.Arguments       = string.Format(" /C {0}", string.Format("sc failure \"{0}\" reset= 60 actions= restart/300000", this.InstallerSetupInfo.ServiceName));
                    startInfo.CreateNoWindow  = true;
                    startInfo.ErrorDialog     = false;
                    startInfo.UseShellExecute = true;
                    startInfo.Verb            = "runas";
                    startInfo.WindowStyle     = ProcessWindowStyle.Hidden;
                    Process process = Process.Start(startInfo);

                    if (process.WaitForExit(5000))
                    {
                        process.Dispose();
                    }
                }
                catch
                {
                }
            }

            if (this.InstallerSetupInfo.StartAfterInstall)
            {
                WindowsServiceBase.Start(this.InstallerSetupInfo.ServiceName);
            }
        }
        /// <summary>
        /// Method Start.
        /// </summary>
        private void Start()
        {
            ServiceControllerStatus originalConsoleStatus = this._consoleStatus;

            if (this.IsConsoleMode)
            {
                if (this._consoleStatus == ServiceControllerStatus.Stopped)
                {
                    this._consoleStatus = ServiceControllerStatus.StartPending;
                    this.WriteToConsole(ConsoleColor.Yellow, string.Format("[Status:] {0}", this._consoleStatus.ToString()));

                    try
                    {
                        this._windowsService.OnStart(this._serviceArgs);
                        this._consoleStatus = ServiceControllerStatus.Running;
                    }
                    catch (Exception e)
                    {
                        InternalLogger.Log(e);
                        this._consoleStatus = originalConsoleStatus;
                    }
                }

                this.WriteToConsole(ConsoleColor.Yellow, string.Format("[Status:] {0}", this._consoleStatus.ToString()));
            }
            else
            {
                if (WindowsServiceBase.ServiceExists(this._setupInfo.ServiceName))
                {
                    if (this.ServiceStatus == ServiceControllerStatus.Stopped)
                    {
                        this.WriteToConsole(ConsoleColor.Yellow, string.Format("[Status:] {0}", this.ServiceStatus.ToString()));
                        WindowsServiceBase.Start(this._setupInfo.ServiceName, this._serviceArgs);
                    }

                    this.WriteToConsole(ConsoleColor.Yellow, string.Format("[Status:] {0}", this.ServiceStatus.ToString()));
                }
                else
                {
                    this.WriteToConsole(ConsoleColor.Red, "The specified service does not exist as an installed service.", true, false);
                }
            }
        }