The Free Software Media System - Server Backend & API
Remove DLL support and require all packages/plugins to be zip archives
Claus Viumda169dddb5b1
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.csindex 127b9c62ab..f03a594cde 100644--- a/Emby.Server.Implementations/Updates/InstallationManager.cs+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs@@ -529,20 +529,17 @@ namespace Emby.Server.Implementations.Updatesprivate async Task PerformPackageInstallation(IProgress<double> progress, string target, PackageVersionInfo package, CancellationToken cancellationToken){- // Target based on if it is an archive or single assemblyvar extension = Path.GetExtension(package.targetFilename);var isArchive = string.Equals(extension, ".zip", StringComparison.OrdinalIgnoreCase);+ if (!isArchive)+ {+ _logger.LogError("Only zip packages are supported. {Filename} is not a zip archive.", package.targetFilename);+ return;+ }if (target == null){- if (isArchive)- {- target = Path.Combine(_appPaths.PluginsPath, Path.GetFileNameWithoutExtension(package.targetFilename));- }- else- {- target = Path.Combine(_appPaths.PluginsPath, package.targetFilename);- }+ target = Path.Combine(_appPaths.PluginsPath, Path.GetFileNameWithoutExtension(package.targetFilename));}// Download to temporary file so that, if interrupted, it won't destroy the existing installation@@ -561,17 +558,9 @@ namespace Emby.Server.Implementations.Updates// Success - move it to the real targettry{- if (isArchive)- {- using (var stream = File.OpenRead(tempFile))- {- _zipClient.ExtractAllFromZip(stream, target, true);- }- }- else+ using (var stream = File.OpenRead(tempFile)){- Directory.CreateDirectory(Path.GetDirectoryName(target));- File.Copy(tempFile, target, true);+ _zipClient.ExtractAllFromZip(stream, target, true);}}catch (IOException ex)