diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-02 18:27:12 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-02 18:27:12 -0500 |
| commit | 71fe785c6de047a09f6f585fd407332e73415f0e (patch) | |
| tree | 6680b7ab819bf23f1cad3c833147213a131f7991 /MediaBrowser.ServerApplication/App.xaml.cs | |
| parent | f4f5d31cdec444e3a3fa244581e79251db5e7432 (diff) | |
| parent | 60662a0f165d1cf4c271c95f00b57fc484ab75e3 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.ServerApplication/App.xaml.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/App.xaml.cs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/MediaBrowser.ServerApplication/App.xaml.cs b/MediaBrowser.ServerApplication/App.xaml.cs index e9baa96e7..dddd87782 100644 --- a/MediaBrowser.ServerApplication/App.xaml.cs +++ b/MediaBrowser.ServerApplication/App.xaml.cs @@ -1,8 +1,11 @@ -using MediaBrowser.ClickOnce; +using System.IO; +using MediaBrowser.Common.Constants; using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Updates; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Logging; +using MediaBrowser.Server.Implementations; using Microsoft.Win32; using System; using System.Diagnostics; @@ -27,6 +30,25 @@ namespace MediaBrowser.ServerApplication [STAThread] public static void Main() { + // Look for the existence of an update archive + var appPaths = new ServerApplicationPaths(); + var updateArchive = Path.Combine(appPaths.TempUpdatePath, Constants.MBServerPkgName + ".zip"); + if (File.Exists(updateArchive)) + { + // Update is there - execute update + try + { + new ApplicationUpdater().UpdateApplication(MBApplication.MBServer, appPaths, updateArchive); + + // And just let the app exit so it can update + return; + } + catch (Exception e) + { + MessageBox.Show(string.Format("Error attempting to update application.\n\n{0}\n\n{1}", e.GetType().Name, e.Message)); + } + } + var application = new App(); application.Run(); |
