浏览代码

Check service running before checking self restart

hatharry 9 年之前
父节点
当前提交
71386f0ceb
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      MediaBrowser.ServerApplication/MainStartup.cs

+ 5 - 1
MediaBrowser.ServerApplication/MainStartup.cs

@@ -45,7 +45,11 @@ namespace MediaBrowser.ServerApplication
         {
             var options = new StartupOptions();
             _isRunningAsService = options.ContainsOption("-service");
-            _canRestartService = CanRestartWindowsService();
+
+            if (_isRunningAsService)
+            {
+                _canRestartService = CanRestartWindowsService();
+            }
 
             var currentProcess = Process.GetCurrentProcess();