Skip to content

Commit 8234ac4

Browse files
committed
4.0.0.1
2 parents de00175 + 0017905 commit 8234ac4

File tree

11 files changed

+599
-22
lines changed

11 files changed

+599
-22
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
### Changelog
22

3+
#### Version - 4.0.0.1 - 3/18/2025
4+
* Fixed an issue where manual downloads would get stuck after only a few browser pop-ups
5+
* Fixed the new Wabbajack reset working not working in some cases
6+
* The MEGA login timeout has been increased to 30 seconds from 10 seconds to hopefully help with login errors.
7+
* GPU detection logic has been adjusted to account for virtual video controllers and video controllers without a reported refresh rate (thanks to [@kaeltis](https://www.github.com/kaeltis))
8+
39
#### Version - 4.0.0.0 - 3/17/2025
410
* The entire UI has been overhauled to hopefully better guide users during installation/compilation and such.
511
* Major thanks to [@CritLoren](https://www.github.com/CritLoren) for coming up with a lot of ideas behind the redesign and creating [Figma mock-ups](https://www.figma.com/design/SylohOBwdYAtPbOj5VMQ25/Wabbajack-v4).

Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ protected override async Task Run(CancellationToken token)
3030
});
3131
await NavigateTo(md.Url);
3232
uri = await task;
33-
3433
}
3534
finally
3635
{

Wabbajack.App.Wpf/Util/SystemParametersConstructor.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,27 @@ public SystemParameters Create()
124124

125125
private string GetGPUName()
126126
{
127+
HashSet<string> gpuManufacturers = ["amd", "intel", "nvidia"];
127128
string gpuName = "";
129+
uint gpuRefreshRate = 0;
130+
128131
try
129132
{
130133
ManagementObjectSearcher videoControllers = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController");
131-
132-
uint gpuRefreshRate = 0;
133-
134+
134135
foreach (ManagementObject obj in videoControllers.Get())
135136
{
136-
var currentRefreshRate = (uint)obj["CurrentRefreshRate"];
137-
if (currentRefreshRate > gpuRefreshRate)
138-
gpuName = obj["Description"].ToString();
137+
if (obj["CurrentRefreshRate"] != null && obj["Description"] != null)
138+
{
139+
var currentRefreshRate = (uint)obj["CurrentRefreshRate"];
140+
var currentName = obj["Description"].ToString();
141+
142+
if (gpuManufacturers.Any(s => currentName.Contains(s, StringComparison.OrdinalIgnoreCase)) && currentRefreshRate > gpuRefreshRate)
143+
{
144+
gpuName = currentName;
145+
gpuRefreshRate = currentRefreshRate;
146+
}
147+
}
139148
}
140149
}
141150
catch(Exception ex)

Wabbajack.App.Wpf/ViewModels/BrowserWindowViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using System;
22
using System.Linq;
3-
using System.Reactive.Disposables;
43
using System.Text.Json;
54
using System.Threading;
65
using System.Threading.Tasks;
76
using System.Windows.Input;
8-
using System.Windows.Threading;
97
using HtmlAgilityPack;
108
using Microsoft.Extensions.DependencyInjection;
119
using Microsoft.Web.WebView2.Core;
@@ -17,7 +15,6 @@
1715
using Wabbajack.Hashing.xxHash64;
1816
using Wabbajack.Messages;
1917
using Wabbajack.Paths;
20-
using System.Reactive.Concurrency;
2118
using Microsoft.Extensions.Logging;
2219

2320
namespace Wabbajack;

Wabbajack.App.Wpf/ViewModels/Interventions/MegaLoginVM.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ public MegaLoginVM(ILogger<MegaLoginVM> logger, MegaTokenProvider tokenProvider,
5757
{
5858
TriedLoggingIn = true;
5959
LoggingIn = true;
60-
// Since the login task can gets stuck on a failed login, cancel the login task if it hasn't returned after 10s
60+
// Since the login task can gets stuck on a failed login, cancel the login task if it hasn't returned after 10s
6161
using var tokenSource = new CancellationTokenSource();
62-
tokenSource.Token.ThrowIfCancellationRequested();
63-
tokenSource.CancelAfter(10000);
62+
tokenSource.CancelAfter(TimeSpan.FromSeconds(30));
6463
Task<(AuthInfos Auth, LogonSessionToken Login)> loginTask = DoLogin(tokenSource.Token);
6564
try
6665
{
@@ -74,6 +73,9 @@ public MegaLoginVM(ILogger<MegaLoginVM> logger, MegaTokenProvider tokenProvider,
7473
}
7574
catch (Exception ex)
7675
{
76+
if (ex is OperationCanceledException)
77+
_logger.LogError("Request timed out, MEGA login cancelled!");
78+
7779
_logger.LogError("Failed to log into MEGA: {ex}", ex.ToString());
7880
LoginSuccessful = false;
7981
}

Wabbajack.App.Wpf/ViewModels/MainWindowVM.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace Wabbajack;
3838
/// </summary>
3939
public class MainWindowVM : ViewModel
4040
{
41-
private object _browserLocker = new object();
41+
private Common.AsyncLock _browserLocker = new();
4242
public MainWindow MainWindow { get; }
4343

4444
[Reactive]
@@ -66,11 +66,11 @@ public class MainWindowVM : ViewModel
6666
public readonly FileUploadVM FileUploadVM;
6767
public readonly MegaLoginVM MegaLoginVM;
6868
public readonly UserInterventionHandlers UserInterventionHandlers;
69+
6970
private readonly Client _wjClient;
7071
private readonly ILogger<MainWindowVM> _logger;
7172
private readonly ResourceMonitor _resourceMonitor;
7273
private readonly SystemParametersConstructor _systemParams;
73-
7474
private readonly IServiceProvider _serviceProvider;
7575

7676
public ICommand CopyVersionCommand { get; }
@@ -332,6 +332,7 @@ private void HandleManualBlobDownload(ManualBlobDownload manualDownload)
332332

333333
private async void HandleShowBrowserWindow(ShowBrowserWindow msg)
334334
{
335+
using var _ = await _browserLocker.WaitAsync();
335336
var browserWindow = _serviceProvider.GetRequiredService<BrowserWindow>();
336337
ActiveFloatingPane = browserWindow.ViewModel = msg.ViewModel;
337338
browserWindow.DataContext = ActiveFloatingPane;

Wabbajack.App.Wpf/ViewModels/Settings/SettingsVM.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ private void Reset()
7070
{
7171
try
7272
{
73+
_logger.LogInformation("Resetting Wabbajack!");
7374
var currentPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location);
7475
var cliDir = Path.Combine(currentPath, "cli");
7576
string workingDir = Directory.Exists(cliDir) ? cliDir : currentPath;
77+
_logger.LogInformation("Launching CLI from directory {workingDir}", workingDir);
7678
Process.Start(new ProcessStartInfo()
7779
{
78-
FileName = "wabbajack-cli.exe",
80+
FileName = Path.Combine(workingDir, "wabbajack-cli.exe"),
7981
Arguments = "reset",
80-
CreateNoWindow = true
82+
CreateNoWindow = true,
83+
WorkingDirectory = workingDir
8184
});
8285
}
8386
catch (Exception ex)

Wabbajack.App.Wpf/ViewModels/UserInterventionHandlers.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace Wabbajack;
1414
public class UserInterventionHandlers
1515
{
1616
public MainWindowVM MainWindow { get; }
17-
private AsyncLock _browserLock = new();
1817
private readonly ILogger<UserInterventionHandlers> _logger;
1918

2019
public UserInterventionHandlers(ILogger<UserInterventionHandlers> logger, MainWindowVM mvm)

Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ public InstallationView()
270270
ReadmeToggleButton.IsChecked = true;
271271

272272
MessageBus.Current.Listen<ShowFloatingWindow>()
273+
.ObserveOnGuiThread()
273274
.Subscribe(msg =>
274275
{
275276
if (msg.Screen == FloatingScreenType.None && (ReadmeToggleButton.IsChecked ?? false))

0 commit comments

Comments
 (0)