Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wabbajack 3.3.0.0 Update #2416

Merged
merged 43 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
98c12d4
added more visible error messages to avoid user confusion
JanuarySnow Jul 19, 2023
5b8e372
restored warning removed in error, updated changelog, removed debug i…
JanuarySnow Jul 19, 2023
b6d4b5d
Update InstallerVM.cs
JanuarySnow Jul 26, 2023
940bc7b
Merge branch 'main' into blocking_fixes
JanuarySnow Jul 26, 2023
b71003d
Update InstallerVM.cs
JanuarySnow Jul 26, 2023
cc76e3c
Update MainWindowViewModel.cs
JanuarySnow Jul 26, 2023
4d688b7
added json optional flag to only show version number over modlist ima…
JanuarySnow Jul 29, 2023
ae7402b
Fix manual downloads sometimes launching in browser
UrbanCMC Aug 9, 2023
6399ef0
Fix manual downloads from secure servers
UrbanCMC Aug 9, 2023
63eaffd
Remove duplicate user agent code
UrbanCMC Aug 9, 2023
7350b63
Create configuration project and performance settings
UrbanCMC Aug 17, 2023
a77bb6c
Bind new performance settings to UI
UrbanCMC Aug 20, 2023
039e360
Use performance settings to limit maximum memory per download
UrbanCMC Aug 20, 2023
bdb60f2
Remove unused settings and related classes
UrbanCMC Aug 20, 2023
31200df
Merge branch 'blocking_fixes' into pre-release
EzioTheDeadPoet Aug 22, 2023
afce861
Merge remote-tracking branch 'origin/crit_obscure_old_request' into p…
EzioTheDeadPoet Aug 22, 2023
1d6012d
Merge remote-tracking branch 'origin/downloader-ram-limit' into pre-r…
EzioTheDeadPoet Aug 22, 2023
5f2b648
Merge remote-tracking branch 'origin/webview-download-fix' into pre-r…
EzioTheDeadPoet Aug 22, 2023
c23a7ad
Updated CHANGELOG.md
EzioTheDeadPoet Aug 22, 2023
f139038
update CHANGELOG.md
EzioTheDeadPoet Aug 22, 2023
8edbb69
moved the existing files popup to an error message , heralding the re…
JanuarySnow Aug 24, 2023
c54f223
added newline
JanuarySnow Aug 24, 2023
081a68c
reverted erroneous edit
JanuarySnow Aug 24, 2023
30adcc9
Merge remote-tracking branch 'origin/blocking_fixes' into pre-release
EzioTheDeadPoet Aug 24, 2023
c93a4af
gogID for fallout4 added
EzioTheDeadPoet Aug 27, 2023
a2820c8
Merge remote-tracking branch 'origin/fallout4GOG' into pre-release
EzioTheDeadPoet Aug 27, 2023
4384cfc
update CHANGELOG.md
EzioTheDeadPoet Aug 27, 2023
a5eb40f
update CHANGELOG.md
EzioTheDeadPoet Aug 27, 2023
21bf0a8
Fix deadlock when loading new settings
UrbanCMC Aug 28, 2023
4877fc7
Merge remote-tracking branch 'origin/downloader-ram-limit' into pre-r…
EzioTheDeadPoet Aug 28, 2023
7b5a6e7
Merge branch 'blocking_fixes' into pre-release
UrbanCMC Oct 2, 2023
70c1f3a
change folder/directory check logic
EzioTheDeadPoet Oct 2, 2023
1f79598
update CHANGELOG.md
EzioTheDeadPoet Oct 2, 2023
e9aeec7
revert unnecessary change
EzioTheDeadPoet Oct 2, 2023
aa7471a
update CHANGELOG.md
EzioTheDeadPoet Oct 2, 2023
a631ca9
Bump Wabbajack to .NET 7
tr4wzified Oct 4, 2023
a64e70d
Bump ReactiveUI packages & deps
tr4wzified Oct 4, 2023
84e55ce
Update GameFinder to 4.0.0
tr4wzified Oct 7, 2023
a7634c7
Merge branch 'main' into pre-release
EzioTheDeadPoet Oct 7, 2023
8db801a
Merge pull request #2414 from tr4wzified/pre-release
EzioTheDeadPoet Oct 12, 2023
a16f808
Merge branch 'main' into pre-release
EzioTheDeadPoet Oct 12, 2023
3b77669
Update CHANGELOG.md
EzioTheDeadPoet Oct 12, 2023
03be13b
Update CHANGELOG.md
EzioTheDeadPoet Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
### Changelog

#### Version - 3.3.0.0 - TBA
* 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
* Should fix random crashes on some systems
* Updated GameFinder to 4.0.0

#### Version - 3.2.0.1 - 7/23/2023
* Code cleanup: re-added some network and diagnostic code missing since 2.5

