Skip to content

Commit

Permalink
Changes for an official Version 3.3.1.0 Release (#2439)
Browse files Browse the repository at this point in the history
* added more visible error messages to avoid user confusion

added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link

extended the error text for starting wabbajack in protected location

removed debug code

shortened error message to fit in text box

* restored warning removed in error, updated changelog, removed debug includes

* Update InstallerVM.cs

* Update InstallerVM.cs

* Update MainWindowViewModel.cs

* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title

removed debug code

change to pascal case and match existing code style

update changelog

* Fix manual downloads sometimes launching in browser

* Fix manual downloads from secure servers

* Remove duplicate user agent code

* Create configuration project and performance settings

* Bind new performance settings to UI

* Use performance settings to limit maximum memory per download

* Remove unused settings and related classes

* Updated CHANGELOG.md

* update CHANGELOG.md

* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox

* added newline

* reverted erroneous edit

* gogID for fallout4 added

* update CHANGELOG.md

* Fix deadlock when loading new settings

* change folder/directory check logic

* update CHANGELOG.md

* revert unnecessary change

* update CHANGELOG.md

* Bump Wabbajack to .NET 7

* Bump ReactiveUI packages & deps

* Update GameFinder to 4.0.0

* Update CHANGELOG.md

* Update CHANGELOG.md

* Don't try to add cookies if array is empty

* Start download from scratch if .download_package can't be parsed

* Log when application is shutting down

* update CHANGELOG.md

* exclude the "SP Consent Message" on nexus from the cleared iframes

* Actually use the --outputPath compile option if the user provides one

It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath

* update Wabbajack.Compression.BSA dependencies

* improve log message to include storage space reference

* clearing temp folder when the app closes

* update logging message

* update CHANGELOG.md

* update CHANGELOG.md

* update logging for possible exceptions thrown when clearing temp folder

* fix cloudflare captcha

---------

Co-authored-by: JanuarySnow <[email protected]>
Co-authored-by: JanuarySnow <[email protected]>
Co-authored-by: UrbanCMC <[email protected]>
Co-authored-by: trawzified <[email protected]>
Co-authored-by: Marco Antonio Jaguaribe Costa <[email protected]>
Co-authored-by: Timothy Baldridge <[email protected]>
  • Loading branch information
7 people authored Nov 15, 2023
1 parent b8cc418 commit 0c11f11
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 8 deletions.
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override async Task Run(CancellationToken token)

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;
Expand Down
27 changes: 27 additions & 0 deletions Wabbajack.App.Wpf/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,7 +46,33 @@ public MainWindow(ILogger<MainWindow> logger, SystemParametersConstructor system

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();
};

Expand Down
7 changes: 7 additions & 0 deletions Wabbajack.CLI/Verbs/Compile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Wabbajack.DTOs.JsonConverters;
using Wabbajack.Networking.WabbajackClientApi;
using Wabbajack.Paths;
using Wabbajack.Paths.IO;
using Wabbajack.VFS;

namespace Wabbajack.CLI.Verbs;
Expand Down Expand Up @@ -58,6 +59,12 @@ public async Task<int> Run(AbsolutePath installPath, AbsolutePath outputPath,

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)
Expand Down
6 changes: 5 additions & 1 deletion Wabbajack.Common/HttpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.6" />
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.7-beta" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
</ItemGroup>

Expand Down
13 changes: 11 additions & 2 deletions Wabbajack.Networking.Http/ResumableDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,17 @@ private void DeletePackage()
return null;
}

var packageJson = _packagePath.ReadAllText();
return JsonSerializer.Deserialize<DownloadPackage>(packageJson);
try
{
var packageJson = _packagePath.ReadAllText();
return JsonSerializer.Deserialize<DownloadPackage>(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)
Expand Down
4 changes: 3 additions & 1 deletion Wabbajack.VFS/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ public static async Task<VirtualFile> Analyze(Context context, VirtualFile? pare
}
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;
}

Expand Down

0 comments on commit 0c11f11

Please sign in to comment.