From 71386f0ceb15ce0bac2e588f90781a4bd274fe68 Mon Sep 17 00:00:00 2001 From: hatharry Date: Mon, 29 Aug 2016 01:42:25 +1200 Subject: [PATCH] Check service running before checking self restart --- MediaBrowser.ServerApplication/MainStartup.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index d56558c72c..e4f5f3a694 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/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();