fix regression bug caused by #649 related to installing nupkg packages

This commit is contained in:
Shaun Walker
2020-08-06 16:10:19 -04:00
parent 1750f28a9f
commit 5cf35fd70a

View File

@ -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
}
}