mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Rework how package extraction works
maybe this might just fix things?
This commit is contained in:
parent
907a3c3517
commit
33aab4ff8a
@ -1218,8 +1218,8 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
App.Logger.WriteLine($"[Bootstrapper::ExtractPackage] Extracting {package.Name} to {packageFolder}...");
|
App.Logger.WriteLine($"[Bootstrapper::ExtractPackage] Extracting {package.Name} to {packageFolder}...");
|
||||||
|
|
||||||
using (ZipArchive archive = await Task.Run(() => ZipFile.OpenRead(packageLocation)))
|
using ZipArchive archive = await Task.Run(() => ZipFile.OpenRead(packageLocation));
|
||||||
{
|
|
||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
{
|
{
|
||||||
if (_cancelFired)
|
if (_cancelFired)
|
||||||
@ -1239,8 +1239,12 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
Directory.CreateDirectory(directory);
|
Directory.CreateDirectory(directory);
|
||||||
|
|
||||||
await Task.Run(() => entry.ExtractToFile(extractPath, true));
|
using var fileStream = new FileStream(extractPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, bufferSize: 0x1000, useAsync: true);
|
||||||
}
|
using var dataStream = entry.Open();
|
||||||
|
|
||||||
|
await dataStream.CopyToAsync(fileStream);
|
||||||
|
|
||||||
|
File.SetLastWriteTime(extractPath, entry.LastWriteTime.DateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
App.Logger.WriteLine($"[Bootstrapper::ExtractPackage] Finished extracting {package.Name}");
|
App.Logger.WriteLine($"[Bootstrapper::ExtractPackage] Finished extracting {package.Name}");
|
||||||
|
Loading…
Reference in New Issue
Block a user