mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-28 03:18:27 +01:00
add more content to dlna profile editing page
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Constants;
|
||||
using MediaBrowser.Common.Implementations.Logging;
|
||||
using MediaBrowser.Common.Implementations.Updates;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Server.Implementations;
|
||||
using MediaBrowser.ServerApplication.Native;
|
||||
using MediaBrowser.ServerApplication.Splash;
|
||||
using MediaBrowser.ServerApplication.Updates;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Configuration.Install;
|
||||
@@ -490,7 +489,7 @@ namespace MediaBrowser.ServerApplication
|
||||
try
|
||||
{
|
||||
var serviceName = _isRunningAsService ? BackgroundService.Name : string.Empty;
|
||||
new ApplicationUpdater().UpdateApplication(MBApplication.MBServer, appPaths, updateArchive, logger, serviceName);
|
||||
new ApplicationUpdater().UpdateApplication(appPaths, updateArchive, logger, serviceName);
|
||||
|
||||
// And just let the app exit so it can update
|
||||
return true;
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
<Compile Include="Splash\SplashForm.Designer.cs">
|
||||
<DependentUpon>SplashForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Updates\ApplicationUpdater.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
||||
49
MediaBrowser.ServerApplication/Updates/ApplicationUpdater.cs
Normal file
49
MediaBrowser.ServerApplication/Updates/ApplicationUpdater.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
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");
|
||||
}
|
||||
|
||||
// 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);
|
||||
const string product = "server";
|
||||
// Our updater needs SS and ionic
|
||||
source = Path.Combine(appPaths.ProgramSystemPath, "ServiceStack.Text.dll");
|
||||
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);
|
||||
|
||||
logger.Info("Starting updater process.");
|
||||
Process.Start(tempUpdater, string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3} service={4} installpath=\"{5}\"", product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty, appPaths.ProgramDataPath));
|
||||
|
||||
// That's it. The installer will do the work once we exit
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user