aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-06 14:48:04 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-06 14:48:04 -0400
commitbd5bf32aba45f3a4dff4f883505ddf9fb528e53a (patch)
tree0f337d7acbbd18963827228062cf4df2d0384bf0 /MediaBrowser.ServerApplication
parent6e58ae31bd3c4da1944fb2b44a6a26a3c7e982fb (diff)
fix web socket message name for library change
Diffstat (limited to 'MediaBrowser.ServerApplication')
-rw-r--r--MediaBrowser.ServerApplication/MainStartup.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs
index 7e19e5f95..577f5ea38 100644
--- a/MediaBrowser.ServerApplication/MainStartup.cs
+++ b/MediaBrowser.ServerApplication/MainStartup.cs
@@ -1,5 +1,4 @@
-using System.Runtime.InteropServices;
-using MediaBrowser.Common.Constants;
+using MediaBrowser.Common.Constants;
using MediaBrowser.Common.Implementations.Logging;
using MediaBrowser.Common.Implementations.Updates;
using MediaBrowser.Controller.IO;
@@ -13,6 +12,7 @@ using System.Configuration.Install;
using System.Diagnostics;
using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Windows;
@@ -251,9 +251,7 @@ namespace MediaBrowser.ServerApplication
if (_isRestarting)
{
- using (var process = Process.Start("cmd", "/c net start " + BackgroundService.Name))
- {
- }
+ Process.Start("cmd", "/c net start " + BackgroundService.Name);
_logger.Info("New service process started");
}
@@ -383,6 +381,8 @@ namespace MediaBrowser.ServerApplication
_logger.ErrorException("UnhandledException", exception);
+ _appHost.LogManager.Flush();
+
if (!_isRunningAsService)
{
_app.OnUnhandledException(exception);
@@ -390,7 +390,7 @@ namespace MediaBrowser.ServerApplication
if (!Debugger.IsAttached)
{
- Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception));
+ Environment.Exit(Marshal.GetHRForException(exception));
}
}
@@ -411,13 +411,16 @@ namespace MediaBrowser.ServerApplication
// Update is there - execute update
try
{
- new ApplicationUpdater().UpdateApplication(MBApplication.MBServer, appPaths, updateArchive);
+ var serviceName = _isRunningAsService ? BackgroundService.Name : string.Empty;
+ new ApplicationUpdater().UpdateApplication(MBApplication.MBServer, appPaths, updateArchive, logger, serviceName);
// And just let the app exit so it can update
return true;
}
catch (Exception e)
{
+ logger.ErrorException("Error starting updater.", e);
+
MessageBox.Show(string.Format("Error attempting to update application.\n\n{0}\n\n{1}", e.GetType().Name, e.Message));
}
}