diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fb7d354..623fa999 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,28 @@ ### Changelog -#### Version - 3.3.0.0 - 10/13/2023 +#### Version - 3.3.1.0 - TBA +* Fixed `--outputPath` not being used for the CLI `compile` (thanks to @majcosta for fixing that) +* Improved Log message for cases where low storage on the drive Wabbajack is installed on causes compiles to fail + * **To list authors still compiling on Wabbajack 3.0.5.0:** + This is what is causing your compiles with any newer Wabbajack version to fail. + The reason the compile works is that you already have a full cache for all your mods and BSAs with that version and WJ only needs to add a small amount of new files to that cache and needs less temporary drive space because of that. Any version higher than 3.0.5.0 needs a new cache that can't be converted and needs WJ to unpack every Archive (zip/rar/7z/BSA/BA2) and add the files inside to the new cache. + Finding ways to reduce the storage footprint when compiling huge lists for the first time (since any following compiles won't need that space requirement anymore) will be investigated. +* Wabbajack will now clean the `temp` folder when closed +* Updated Dependencies + * LZ4 to version 1.3.7-beta + * SharpZipLib to version 1.4.2 + +#### Version - 3.3.0.1 - (Was only a Pre-Release) +* Fixed Manual Downloading on NexusMods being blocked by a hidden cookie consent banner + +#### Version - 3.3.0.0 - 10/13/2023 (taken down due to build issues) * Fixed some UI issues arising from 3.2.0.0 changes - more informative error text, wiki link button * Added optional JSON flag for `DisplayVersionOnlyInInstallerView` to enable the installer image to only show version number. * Fixed manual downloader downloading in the OS's "Downloads" folder * Added RAM Limit setting for downloads * This fixes the High RAM usage (and sometimes app crashes) on some Hardware + Very High Speed Internet Connection Systems * Added Fallout 4 (GOG) to the index -* Updated App to .NET 7.0 +* Updated App to .NET 8.0 * Should fix random crashes on some systems * Updated GameFinder to 4.0.0 diff --git a/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs b/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs index 003099bf..8ed363ce 100644 --- a/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs +++ b/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs @@ -21,7 +21,7 @@ public class ManualDownloadHandler : BrowserWindowViewModel var task = WaitForDownloadUri(token, async () => { - await RunJavaScript("Array.from(document.getElementsByTagName(\"iframe\")).forEach(f => f.remove())"); + await RunJavaScript("Array.from(document.getElementsByTagName(\"iframe\")).forEach(f => {if (f.title != \"SP Consent Message\" && !f.src.includes(\"challenges.cloudflare.com\")) f.remove()})"); }); await NavigateTo(md.Url); var uri = await task; diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs index 8f7aba3c..6f324726 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs @@ -1,6 +1,7 @@ using System; using System.Collections.ObjectModel; using System.ComponentModel; +using System.IO; using System.Reactive.Linq; using System.Windows; using System.Windows.Input; @@ -45,7 +46,33 @@ namespace Wabbajack Closed += (s, e) => { + _logger.LogInformation("Beginning shutdown..."); _mwvm.CancelRunningTasks(TimeSpan.FromSeconds(10)); + + // Cleaning the temp folder when the app closes since it can take up multiple Gigabytes of Storage + var tempDirectory = Environment.CurrentDirectory + "\\temp"; + _logger.LogInformation("Clearing {TempDir}",tempDirectory); + try + { + var directoryInfo = new DirectoryInfo(tempDirectory); + + foreach (var file in directoryInfo.EnumerateFiles()) + { + file.Delete(); + } + foreach (var dir in directoryInfo.EnumerateDirectories()) + { + dir.Delete(true); + } + + _logger.LogInformation("Finished clearing {TempDir}",tempDirectory); + } + catch (Exception ex) + { + _logger.LogError(ex,"Failed clearing {TempDir}",tempDirectory); + } + + Application.Current.Shutdown(); }; diff --git a/Wabbajack.CLI/Verbs/Compile.cs b/Wabbajack.CLI/Verbs/Compile.cs index 692a8e0b..969a5d7e 100644 --- a/Wabbajack.CLI/Verbs/Compile.cs +++ b/Wabbajack.CLI/Verbs/Compile.cs @@ -11,6 +11,7 @@ using Wabbajack.Downloaders.GameFile; using Wabbajack.DTOs.JsonConverters; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Paths; +using Wabbajack.Paths.IO; using Wabbajack.VFS; namespace Wabbajack.CLI.Verbs; @@ -58,6 +59,12 @@ public class Compile inferredSettings.UseGamePaths = true; + if(outputPath.DirectoryExists()) + { + inferredSettings.OutputFile = outputPath.Combine(inferredSettings.OutputFile.FileName); + _logger.LogInformation("Output file will be in: {outputPath}", inferredSettings.OutputFile); + } + var compiler = MO2Compiler.Create(_serviceProvider, inferredSettings); var result = await compiler.Begin(token); if (!result) diff --git a/Wabbajack.Common/HttpExtensions.cs b/Wabbajack.Common/HttpExtensions.cs index b2ca8d39..dee1b3d0 100644 --- a/Wabbajack.Common/HttpExtensions.cs +++ b/Wabbajack.Common/HttpExtensions.cs @@ -18,7 +18,11 @@ public static class HttpExtensions "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"; public static HttpRequestMessage AddCookies(this HttpRequestMessage msg, Cookie[] cookies) { - msg.Headers.Add("Cookie", string.Join(";", cookies.Select(c => $"{c.Name}={c.Value}"))); + if (cookies.Length > 0) + { + msg.Headers.Add("Cookie", string.Join(";", cookies.Select(c => $"{c.Name}={c.Value}"))); + } + return msg; } diff --git a/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj b/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj index 1a73e9c7..14f1cf60 100644 --- a/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj +++ b/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj @@ -18,7 +18,7 @@ - + diff --git a/Wabbajack.Networking.Http/ResumableDownloader.cs b/Wabbajack.Networking.Http/ResumableDownloader.cs index 025715e4..078de77d 100644 --- a/Wabbajack.Networking.Http/ResumableDownloader.cs +++ b/Wabbajack.Networking.Http/ResumableDownloader.cs @@ -166,8 +166,17 @@ internal class ResumableDownloader return null; } - var packageJson = _packagePath.ReadAllText(); - return JsonSerializer.Deserialize(packageJson); + try + { + var packageJson = _packagePath.ReadAllText(); + return JsonSerializer.Deserialize(packageJson); + } + catch (JsonException ex) + { + _logger.LogWarning(ex, "Package for '{name}' couldn't be parsed. Deleting package and starting from scratch...", _outputPath.FileName.ToString()); + DeletePackage(); + return null; + } } private void SavePackage(DownloadPackage package) diff --git a/Wabbajack.VFS/VirtualFile.cs b/Wabbajack.VFS/VirtualFile.cs index ea2324c8..9bb33bd6 100644 --- a/Wabbajack.VFS/VirtualFile.cs +++ b/Wabbajack.VFS/VirtualFile.cs @@ -243,7 +243,9 @@ public class VirtualFile } catch (Exception ex) { - context.Logger.LogError(ex, "Error while examining the contents of {path}", relPath.FileName); + context.Logger.LogError(ex, "Error while examining the contents of {Path}", relPath.FileName); + if (!ex.Message.Equals("End of stream before end of limit")) throw; + context.Logger.LogError("Not enough free storage space in {TempFolder}",Environment.CurrentDirectory+"\\temp"); throw; }