From 6e58ae31bd3c4da1944fb2b44a6a26a3c7e982fb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 6 Oct 2013 14:47:39 -0400 Subject: [PATCH] update update components --- .../Updates/ApplicationUpdater.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Common.Implementations/Updates/ApplicationUpdater.cs b/MediaBrowser.Common.Implementations/Updates/ApplicationUpdater.cs index 4a15f452a..b0ae93960 100644 --- a/MediaBrowser.Common.Implementations/Updates/ApplicationUpdater.cs +++ b/MediaBrowser.Common.Implementations/Updates/ApplicationUpdater.cs @@ -1,4 +1,5 @@ using MediaBrowser.Common.Configuration; +using MediaBrowser.Model.Logging; using System.Diagnostics; using System.IO; @@ -17,7 +18,7 @@ namespace MediaBrowser.Common.Implementations.Updates { private const string UpdaterExe = "Mediabrowser.Updater.exe"; private const string UpdaterDll = "Mediabrowser.InstallUtil.dll"; - public void UpdateApplication(MBApplication app, IApplicationPaths appPaths, string archive) + public void UpdateApplication(MBApplication app, IApplicationPaths appPaths, string archive, ILogger logger, string restartServiceName) { // First see if there is a version file and read that in var version = "Unknown"; @@ -29,10 +30,14 @@ namespace MediaBrowser.Common.Implementations.Updates // Use our installer passing it the specific archive // We need to copy to a temp directory and execute it there var source = Path.Combine(appPaths.ProgramSystemPath, UpdaterExe); + + logger.Info("Copying updater to temporary location"); var tempUpdater = Path.Combine(Path.GetTempPath(), UpdaterExe); File.Copy(source, tempUpdater, true); source = Path.Combine(appPaths.ProgramSystemPath, UpdaterDll); var tempUpdaterDll = Path.Combine(Path.GetTempPath(), UpdaterDll); + + logger.Info("Copying updater dependencies to temporary location"); File.Copy(source, tempUpdaterDll, true); var product = app == MBApplication.MBTheater ? "mbt" : "server"; // Our updater needs SS and ionic @@ -40,7 +45,9 @@ namespace MediaBrowser.Common.Implementations.Updates File.Copy(source, Path.Combine(Path.GetTempPath(), "ServiceStack.Text.dll"), true); source = Path.Combine(appPaths.ProgramSystemPath, "SharpCompress.dll"); File.Copy(source, Path.Combine(Path.GetTempPath(), "SharpCompress.dll"), true); - Process.Start(tempUpdater, string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3}", product, archive, Process.GetCurrentProcess().Id, version)); + + logger.Info("Starting updater process."); + Process.Start(tempUpdater, string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3} service={4}", product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty)); // That's it. The installer will do the work once we exit }