2022-10-21 20:13:49 +00:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using GameFinder.Common;
|
|
|
|
using GameFinder.RegistryUtils;
|
New Wabbajack release (#2479)
* 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
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
using GameFinder.StoreHandlers.EADesktop;
|
|
|
|
using GameFinder.StoreHandlers.EADesktop.Crypto.Windows;
|
2021-09-27 12:42:46 +00:00
|
|
|
using GameFinder.StoreHandlers.EGS;
|
|
|
|
using GameFinder.StoreHandlers.GOG;
|
|
|
|
using GameFinder.StoreHandlers.Origin;
|
|
|
|
using GameFinder.StoreHandlers.Steam;
|
2023-10-12 18:33:06 +00:00
|
|
|
using GameFinder.StoreHandlers.Steam.Models;
|
|
|
|
using GameFinder.StoreHandlers.Steam.Models.ValueTypes;
|
2021-09-27 12:42:46 +00:00
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Wabbajack.DTOs;
|
|
|
|
using Wabbajack.Paths;
|
2022-10-21 20:13:49 +00:00
|
|
|
using Wabbajack.Paths.IO;
|
2021-09-27 12:42:46 +00:00
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
namespace Wabbajack.Downloaders.GameFile;
|
|
|
|
|
|
|
|
public class GameLocator : IGameLocator
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2022-10-21 20:13:49 +00:00
|
|
|
private readonly SteamHandler _steam;
|
2022-10-19 22:17:25 +00:00
|
|
|
private readonly GOGHandler? _gog;
|
2022-10-21 20:13:49 +00:00
|
|
|
private readonly EGSHandler? _egs;
|
|
|
|
private readonly OriginHandler? _origin;
|
New Wabbajack release (#2479)
* 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
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
private readonly EADesktopHandler? _eaDesktop;
|
2022-10-21 20:13:49 +00:00
|
|
|
|
2023-10-12 18:33:06 +00:00
|
|
|
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();
|
New Wabbajack release (#2479)
* 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
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
private readonly Dictionary<EADesktopGameId, AbsolutePath> _eaDesktopGames = new();
|
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
private readonly Dictionary<Game, AbsolutePath> _locationCache;
|
|
|
|
private readonly ILogger<GameLocator> _logger;
|
|
|
|
|
|
|
|
public GameLocator(ILogger<GameLocator> logger)
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2021-10-23 16:51:17 +00:00
|
|
|
_logger = logger;
|
2023-10-12 18:33:06 +00:00
|
|
|
var fileSystem = NexusMods.Paths.FileSystem.Shared;
|
2021-10-23 16:51:17 +00:00
|
|
|
|
2022-10-21 20:13:49 +00:00
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2022-10-21 20:13:49 +00:00
|
|
|
var windowsRegistry = new WindowsRegistry();
|
2022-10-19 22:17:25 +00:00
|
|
|
|
2023-10-12 18:33:06 +00:00
|
|
|
_steam = new SteamHandler(fileSystem, windowsRegistry);
|
|
|
|
_gog = new GOGHandler(windowsRegistry, fileSystem);
|
|
|
|
_egs = new EGSHandler(windowsRegistry, fileSystem);
|
|
|
|
_origin = new OriginHandler(fileSystem);
|
New Wabbajack release (#2479)
* 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
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
_eaDesktop = new EADesktopHandler(fileSystem, new HardwareInfoProvider());
|
2022-10-21 20:13:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
_steam = new SteamHandler(fileSystem, null);
|
2022-10-15 17:18:22 +00:00
|
|
|
}
|
|
|
|
|
2022-10-19 22:17:25 +00:00
|
|
|
_locationCache = new Dictionary<Game, AbsolutePath>();
|
2021-10-16 20:51:25 +00:00
|
|
|
|
2022-10-21 20:13:49 +00:00
|
|
|
FindAllGames();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void FindAllGames()
|
|
|
|
{
|
2022-10-19 22:17:25 +00:00
|
|
|
try
|
2022-10-15 17:18:22 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
FindStoreGames(_steam, _steamGames, game => (AbsolutePath)game.Path.GetFullPath());
|
2022-10-19 22:17:25 +00:00
|
|
|
}
|
2022-10-21 20:13:49 +00:00
|
|
|
catch (Exception e)
|
2022-10-19 22:17:25 +00:00
|
|
|
{
|
2022-10-21 20:13:49 +00:00
|
|
|
_logger.LogError(e, "While finding games installed with Steam");
|
2021-10-23 16:51:17 +00:00
|
|
|
}
|
2021-09-27 12:42:46 +00:00
|
|
|
|
2022-10-19 22:17:25 +00:00
|
|
|
try
|
2022-10-15 17:18:22 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
FindStoreGames(_gog, _gogGames, game => (AbsolutePath)game.Path.GetFullPath());
|
2022-10-19 22:17:25 +00:00
|
|
|
}
|
2022-10-21 20:13:49 +00:00
|
|
|
catch (Exception e)
|
2022-10-19 22:17:25 +00:00
|
|
|
{
|
2022-10-21 20:13:49 +00:00
|
|
|
_logger.LogError(e, "While finding games installed with GOG Galaxy");
|
2022-10-15 17:18:22 +00:00
|
|
|
}
|
2021-09-27 12:42:46 +00:00
|
|
|
|
2022-10-19 22:17:25 +00:00
|
|
|
try
|
2022-10-15 17:18:22 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
FindStoreGames(_egs, _egsGames, game => (AbsolutePath)game.InstallLocation.GetFullPath());
|
2022-10-19 22:17:25 +00:00
|
|
|
}
|
2022-10-21 20:13:49 +00:00
|
|
|
catch (Exception e)
|
2022-10-19 22:17:25 +00:00
|
|
|
{
|
2022-10-21 20:13:49 +00:00
|
|
|
_logger.LogError(e, "While finding games installed with the Epic Games Store");
|
2022-10-15 17:18:22 +00:00
|
|
|
}
|
|
|
|
|
2022-10-19 22:17:25 +00:00
|
|
|
try
|
2022-10-15 17:18:22 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
FindStoreGames(_origin, _originGames, game => (AbsolutePath)game.InstallPath.GetFullPath());
|
2022-10-21 20:13:49 +00:00
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
_logger.LogError(e, "While finding games installed with Origin");
|
|
|
|
}
|
New Wabbajack release (#2479)
* 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
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
FindStoreGames(_eaDesktop, _eaDesktopGames, game => (AbsolutePath)game.BaseInstallPath.GetFullPath());
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
_logger.LogError(e, "While finding games installed with EADesktop");
|
|
|
|
}
|
2022-10-21 20:13:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void FindStoreGames<TGame, TId>(
|
|
|
|
AHandler<TGame, TId>? handler,
|
|
|
|
Dictionary<TId, AbsolutePath> paths,
|
2023-10-12 18:33:06 +00:00
|
|
|
Func<TGame, AbsolutePath> getPath)
|
|
|
|
where TGame : class, IGame
|
|
|
|
where TId : notnull
|
2022-10-21 20:13:49 +00:00
|
|
|
{
|
|
|
|
if (handler is null) return;
|
|
|
|
|
|
|
|
var games = handler.FindAllGamesById(out var errors);
|
|
|
|
|
|
|
|
foreach (var (id, game) in games)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
var path = getPath(game);
|
2022-10-21 20:13:49 +00:00
|
|
|
if (!path.DirectoryExists())
|
|
|
|
{
|
|
|
|
_logger.LogError("Game does not exist: {Game}", game);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
paths[id] = path;
|
2022-12-28 18:00:37 +00:00
|
|
|
_logger.LogInformation("Found {Game}", game);
|
2022-10-21 20:13:49 +00:00
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
_logger.LogError(e, "While locating {Game}", game);
|
|
|
|
}
|
2022-10-19 22:17:25 +00:00
|
|
|
}
|
2022-10-21 20:13:49 +00:00
|
|
|
|
|
|
|
foreach (var error in errors)
|
2022-10-19 22:17:25 +00:00
|
|
|
{
|
2022-10-21 20:13:49 +00:00
|
|
|
_logger.LogError("{Error}", error);
|
2022-10-15 17:18:22 +00:00
|
|
|
}
|
2021-10-23 16:51:17 +00:00
|
|
|
}
|
2021-09-27 12:42:46 +00:00
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
public AbsolutePath GameLocation(Game game)
|
|
|
|
{
|
|
|
|
if (TryFindLocation(game, out var path))
|
|
|
|
return path;
|
|
|
|
throw new Exception($"Can't find game {game}");
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsInstalled(Game game)
|
|
|
|
{
|
|
|
|
return TryFindLocation(game, out _);
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool TryFindLocation(Game game, out AbsolutePath path)
|
|
|
|
{
|
|
|
|
lock (_locationCache)
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2021-10-23 16:51:17 +00:00
|
|
|
if (_locationCache.TryGetValue(game, out path))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if (TryFindLocationInner(game, out path))
|
|
|
|
{
|
|
|
|
_locationCache.Add(game, path);
|
|
|
|
return true;
|
|
|
|
}
|
2021-09-27 12:42:46 +00:00
|
|
|
}
|
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private bool TryFindLocationInner(Game game, out AbsolutePath path)
|
|
|
|
{
|
|
|
|
var metaData = game.MetaData();
|
2022-10-15 17:18:22 +00:00
|
|
|
|
2022-10-21 20:13:49 +00:00
|
|
|
foreach (var id in metaData.SteamIDs)
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
if (!_steamGames.TryGetValue(AppId.From((uint)id), out var found)) continue;
|
2022-10-21 20:13:49 +00:00
|
|
|
path = found;
|
|
|
|
return true;
|
2021-09-27 12:42:46 +00:00
|
|
|
}
|
2022-10-18 04:48:49 +00:00
|
|
|
|
2022-10-21 20:13:49 +00:00
|
|
|
foreach (var id in metaData.GOGIDs)
|
2022-10-19 17:28:07 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
if (!_gogGames.TryGetValue(GOGGameId.From(id), out var found)) continue;
|
2022-10-21 20:13:49 +00:00
|
|
|
path = found;
|
|
|
|
return true;
|
2021-10-23 16:51:17 +00:00
|
|
|
}
|
2022-10-18 04:48:49 +00:00
|
|
|
|
2022-10-21 20:13:49 +00:00
|
|
|
foreach (var id in metaData.EpicGameStoreIDs)
|
2021-10-24 04:39:57 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
if (!_egsGames.TryGetValue(EGSGameId.From(id), out var found)) continue;
|
2022-10-21 20:13:49 +00:00
|
|
|
path = found;
|
|
|
|
return true;
|
2021-10-24 04:39:57 +00:00
|
|
|
}
|
2022-10-19 17:28:07 +00:00
|
|
|
|
2022-10-21 20:13:49 +00:00
|
|
|
foreach (var id in metaData.OriginIDs)
|
2022-10-19 17:28:07 +00:00
|
|
|
{
|
2023-10-12 18:33:06 +00:00
|
|
|
if (!_originGames.TryGetValue(OriginGameId.From(id), out var found)) continue;
|
2022-10-21 20:13:49 +00:00
|
|
|
path = found;
|
|
|
|
return true;
|
2022-10-19 17:28:07 +00:00
|
|
|
}
|
New Wabbajack release (#2479)
* 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
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
|
|
|
|
foreach (var id in metaData.EADesktopIDs)
|
|
|
|
{
|
|
|
|
if (!_eaDesktopGames.TryGetValue(EADesktopGameId.From(id), out var found)) continue;
|
|
|
|
path = found;
|
|
|
|
return true;
|
|
|
|
}
|
2022-10-19 17:28:07 +00:00
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
path = default;
|
|
|
|
return false;
|
2021-09-27 12:42:46 +00:00
|
|
|
}
|
2022-10-21 20:13:49 +00:00
|
|
|
}
|