diff --git a/LANCommander.Playnite.Extension/InstallController.cs b/LANCommander.Playnite.Extension/InstallController.cs index 4f774a2..da38b67 100644 --- a/LANCommander.Playnite.Extension/InstallController.cs +++ b/LANCommander.Playnite.Extension/InstallController.cs @@ -32,7 +32,6 @@ namespace LANCommander.PlaynitePlugin public override void Install(InstallActionArgs args) { - var tempPath = System.IO.Path.GetTempFileName(); var gameId = Guid.Parse(Game.GameId); var game = Plugin.LANCommander.GetGame(gameId); @@ -50,7 +49,11 @@ namespace LANCommander.PlaynitePlugin File.WriteAllText(Path.Combine(installDirectory, "_manifest.yml"), GetManifest(gameId)); - PowerShellRuntime.RunInstallScript(PlayniteGame); + try + { + PowerShellRuntime.RunInstallScript(PlayniteGame); + } + catch { } InvokeOnInstalled(new GameInstalledEventArgs(installInfo)); diff --git a/LANCommander.Playnite.Extension/UninstallController.cs b/LANCommander.Playnite.Extension/UninstallController.cs index f482867..6fd98c4 100644 --- a/LANCommander.Playnite.Extension/UninstallController.cs +++ b/LANCommander.Playnite.Extension/UninstallController.cs @@ -17,15 +17,23 @@ namespace LANCommander.PlaynitePlugin public class LANCommanderUninstallController : UninstallController { private LANCommanderLibraryPlugin Plugin; + private PowerShellRuntime PowerShellRuntime; public LANCommanderUninstallController(LANCommanderLibraryPlugin plugin, Game game) : base(game) { Name = "Uninstall LANCommander Game"; Plugin = plugin; + PowerShellRuntime = new PowerShellRuntime(); } public override void Uninstall(UninstallActionArgs args) { + try + { + PowerShellRuntime.RunUninstallScript(Game); + } + catch { } + if (!String.IsNullOrWhiteSpace(Game.InstallDirectory) && Directory.Exists(Game.InstallDirectory)) Directory.Delete(Game.InstallDirectory, true);