#### Version - 3.2.0.0 - 7/16/2023
* Fixed issues related to high RAM usage
* The resumable downloads now reserve drive space to write to in advance instead of being managed in system RAM
* remove LoversLab from the "Logins" Setting because it is deprecated for ages now and only causes confusion,
just for the unlikely probability that LL will fix their proper API.
* Added safety to install path selection, to ensure that no files are deleted that are not intended to be.
* Fixed allowing back button during install which can result in multiple install processes
* fixed search filter not applying when pressing back button and reaccessing gallery
* Added more robust checking for protected location paths and subfolders for the launcher exe and install and download paths
* Fixed readme double opening when modlist details are prepoulated
* Added a check if Downloadpath is alongside Wabbajack.exe location, to match the install path check that already exists
* Added check for identical download and install paths
* Fixed No Delete and NoDelete being handled by stripping whitespace before the regex, to idiotproof things a bit
* Fixed issues related to high RAM usage
* The resumable downloads now reserve drive space to write to in advance instead of being managed in system RAM
* remove LoversLab from the "Logins" Setting because it is deprecated for ages now and only causes confusion,
just for the unlikely probability that LL will fix their proper API.
* Added safety to install path selection, to ensure that no files are deleted that are not intended to be.
* Fixed allowing back button during install which can result in multiple install processes
* fixed search filter not applying when pressing back button and reaccessing gallery
* Added more robust checking for protected location paths and subfolders for the launcher exe and install and download paths
* Fixed readme double opening when modlist details are prepoulated
* Added a check if Downloadpath is alongside Wabbajack.exe location, to match the install path check that already exists
* Added check for identical download and install paths
* Fixed No Delete and NoDelete being handled by stripping whitespace before the regex, to idiotproof things a bit

#### Version - 3.1.0.0 - 5/7/2023
* Fixed Readme opening twice
Expand Down
4 changes: 1 addition & 3 deletions Wabbajack.App.Wpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Reactive.Disposables;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -166,7 +165,6 @@ private static IServiceCollection ConfigureServices(IServiceCollection services)
services.AddSingleton<LauncherUpdater>();
services.AddSingleton<ResourceMonitor>();

services.AddSingleton<MainSettings>();
services.AddTransient<CompilerVM>();
services.AddTransient<InstallerVM>();
services.AddTransient<ModeSelectionVM>();
Expand All @@ -182,7 +180,7 @@ private static IServiceCollection ConfigureServices(IServiceCollection services)
services.AddTransient<LoversLabLoginHandler>();

// Login Managers

//Disabled LL because it is currently not used and broken due to the way LL butchers their API
//services.AddAllSingleton<INeedsLogin, LoversLabLoginManager>();
services.AddAllSingleton<INeedsLogin, NexusLoginManager>();
Expand Down
19 changes: 10 additions & 9 deletions Wabbajack.App.Wpf/LauncherUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.VisualBasic.CompilerServices;
using Newtonsoft.Json;
using Wabbajack.Common;
using Wabbajack.Downloaders;
using Wabbajack.DTOs;
using Wabbajack.DTOs.DownloadStates;
Expand All @@ -27,9 +28,9 @@ public class LauncherUpdater
private readonly HttpClient _client;
private readonly Client _wjclient;
private readonly DTOSerializer _dtos;

private readonly DownloadDispatcher _downloader;

private static Uri GITHUB_REPO_RELEASES = new("https://api.github.com/repos/wabbajack-tools/wabbajack/releases");

