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

New Wabbajack release #2479

Merged
merged 85 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 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
d62f59f
Don't try to add cookies if array is empty
UrbanCMC Oct 20, 2023
058b1bb
Start download from scratch if .download_package can't be parsed
UrbanCMC Oct 20, 2023
45c3463
Log when application is shutting down
UrbanCMC Oct 20, 2023
23499d1
Merge branch 'main' into fix-downloader-issues
EzioTheDeadPoet Oct 21, 2023
2404a85
Merge branch 'main' into fix-downloader-issues
EzioTheDeadPoet Oct 21, 2023
ecd5b4a
Merge branch 'main' into pre-release
EzioTheDeadPoet Oct 21, 2023
d562afc
update CHANGELOG.md
EzioTheDeadPoet Oct 21, 2023
40ccbe7
Merge remote-tracking branch 'origin/fix-downloader-issues' into pre-…
EzioTheDeadPoet Oct 21, 2023
f425bbc
exclude the "SP Consent Message" on nexus from the cleared iframes
EzioTheDeadPoet Oct 31, 2023
f2a2ae4
Actually use the --outputPath compile option if the user provides one
majcosta Oct 25, 2023
d59fc87
update Wabbajack.Compression.BSA dependencies
EzioTheDeadPoet Nov 2, 2023
ccff5b8
improve log message to include storage space reference
EzioTheDeadPoet Nov 2, 2023
a61ea63
Merge remote-tracking branch 'origin/main' into pre-release
EzioTheDeadPoet Nov 2, 2023
437ef90
Merge branch 'updating-Compression.BSA-dependencies' into pre-release
EzioTheDeadPoet Nov 2, 2023
2adcf45
Merge pull request #2432 from majcosta/pr_use_outputpath
EzioTheDeadPoet Nov 2, 2023
7fd3671
clearing temp folder when the app closes
EzioTheDeadPoet Nov 2, 2023
65ad593
Merge branch 'temp-file-handling-and-logging-changes' into pre-release
EzioTheDeadPoet Nov 2, 2023
f3a0f65
update logging message
EzioTheDeadPoet Nov 2, 2023
7572135
update CHANGELOG.md
EzioTheDeadPoet Nov 2, 2023
d3eeb17
update CHANGELOG.md
EzioTheDeadPoet Nov 2, 2023
e40845b
update logging for possible exceptions thrown when clearing temp folder
EzioTheDeadPoet Nov 3, 2023
276ecde
fix cloudflare captcha
EzioTheDeadPoet Nov 5, 2023
2e56c70
update Final Fantasy VII: RI metadata
EzioTheDeadPoet Jan 4, 2024
5daefc5
Update CHANGELOG.md
EzioTheDeadPoet Jan 4, 2024
f95d467
fix error
EzioTheDeadPoet Jan 4, 2024
545d9ae
Update GameRegistry.cs
EzioTheDeadPoet Jan 6, 2024
fb3f8a7
Updated GameFinder, Added EADesktop module
EzioTheDeadPoet Jan 8, 2024
3b81f3b
updated version number in CHANGELOG.md
EzioTheDeadPoet Jan 8, 2024
81617f3
Merge branch 'main' into pre-release
EzioTheDeadPoet Jan 8, 2024
5aab0b8
Merge branch 'FFVIIRI-MetaData-Update' into pre-release
EzioTheDeadPoet Jan 8, 2024
1e245e4
Merge branch 'GameFinder-Upgrade' into pre-release
EzioTheDeadPoet Jan 8, 2024
a8aad32
updated logging code
EzioTheDeadPoet Jan 8, 2024
6a2189d
Merge branch 'logging-update-for-temp-clear-on-close' into pre-release
EzioTheDeadPoet Jan 8, 2024
0446e31
update CHANGELOG.md
EzioTheDeadPoet Jan 8, 2024
1b3d85a
Merge branch 'logging-update-for-temp-clear-on-close' into pre-release
EzioTheDeadPoet Jan 8, 2024
3cdf3c9
Fix Nexus login (#2476)
tr4wzified Jan 11, 2024
fdabeae
Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
tr4wzified Jan 12, 2024
fc26f55
Merge pull request #2477 from wabbajack-tools/fix-bg3-typo
tr4wzified Jan 12, 2024
91ddb39
Fix WebView2 taking up tons of memory, use single WebView window - st…
tr4wzified Jan 12, 2024
591f9ba
Remove commented WebView
tr4wzified Jan 12, 2024
2618d53
Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
tr4wzified Jan 12, 2024
79a002f
Merge pull request #2478 from wabbajack-tools/webview2-singlewindow
tr4wzified Jan 12, 2024
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
### Changelog

#### Version - TBD
* Updated GameFinder to 4.1.0
* Fixes Wabbajack not Launching on some systems
* Added the GameFinder module for EA Desktop
* Only `Dragon Age: Origins` & `Dragon Age: Inquisition` supported for now.
* For other games we still need to collect the right store IDs
* Fixed Final Fantasy 7: Remake Intergrade meta data
* Fixed new WebView2 instances being created constantly causing a memory leak
* Fixed the Nexus API key no longer being picked up when logging in
* Fixed Baldur's Gate 3 having to be named 'badlursgate3' instead of 'baldursgate3' when defining a modlist JSON
* Fixed wabbajack-cli.bat pointing to the wrong CLI executable path

#### Version - 3.4.1.0 - 12/21/2023
* Added Support for Final Fantasy 7: Remake Intergrade
* Update CLI to .NET 8.0 (was missed in the last update)
* Added Support for Baldur's Gate 3
* Very Work in Progress
* **NOT** Plug and Play for compiling and installing!
* Fixed a logging error when closing the App without a `temp` folder to delete

#### Version - 3.4.0.0 - 11/19/2023
* Fixed `--outputPath` not being used for the CLI `compile` (thanks to @majcosta for fixing that)
Expand Down
2 changes: 2 additions & 0 deletions Wabbajack.App.Wpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Web.WebView2.Wpf;
using NLog.Extensions.Logging;
using NLog.Targets;
using Orc.FileAssociation;
Expand Down Expand Up @@ -164,6 +165,7 @@ private static IServiceCollection ConfigureServices(IServiceCollection services)
services.AddSingleton<SystemParametersConstructor>();
services.AddSingleton<LauncherUpdater>();
services.AddSingleton<ResourceMonitor>();
services.AddSingleton<WebView2>();

services.AddTransient<CompilerVM>();
services.AddTransient<InstallerVM>();
Expand Down
2 changes: 1 addition & 1 deletion Wabbajack.App.Wpf/LoginManagers/LoversLabLoginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public LoversLabLoginManager(ILogger<LoversLabLoginManager> logger, ITokenProvid

private void StartLogin()
{
var view = new BrowserWindow();
var view = new BrowserWindow(_serviceProvider);
view.Closed += (sender, args) => { RefreshTokenState(); };
var provider = _serviceProvider.GetRequiredService<LoversLabLoginHandler>();
view.DataContext = provider;
Expand Down
2 changes: 1 addition & 1 deletion Wabbajack.App.Wpf/LoginManagers/NexusLoginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public NexusLoginManager(ILogger<NexusLoginManager> logger, ITokenProvider<Nexus

private void StartLogin()
{
var view = new BrowserWindow();
var view = new BrowserWindow(_serviceProvider);
view.Closed += (sender, args) => { RefreshTokenState(); };
var provider = _serviceProvider.GetRequiredService<NexusLoginHandler>();
view.DataContext = provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public VectorPlexusLoginManager(ILogger<VectorPlexusLoginManager> logger, IToken

private void StartLogin()
{
var view = new BrowserWindow();
var view = new BrowserWindow(_serviceProvider);
view.Closed += (sender, args) => { RefreshTokenState(); };
var provider = _serviceProvider.GetRequiredService<VectorPlexusLoginHandler>();
view.DataContext = provider;
Expand Down
14 changes: 4 additions & 10 deletions Wabbajack.App.Wpf/UserIntervention/NexusLoginHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,15 @@ await NavigateTo(new Uri(

Instructions = "Getting API Key...";

await NavigateTo(new Uri("https://www.nexusmods.com/users/myaccount?tab=api"));
await NavigateTo(new Uri("https://next.nexusmods.com/settings/api-keys"));

var key = "";

while (true)
{
try
{
key = (await GetDom(token))
.DocumentNode
.QuerySelectorAll("input[value=wabbajack]")
.SelectMany(p => p.ParentNode.ParentNode.QuerySelectorAll("textarea.application-key"))
.Select(node => node.InnerHtml)
.FirstOrDefault() ?? "";
key = (await GetDom(token)).DocumentNode.QuerySelectorAll("img[alt='Wabbajack']").SelectMany(p => p.ParentNode.ParentNode.QuerySelectorAll("input[aria-label='api key']")).Select(node => node.Attributes["value"]).FirstOrDefault()?.Value;
}
catch (Exception)
{
Expand All @@ -71,11 +66,10 @@ await NavigateTo(new Uri(
try
{
await EvaluateJavaScript(
"var found = document.querySelector(\"input[value=wabbajack]\").parentElement.parentElement.querySelector(\"form button[type=submit]\");" +
"var found = document.querySelector(\"img[alt='Wabbajack']\").parentElement.parentElement.querySelector(\"button[aria-label='Request Api Key']\");" +
"found.onclick= function() {return true;};" +
"found.class = \" \"; " +
"found.click();" +
"found.remove(); found = undefined;"
"found.click();"
);
Instructions = "Generating API Key, Please Wait...";
}
Expand Down
2 changes: 1 addition & 1 deletion Wabbajack.App.Wpf/Verbs/NexusLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public NexusLogin(ILogger<NexusLogin> logger, IServiceProvider services)
public async Task<int> Run(CancellationToken token)
{
var tcs = new TaskCompletionSource<int>();
var view = new BrowserWindow();
var view = new BrowserWindow(_services);
view.Closed += (sender, args) => { tcs.TrySetResult(0); };
var provider = _services.GetRequiredService<NexusLoginHandler>();
view.DataContext = provider;
Expand Down
5 changes: 1 addition & 4 deletions Wabbajack.App.Wpf/Views/BrowserWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
WindowTitleBrush="{StaticResource MahApps.Brushes.Accent}"
ContentRendered="BrowserWindow_OnActivated"
mc:Ignorable="d">
<Grid Background="#121212" MouseDown="UIElement_OnMouseDown">
<Grid x:Name="MainGrid" Background="#121212" MouseDown="UIElement_OnMouseDown">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
Expand All @@ -46,8 +46,5 @@
<icon:PackIconModern Kind="PageCopy"></icon:PackIconModern>
</Button>
<TextBox Grid.Row="2" Grid.Column="3" Margin="4" VerticalContentAlignment="Center" Name="AddressBar" IsEnabled="False"></TextBox>

<wpf:WebView2 Grid.Row="3" Grid.ColumnSpan="3" Name="Browser"></wpf:WebView2>

</Grid>
</mahapps:MetroWindow>
22 changes: 20 additions & 2 deletions Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using System;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using MahApps.Metro.Controls;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Web.WebView2.Wpf;
using ReactiveUI;
using Wabbajack.Common;

Expand All @@ -14,12 +18,27 @@ namespace Wabbajack;
public partial class BrowserWindow : MetroWindow
{
private readonly CompositeDisposable _disposable;
private readonly IServiceProvider _serviceProvider;
public WebView2 Browser { get; set; }

public BrowserWindow()
public BrowserWindow(IServiceProvider serviceProvider)
{
InitializeComponent();


_disposable = new CompositeDisposable();
_serviceProvider = serviceProvider;
Browser = _serviceProvider.GetRequiredService<WebView2>();
RxApp.MainThreadScheduler.Schedule(() =>
{
if(Browser.Parent != null)
{
((Panel)Browser.Parent).Children.Remove(Browser);
}
MainGrid.Children.Add(Browser);
Grid.SetRow(Browser, 3);
Grid.SetColumnSpan(Browser, 3);
});
}

private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e)
Expand Down Expand Up @@ -58,7 +77,6 @@ private void BrowserWindow_OnActivated(object sender, EventArgs e)
.ContinueWith(_ => Dispatcher.Invoke(() =>
{
Close();
Browser = null;
}));
}
}
17 changes: 8 additions & 9 deletions Wabbajack.App.Wpf/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,26 @@ public MainWindow(ILogger<MainWindow> logger, SystemParametersConstructor system
// 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);
var directoryInfo = new DirectoryInfo(tempDirectory);
try
{
var directoryInfo = new DirectoryInfo(tempDirectory);

foreach (var file in directoryInfo.EnumerateFiles())
{
file.Delete();
file.Delete();
}

foreach (var dir in directoryInfo.EnumerateDirectories())
{
dir.Delete(true);
dir.Delete(true);
}
_logger.LogInformation("Finished clearing {TempDir}",tempDirectory);

_logger.LogInformation("Finished clearing {TempDir}", tempDirectory);
}
catch (Exception ex)
catch (DirectoryNotFoundException)
{
_logger.LogError(ex,"Failed clearing {TempDir}",tempDirectory);
_logger.LogInformation("Unable to find {TempDir}", tempDirectory);
}


Application.Current.Shutdown();
};

Expand Down
2 changes: 1 addition & 1 deletion Wabbajack.DTOs/Game/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ public enum Game
[Description("Modding Tools")] ModdingTools,

[Description("Final Fantasy VII Remake")] FinalFantasy7Remake,
[Description("Baldur's Gate 3")] BadlursGate3
[Description("Baldur's Gate 3")] BaldursGate3
}
3 changes: 3 additions & 0 deletions Wabbajack.DTOs/Game/GameMetaData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices.JavaScript;
using Wabbajack.Paths;

namespace Wabbajack.DTOs;
Expand Down Expand Up @@ -29,6 +30,8 @@ public class GameMetaData
// EAPlay games may have @subscription appended to the file name
public string[] OriginIDs { get; set; } = Array.Empty<string>();

public string[] EADesktopIDs { get; set; } = Array.Empty<string>();

public string[] EpicGameStoreIDs { get; internal init; } = Array.Empty<string>();

// to get BethNet IDs: check the registry
Expand Down
43 changes: 38 additions & 5 deletions Wabbajack.DTOs/Game/GameRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,22 @@ public static class GameRegistry
MO2Name = "Dragon Age: Origins",
SteamIDs = new[] {47810},
OriginIDs = new[] {"DR:169789300", "DR:208591800"},
EADesktopIDs = new [] // Possibly Wrong
{
"9df89a8e-b201-4507-8a8d-bd6799fedb18",
"Origin.SFT.50.0000078",
"Origin.SFT.50.0000078",
"Origin.SFT.50.0000078",
"Origin.SFT.50.0000085",
"Origin.SFT.50.0000086",
"Origin.SFT.50.0000087",
"Origin.SFT.50.0000088",
"Origin.SFT.50.0000089",
"Origin.SFT.50.0000090",
"Origin.SFT.50.0000091",
"Origin.SFT.50.0000097",
"Origin.SFT.50.0000098"
},
GOGIDs = new long[] {1949616134},
RequiredFiles = new[]
{
Expand All @@ -374,6 +390,22 @@ public static class GameRegistry
MO2Name = "Dragon Age 2", // Probably wrong
SteamIDs = new[] {1238040},
OriginIDs = new[] {"OFB-EAST:59474", "DR:201797000"},
EADesktopIDs = new [] // Possibly Wrong
{
"Origin.SFT.50.0000073",
"Origin.SFT.50.0000255",
"Origin.SFT.50.0000256",
"Origin.SFT.50.0000257",
"Origin.SFT.50.0000288",
"Origin.SFT.50.0000310",
"Origin.SFT.50.0000311",
"Origin.SFT.50.0000356",
"Origin.SFT.50.0000385",
"Origin.SFT.50.0000429",
"Origin.SFT.50.0000449",
"Origin.SFT.50.0000452",
"Origin.SFT.50.0000453"
},
RequiredFiles = new[]
{
@"bin_ship\DragonAge2.exe".ToRelativePath()
Expand Down Expand Up @@ -540,21 +572,22 @@ public static class GameRegistry
Game = Game.FinalFantasy7Remake,
NexusName = "finalfantasy7remake",
NexusGameId = 4202,
MO2Name = "FINAL FANTASY VII REMAKE",
MO2Name = "FINAL FANTASY VII REMAKE INTERGRADE",
MO2ArchiveName = "finalfantasy7remake",
SteamIDs = new[] { 1462040 },
IsGenericMO2Plugin = true,
RequiredFiles = new []
{
@"ff7remake.exe".ToRelativePath()
@"End\Binaries\Win64\ff7remake_.exe".ToRelativePath(),
@"ff7remake_.exe".ToRelativePath()
},
MainExecutable = @"ff7remake.exe".ToRelativePath()
MainExecutable = @"End\Binaries\Win64\ff7remake_.exe".ToRelativePath()
}
},
{
Game.BadlursGate3, new GameMetaData
Game.BaldursGate3, new GameMetaData
{
Game = Game.BadlursGate3,
Game = Game.BaldursGate3,
NexusName = "baldursgate3",
NexusGameId = 3474,
MO2Name = "Baldur's Gate 3",
Expand Down
22 changes: 21 additions & 1 deletion Wabbajack.Downloaders.GameFile/GameLocator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Runtime.InteropServices;
using GameFinder.Common;
using GameFinder.RegistryUtils;
using GameFinder.StoreHandlers.EADesktop;
using GameFinder.StoreHandlers.EADesktop.Crypto.Windows;
using GameFinder.StoreHandlers.EGS;
using GameFinder.StoreHandlers.GOG;
using GameFinder.StoreHandlers.Origin;
Expand All @@ -20,12 +22,14 @@ public class GameLocator : IGameLocator
private readonly GOGHandler? _gog;
private readonly EGSHandler? _egs;
private readonly OriginHandler? _origin;
private readonly EADesktopHandler? _eaDesktop;

private readonly Dictionary<AppId, AbsolutePath> _steamGames = new();
private readonly Dictionary<GOGGameId, AbsolutePath> _gogGames = new();
private readonly Dictionary<EGSGameId, AbsolutePath> _egsGames = new();
private readonly Dictionary<OriginGameId, AbsolutePath> _originGames = new();

private readonly Dictionary<EADesktopGameId, AbsolutePath> _eaDesktopGames = new();

private readonly Dictionary<Game, AbsolutePath> _locationCache;
private readonly ILogger<GameLocator> _logger;

Expand All @@ -42,6 +46,7 @@ public GameLocator(ILogger<GameLocator> logger)
_gog = new GOGHandler(windowsRegistry, fileSystem);
_egs = new EGSHandler(windowsRegistry, fileSystem);
_origin = new OriginHandler(fileSystem);
_eaDesktop = new EADesktopHandler(fileSystem, new HardwareInfoProvider());
}
else
{
Expand Down Expand Up @@ -90,6 +95,14 @@ private void FindAllGames()
{
_logger.LogError(e, "While finding games installed with Origin");
}
try
{
FindStoreGames(_eaDesktop, _eaDesktopGames, game => (AbsolutePath)game.BaseInstallPath.GetFullPath());
}
catch (Exception e)
{
_logger.LogError(e, "While finding games installed with EADesktop");
}
}

private void FindStoreGames<TGame, TId>(
Expand Down Expand Up @@ -189,6 +202,13 @@ private bool TryFindLocationInner(Game game, out AbsolutePath path)
path = found;
return true;
}

foreach (var id in metaData.EADesktopIDs)
{
if (!_eaDesktopGames.TryGetValue(EADesktopGameId.From(id), out var found)) continue;
path = found;
return true;
}

path = default;
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GameFinder.StoreHandlers.EGS" Version="4.0.0" />
<PackageReference Include="GameFinder.StoreHandlers.GOG" Version="4.0.0" />
<PackageReference Include="GameFinder.StoreHandlers.Origin" Version="4.0.0" />
<PackageReference Include="GameFinder.StoreHandlers.Steam" Version="4.0.0" />
<PackageReference Include="GameFinder.StoreHandlers.EADesktop" Version="4.1.0" />
<PackageReference Include="GameFinder.StoreHandlers.EGS" Version="4.1.0" />
<PackageReference Include="GameFinder.StoreHandlers.GOG" Version="4.1.0" />
<PackageReference Include="GameFinder.StoreHandlers.Origin" Version="4.1.0" />
<PackageReference Include="GameFinder.StoreHandlers.Steam" Version="4.1.0" />
</ItemGroup>

</Project>
Loading
Loading