aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorClaus Vium <clausvium@gmail.com>2019-02-11 18:52:09 +0100
committerClaus Vium <clausvium@gmail.com>2019-02-11 18:52:09 +0100
commitda169dddb5b19e09833f3874d78a0305ed89cef1 (patch)
treede500d166c618e97f58236f4460490dddc60c120 /Emby.Server.Implementations
parent8fd9f5b6a47ad7cce3d462a786cf6c4b215d22e1 (diff)
Remove DLL support and require all packages/plugins to be zip archives
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs27
1 files changed, 8 insertions, 19 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 127b9c62a..f03a594cd 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -529,20 +529,17 @@ namespace Emby.Server.Implementations.Updates
private async Task PerformPackageInstallation(IProgress<double> progress, string target, PackageVersionInfo package, CancellationToken cancellationToken)
{
- // Target based on if it is an archive or single assembly
var 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 target
try
{
- 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)