Merge pull request #670 from sbwalker/master
fix regression bug caused by #649 related to installing nupkg packages
This commit is contained in:
commit
35f186b532
@ -126,24 +126,14 @@ namespace Oqtane.Infrastructure
|
|||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||||
}
|
}
|
||||||
if (!FileInUse(filename) == false)
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
entry.ExtractToFile(filename, true);
|
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
|
catch
|
||||||
{
|
{
|
||||||
return true;
|
// an error occurred extracting the file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user