public LauncherUpdater(ILogger<LauncherUpdater> logger, HttpClient client, Client wjclient, DTOSerializer dtos,
Expand All @@ -41,8 +42,8 @@ public LauncherUpdater(ILogger<LauncherUpdater> logger, HttpClient client, Clien
_dtos = dtos;
_downloader = downloader;
}


public static Lazy<AbsolutePath> CommonFolder = new (() =>
{
var entryPoint = KnownFolders.EntryPoint;
Expand Down Expand Up @@ -105,7 +106,7 @@ public async Task Run()

var launcherFolder = KnownFolders.EntryPoint.Parent;
var exePath = launcherFolder.Combine("Wabbajack.exe");

var launcherVersion = FileVersionInfo.GetVersionInfo(exePath.ToString());

if (release != default && release.version > Version.Parse(launcherVersion.FileVersion!))
Expand All @@ -119,7 +120,7 @@ await _downloader.Download(new Archive
Name = release.asset.Name,
Size = release.asset.Size
}, tempPath, CancellationToken.None);

if (tempPath.Size() != release.asset.Size)
{
_logger.LogInformation(
Expand All @@ -130,12 +131,12 @@ await _downloader.Download(new Archive
if (exePath.FileExists())
exePath.Delete();
await tempPath.MoveToAsync(exePath, true, CancellationToken.None);

_logger.LogInformation("Finished updating wabbajack");
await _wjclient.SendMetric("updated_launcher", $"{launcherVersion.FileVersion} -> {release.version}");
}
}

private async Task<Release[]> GetReleases()
{
_logger.LogInformation("Getting new Wabbajack version list");
Expand All @@ -146,7 +147,7 @@ private async Task<Release[]> GetReleases()
private HttpRequestMessage MakeMessage(Uri uri)
{
var msg = new HttpRequestMessage(HttpMethod.Get, uri);
msg.UseChromeUserAgent();
msg.AddChromeAgent();
return msg;
}

Expand Down
183 changes: 23 additions & 160 deletions Wabbajack.App.Wpf/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,84 +1,11 @@
using System;
using System.Collections.Generic;
using System.Reactive;
using System.Reactive.Subjects;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Wabbajack.Compiler;
using Wabbajack.Downloaders;
using Wabbajack.DTOs.JsonConverters;
using Wabbajack;
using Wabbajack.Paths;
using Consts = Wabbajack.Consts;
using Wabbajack.RateLimiter;
using Wabbajack.Util;

namespace Wabbajack
{
[JsonName("MainSettings")]
[JsonObject(MemberSerialization.OptOut)]
public class MainSettings
{
public byte Version { get; set; } = Consts.SettingsVersion;
public double PosX { get; set; }
public double PosY { get; set; }
public double Height { get; set; }
public double Width { get; set; }
public InstallerSettings Installer { get; set; } = new();
public FiltersSettings Filters { get; set; } = new();
public CompilerSettings Compiler { get; set; } = new();
public PerformanceSettings Performance { get; set; } = new();

private Subject<Unit> _saveSignal = new();
[JsonIgnore]
public IObservable<Unit> SaveSignal => _saveSignal;

public static async ValueTask<(MainSettings settings, bool loaded)> TryLoadTypicalSettings()
{
/*
if (!Consts.SettingsFile.Exists)
{
return default;
}

// Version check
try
{
var settings = Consts.SettingsFile.FromJson<MainSettings>();
if (settings.Version == Consts.SettingsVersion)
return (settings, true);
}
catch (Exception ex)
{
Utils.Error(ex, "Error loading settings");
}

var backup = Consts.SettingsFile.AppendToName("-backup");
await backup.DeleteAsync();

await Consts.SettingsFile.CopyToAsync(backup);
await Consts.SettingsFile.DeleteAsync();
*/
return default;
}

public static async ValueTask SaveSettings(MainSettings settings)
{
settings._saveSignal.OnNext(Unit.Default);

// Might add this if people are putting save work on other threads or other
// things that delay the operation.
//settings._saveSignal.OnCompleted();
//await settings._saveSignal;

//await settings.ToJsonAsync(Consts.SettingsFile);
}
}

[JsonName("InstallerSettings")]
public class InstallerSettings
{
public AbsolutePath LastInstalledListLocation { get; set; }
public Dictionary<AbsolutePath, Mo2ModlistInstallationSettings> Mo2ModlistSettings { get; } = new Dictionary<AbsolutePath, Mo2ModlistInstallationSettings>();
}

[JsonName("Mo2ModListInstallerSettings")]
public class Mo2ModlistInstallationSettings
{
Expand All @@ -87,105 +14,41 @@ public class Mo2ModlistInstallationSettings
public bool AutomaticallyOverrideExistingInstall { get; set; }
}

[JsonName("FiltersSettings")]
[JsonObject(MemberSerialization.OptOut)]
public class FiltersSettings : ViewModel
{
public bool ShowNSFW { get; set; }
public bool OnlyInstalled { get; set; }
public string Game { get; set; }
public string Search { get; set; }
private bool _isPersistent = true;
public bool IsPersistent { get => _isPersistent; set => RaiseAndSetIfChanged(ref _isPersistent, value); }

private bool _useCompression = false;
public bool UseCompression { get => _useCompression; set => RaiseAndSetIfChanged(ref _useCompression, value); }
public bool ShowUtilityLists { get; set; }
}

[JsonName("PerformanceSettings")]
[JsonObject(MemberSerialization.OptOut)]
public class PerformanceSettings : ViewModel
{
public PerformanceSettings()
{
_reduceHDDThreads = true;
_favorPerfOverRam = false;
_diskThreads = Environment.ProcessorCount;
_downloadThreads = Environment.ProcessorCount <= 8 ? Environment.ProcessorCount : 8;
}
private readonly Configuration.MainSettings _settings;
private readonly int _defaultMaximumMemoryPerDownloadThreadMb;

private int _downloadThreads;
public int DownloadThreads { get => _downloadThreads; set => RaiseAndSetIfChanged(ref _downloadThreads, value); }

private int _diskThreads;
public int DiskThreads { get => _diskThreads; set => RaiseAndSetIfChanged(ref _diskThreads, value); }
public PerformanceSettings(Configuration.MainSettings settings, IResource<DownloadDispatcher> downloadResources, SystemParametersConstructor systemParams)
{
var p = systemParams.Create();

private bool _reduceHDDThreads;
public bool ReduceHDDThreads { get => _reduceHDDThreads; set => RaiseAndSetIfChanged(ref _reduceHDDThreads, value); }
_settings = settings;
// Split half of available memory among download threads
_defaultMaximumMemoryPerDownloadThreadMb = (int)(p.SystemMemorySize / downloadResources.MaxTasks / 1024 / 1024) / 2;
_maximumMemoryPerDownloadThreadMb = settings.PerformanceSettings.MaximumMemoryPerDownloadThreadMb;

private bool _favorPerfOverRam;
public bool FavorPerfOverRam { get => _favorPerfOverRam; set => RaiseAndSetIfChanged(ref _favorPerfOverRam, value); }

private bool _networkWorkaroundMode;
public bool NetworkWorkaroundMode
{
get => _networkWorkaroundMode;
set
if (MaximumMemoryPerDownloadThreadMb < 0)
{
Consts.UseNetworkWorkaroundMode = value;
RaiseAndSetIfChanged(ref _networkWorkaroundMode, value);
ResetMaximumMemoryPerDownloadThreadMb();
}
}


private bool _disableTextureResizing;
public bool DisableTextureResizing
private int _maximumMemoryPerDownloadThreadMb;

public int MaximumMemoryPerDownloadThreadMb
{
get => _disableTextureResizing;
get => _maximumMemoryPerDownloadThreadMb;
set
{
RaiseAndSetIfChanged(ref _disableTextureResizing, value);
RaiseAndSetIfChanged(ref _maximumMemoryPerDownloadThreadMb, value);
_settings.PerformanceSettings.MaximumMemoryPerDownloadThreadMb = value;
}
}



/*
public void SetProcessorSettings(ABatchProcessor processor)
public void ResetMaximumMemoryPerDownloadThreadMb()
{
processor.DownloadThreads = DownloadThreads;
processor.DiskThreads = DiskThreads;
processor.ReduceHDDThreads = ReduceHDDThreads;
processor.FavorPerfOverRam = FavorPerfOverRam;

if (processor is MO2Compiler mo2c)
mo2c.DisableTextureResizing = DisableTextureResizing;
}*/
}

[JsonName("CompilationModlistSettings")]
public class CompilationModlistSettings
{
public string ModListName { get; set; }
public string Version { get; set; }
public string Author { get; set; }
public string Description { get; set; }
public string Website { get; set; }
public string Readme { get; set; }
public bool IsNSFW { get; set; }

public string MachineUrl { get; set; }
public AbsolutePath SplashScreen { get; set; }
public bool Publish { get; set; }
}

[JsonName("MO2CompilationSettings")]
public class MO2CompilationSettings
{
public AbsolutePath DownloadLocation { get; set; }
public AbsolutePath LastCompiledProfileLocation { get; set; }
public Dictionary<AbsolutePath, CompilationModlistSettings> ModlistSettings { get; } = new Dictionary<AbsolutePath, CompilationModlistSettings>();
MaximumMemoryPerDownloadThreadMb = _defaultMaximumMemoryPerDownloadThreadMb;
}
}

}
15 changes: 6 additions & 9 deletions Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Security.Policy;
using System.Threading;
using System.Threading.Tasks;
using Wabbajack.DTOs;
using Wabbajack.DTOs.DownloadStates;
using Wabbajack.DTOs.Interventions;
using Wabbajack.Paths;

namespace Wabbajack.UserIntervention;

Expand All @@ -17,18 +14,18 @@ protected override async Task Run(CancellationToken token)
//await WaitForReady();
var archive = Intervention.Archive;
var md = Intervention.Archive.State as Manual;

HeaderText = $"Manual download ({md.Url.Host})";

Instructions = string.IsNullOrWhiteSpace(md.Prompt) ? $"Please download {archive.Name}" : md.Prompt;
await NavigateTo(md.Url);

Instructions = string.IsNullOrWhiteSpace(md.Prompt) ? $"Please download {archive.Name}" : md.Prompt;

var uri = await WaitForDownloadUri(token, async () =>
var task = WaitForDownloadUri(token, async () =>
{
await RunJavaScript("Array.from(document.getElementsByTagName(\"iframe\")).forEach(f => f.remove())");
});

await NavigateTo(md.Url);
var uri = await task;

Intervention.Finish(uri);
}
}
Loading
Loading