diff options
| author | stefan <stefan@hegedues.at> | 2018-09-12 19:26:21 +0200 |
|---|---|---|
| committer | stefan <stefan@hegedues.at> | 2018-09-12 19:26:21 +0200 |
| commit | 48facb797ed912e4ea6b04b17d1ff190ac2daac4 (patch) | |
| tree | 8dae77a31670a888d733484cb17dd4077d5444e8 /MediaBrowser.ServerApplication/Updates | |
| parent | c32d8656382a0eacb301692e0084377fc433ae9b (diff) | |
Update to 3.5.2 and .net core 2.1
Diffstat (limited to 'MediaBrowser.ServerApplication/Updates')
| -rw-r--r-- | MediaBrowser.ServerApplication/Updates/ApplicationUpdater.cs | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/MediaBrowser.ServerApplication/Updates/ApplicationUpdater.cs b/MediaBrowser.ServerApplication/Updates/ApplicationUpdater.cs deleted file mode 100644 index aa8679bd50..0000000000 --- a/MediaBrowser.ServerApplication/Updates/ApplicationUpdater.cs +++ /dev/null @@ -1,65 +0,0 @@ -using MediaBrowser.Common.Configuration; -using MediaBrowser.Model.Logging; -using System.Diagnostics; -using System.IO; - -namespace MediaBrowser.ServerApplication.Updates -{ - /// <summary> - /// Update the specified application using the specified archive - /// </summary> - public class ApplicationUpdater - { - private const string UpdaterExe = "Mediabrowser.Updater.exe"; - private const string UpdaterDll = "Mediabrowser.InstallUtil.dll"; - public void UpdateApplication(IApplicationPaths appPaths, string archive, ILogger logger, string restartServiceName) - { - // First see if there is a version file and read that in - var version = "Unknown"; - if (File.Exists(archive + ".ver")) - { - version = File.ReadAllText(archive + ".ver"); - } - - var systemPath = appPaths.ProgramSystemPath; - var tempPath = Path.GetTempPath(); - - // Use our installer passing it the specific archive - // We need to copy to a temp directory and execute it there - var source = Path.Combine(systemPath, UpdaterExe); - - logger.Info("Copying updater to temporary location"); - var tempUpdater = Path.Combine(tempPath, UpdaterExe); - File.Copy(source, tempUpdater, true); - source = Path.Combine(systemPath, UpdaterDll); - var tempUpdaterDll = Path.Combine(tempPath, UpdaterDll); - - logger.Info("Copying updater dependencies to temporary location"); - File.Copy(source, tempUpdaterDll, true); - var product = "server"; - - logger.Info("Starting updater process."); - - // installpath = program data folder - // startpath = executable to launch - // systempath = folder containing installation - var args = string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3} service={4} installpath=\"{5}\" startpath=\"{6}\" systempath=\"{7}\"", - product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty, appPaths.ProgramDataPath, MainStartup.ApplicationPath, systemPath); - - logger.Info("Args: {0}", args); - - Process.Start(new ProcessStartInfo - { - FileName = tempUpdater, - Arguments = args, - UseShellExecute = false, - CreateNoWindow = true, - ErrorDialog = false, - WindowStyle = ProcessWindowStyle.Hidden, - WorkingDirectory = Path.GetDirectoryName(tempUpdater) - }); - - // That's it. The installer will do the work once we exit - } - } -} |
