From 5cf35fd70ac8b38844160610da78305e79d1aba9 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Thu, 6 Aug 2020 16:10:19 -0400 Subject: [PATCH] fix regression bug caused by #649 related to installing nupkg packages --- .../Infrastructure/InstallationManager.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/Oqtane.Server/Infrastructure/InstallationManager.cs b/Oqtane.Server/Infrastructure/InstallationManager.cs index cbe3685f..29ad1a3f 100644 --- a/Oqtane.Server/Infrastructure/InstallationManager.cs +++ b/Oqtane.Server/Infrastructure/InstallationManager.cs @@ -126,24 +126,14 @@ namespace Oqtane.Infrastructure { Directory.CreateDirectory(Path.GetDirectoryName(filename)); } - if (!FileInUse(filename) == false) + + try { entry.ExtractToFile(filename, true); } - } - private static bool FileInUse(string path) - { - try - { - using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate)) - { - var flag = fs.CanWrite; - } - return false; - } catch { - return true; + // an error occurred extracting the file } }