private static int RestartService()
        {
            int result = 0;
            ServiceController serviceController = new ServiceController
            {
                ServiceName = ProductSettings.get_ServiceName()
            };

            if (serviceController.Status != ServiceControllerStatus.Stopped)
            {
                return(result);
            }
            Log.Debug(string.Format("Starting {0} service ...", ProductSettings.get_ServiceName()));
            try
            {
                TimeSpan timeout = new TimeSpan(0, 0, 5);
                serviceController.Start();
                serviceController.WaitForStatus(ServiceControllerStatus.Running, timeout);
                Log.Debug(string.Format("{0} service is started", ProductSettings.get_ServiceName()));
            }
            catch
            {
                Log.Error(string.Format("Can't start {0}", ProductSettings.get_ServiceName()));
                result = -1;
            }
            return(result);
        }