diff --git a/LANCommander.Playnite.Extension/InstallController.cs b/LANCommander.Playnite.Extension/InstallController.cs index 3ec33f7..8eca948 100644 --- a/LANCommander.Playnite.Extension/InstallController.cs +++ b/LANCommander.Playnite.Extension/InstallController.cs @@ -37,7 +37,7 @@ namespace LANCommander.PlaynitePlugin var result = Plugin.PlayniteApi.Dialogs.ActivateGlobalProgress(progress => { - var gameManager = new GameManager(Plugin.LANCommanderClient); + var gameManager = new GameManager(Plugin.LANCommanderClient, Plugin.Settings.InstallDirectory); gameManager.OnArchiveExtractionProgress += (long pos, long len) => { diff --git a/LANCommander.Playnite.Extension/UninstallController.cs b/LANCommander.Playnite.Extension/UninstallController.cs index 93518d0..eb23735 100644 --- a/LANCommander.Playnite.Extension/UninstallController.cs +++ b/LANCommander.Playnite.Extension/UninstallController.cs @@ -23,7 +23,7 @@ namespace LANCommander.PlaynitePlugin { try { - var gameManager = new LANCommander.SDK.GameManager(Plugin.LANCommanderClient); + var gameManager = new LANCommander.SDK.GameManager(Plugin.LANCommanderClient, Plugin.Settings.InstallDirectory); gameManager.Uninstall(Game.InstallDirectory); } diff --git a/LANCommander.SDK/GameManager.cs b/LANCommander.SDK/GameManager.cs index 7c858ab..f0d1e03 100644 --- a/LANCommander.SDK/GameManager.cs +++ b/LANCommander.SDK/GameManager.cs @@ -25,14 +25,16 @@ namespace LANCommander.SDK public delegate void OnArchiveExtractionProgressHandler(long position, long length); public event OnArchiveExtractionProgressHandler OnArchiveExtractionProgress; - public GameManager(Client client) + public GameManager(Client client, string defaultInstallDirectory) { Client = client; + DefaultInstallDirectory = defaultInstallDirectory; } - public GameManager(Client client, ILogger logger) + public GameManager(Client client, string defaultInstallDirectory, ILogger logger) { Client = client; + DefaultInstallDirectory = DefaultInstallDirectory; Logger = logger; } @@ -53,7 +55,7 @@ namespace LANCommander.SDK { Logger?.LogTrace("Attempting to download and extract game"); - return DownloadAndExtract(game); + return DownloadAndExtract(game, DefaultInstallDirectory); }); if (!result.Success && !result.Canceled)