aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/MainStartup.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-05-26 16:06:31 -0400
committerLuke <luke.pulverenti@gmail.com>2015-05-26 16:06:31 -0400
commit8bd7055d1738f22e9f52cd80a79e7a4ac23d61ff (patch)
tree185830059da50b6c43f13ca528fe981c1266808f /MediaBrowser.ServerApplication/MainStartup.cs
parenta3d796cd54c809c7ec2783e5cab6c37b2950410d (diff)
parentb666c627c8def4d1236090372bd6795fec940979 (diff)
Merge pull request #1109 from MediaBrowser/dev
3.0.5621.3
Diffstat (limited to 'MediaBrowser.ServerApplication/MainStartup.cs')
-rw-r--r--MediaBrowser.ServerApplication/MainStartup.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs
index 6e8774eea..968172bc3 100644
--- a/MediaBrowser.ServerApplication/MainStartup.cs
+++ b/MediaBrowser.ServerApplication/MainStartup.cs
@@ -370,7 +370,8 @@ namespace MediaBrowser.ServerApplication
private static void RunServiceInstallationIfNeeded(string applicationPath)
{
- var ctl = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == BackgroundService.Name);
+ var serviceName = BackgroundService.GetExistingServiceName();
+ var ctl = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == serviceName);
if (ctl == null)
{
@@ -476,7 +477,7 @@ namespace MediaBrowser.ServerApplication
// Update is there - execute update
try
{
- var serviceName = _isRunningAsService ? BackgroundService.Name : string.Empty;
+ var serviceName = _isRunningAsService ? BackgroundService.GetExistingServiceName() : string.Empty;
new ApplicationUpdater().UpdateApplication(appPaths, updateArchive, logger, serviceName);
// And just let the app exit so it can update
@@ -515,11 +516,11 @@ namespace MediaBrowser.ServerApplication
_logger.Info("Hiding server notify icon");
_serverNotifyIcon.Visible = false;
- _logger.Info("Executing windows forms restart");
+ _logger.Info("Starting new instance");
//Application.Restart();
Process.Start(_appHost.ServerConfigurationManager.ApplicationPaths.ApplicationPath);
- _logger.Info("Calling Application.Exit");
+ _logger.Info("Calling Environment.Exit");
Environment.Exit(0);
}
}
@@ -539,7 +540,7 @@ namespace MediaBrowser.ServerApplication
private static void ShutdownWindowsService()
{
_logger.Info("Stopping background service");
- var service = new ServiceController(BackgroundService.Name);
+ var service = new ServiceController(BackgroundService.GetExistingServiceName());
service.Refresh();