mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
more logging bleh
This commit is contained in:
parent
599683f4e3
commit
3d1f2e42a5
@ -1396,7 +1396,7 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
private async Task ExtractPackage(Package package)
|
private async Task ExtractPackage(Package package)
|
||||||
{
|
{
|
||||||
const string LOG_IDENT = "Bootstrapper::ExtractPackage";
|
string LOG_IDENT = $"Bootstrapper::ExtractPackage.{package.Name}";
|
||||||
|
|
||||||
if (_cancelFired)
|
if (_cancelFired)
|
||||||
return;
|
return;
|
||||||
@ -1404,12 +1404,10 @@ namespace Bloxstrap
|
|||||||
string packageLocation = Path.Combine(Paths.Downloads, package.Signature);
|
string packageLocation = Path.Combine(Paths.Downloads, package.Signature);
|
||||||
string packageFolder = Path.Combine(_versionFolder, PackageDirectories[package.Name]);
|
string packageFolder = Path.Combine(_versionFolder, PackageDirectories[package.Name]);
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Reading {package.Name}...");
|
App.Logger.WriteLine(LOG_IDENT, $"Extracting to '{packageFolder}'...");
|
||||||
|
|
||||||
var archive = await Task.Run(() => ZipFile.OpenRead(packageLocation));
|
var archive = await Task.Run(() => ZipFile.OpenRead(packageLocation));
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Read {package.Name}. Extracting to {packageFolder}...");
|
|
||||||
|
|
||||||
// yeah so because roblox is roblox, these packages aren't actually valid zip files
|
// yeah so because roblox is roblox, these packages aren't actually valid zip files
|
||||||
// besides the fact that they use backslashes instead of forward slashes for directories,
|
// besides the fact that they use backslashes instead of forward slashes for directories,
|
||||||
// empty folders that *BEGIN* with a backslash in their fullname, but have an empty name are listed here for some reason...
|
// empty folders that *BEGIN* with a backslash in their fullname, but have an empty name are listed here for some reason...
|
||||||
@ -1425,10 +1423,17 @@ namespace Bloxstrap
|
|||||||
string extractPath = Path.Combine(packageFolder, entry.FullName);
|
string extractPath = Path.Combine(packageFolder, entry.FullName);
|
||||||
string? directory = Path.GetDirectoryName(extractPath);
|
string? directory = Path.GetDirectoryName(extractPath);
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Attempting to extract {extractPath}...");
|
try
|
||||||
|
{
|
||||||
if (directory is not null)
|
if (directory is not null)
|
||||||
Directory.CreateDirectory(directory);
|
Directory.CreateDirectory(directory);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, $"Failed to create a directory for '{directory}'");
|
||||||
|
App.Logger.WriteException(LOG_IDENT, ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
var fileManifest = _versionFileManifest.FirstOrDefault(x => x.Name == Path.Combine(PackageDirectories[package.Name], entry.FullName));
|
var fileManifest = _versionFileManifest.FirstOrDefault(x => x.Name == Path.Combine(PackageDirectories[package.Name], entry.FullName));
|
||||||
string? signature = fileManifest?.Signature;
|
string? signature = fileManifest?.Signature;
|
||||||
@ -1452,7 +1457,7 @@ namespace Bloxstrap
|
|||||||
if (signature is not null && MD5Hash.FromStream(fileStream) != signature)
|
if (signature is not null && MD5Hash.FromStream(fileStream) != signature)
|
||||||
{
|
{
|
||||||
if (retry)
|
if (retry)
|
||||||
throw new AssertionException($"Checksum of {entry.FullName} post-extraction did not match manifest");
|
throw new AssertionException($"Checksum of '{entry.FullName}' post-extraction did not match manifest");
|
||||||
|
|
||||||
retry = true;
|
retry = true;
|
||||||
}
|
}
|
||||||
@ -1462,7 +1467,7 @@ namespace Bloxstrap
|
|||||||
File.SetLastWriteTime(extractPath, entry.LastWriteTime.DateTime);
|
File.SetLastWriteTime(extractPath, entry.LastWriteTime.DateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Finished extracting {package.Name}");
|
App.Logger.WriteLine(LOG_IDENT, $"Finished extracting!");
|
||||||
|
|
||||||
_packagesExtracted += 1;
|
_packagesExtracted += 1;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
{
|
{
|
||||||
string timestamp = DateTime.UtcNow.ToString("s") + "Z";
|
string timestamp = DateTime.UtcNow.ToString("s") + "Z";
|
||||||
string outcon = $"{timestamp} {message}";
|
string outcon = $"{timestamp} {message}";
|
||||||
string outlog = outcon.Replace(Paths.UserProfile, "%UserProfile%");
|
string outlog = outcon;//.Replace(Paths.UserProfile, "%UserProfile%");
|
||||||
|
|
||||||
Debug.WriteLine(outcon);
|
Debug.WriteLine(outcon);
|
||||||
WriteToLog(outlog);
|
WriteToLog(outlog);
|
||||||
|
Loading…
Reference in New Issue
Block a user