diff options
| author | hatharry <hatharry@hotmail.com> | 2016-08-29 01:42:25 +1200 |
|---|---|---|
| committer | hatharry <hatharry@hotmail.com> | 2016-08-29 01:42:25 +1200 |
| commit | 71386f0ceb15ce0bac2e588f90781a4bd274fe68 (patch) | |
| tree | 99524b1be82e3ee10e23c55cea49f327b76a6d85 | |
| parent | cabf2cdc1be4c06714ac6bcf835a19d2f652a6e2 (diff) | |
Check service running before checking self restart
| -rw-r--r-- | MediaBrowser.ServerApplication/MainStartup.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index d56558c72..e4f5f3a69 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(); |
