LANCommander/LANCommander.Playnite.Exten.../UninstallController.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2023-04-08 00:09:00 +00:00
using LANCommander.SDK.Enums;
2023-08-21 23:44:20 +00:00
using Playnite.SDK;
2023-01-07 18:46:26 +00:00
using Playnite.SDK.Models;
using Playnite.SDK.Plugins;
using System;
using System.IO;
namespace LANCommander.PlaynitePlugin
2023-01-07 18:46:26 +00:00
{
public class LANCommanderUninstallController : UninstallController
{
2023-08-21 23:44:20 +00:00
public static readonly ILogger Logger = LogManager.GetLogger();
private LANCommanderLibraryPlugin Plugin;
2023-01-07 18:46:26 +00:00
public LANCommanderUninstallController(LANCommanderLibraryPlugin plugin, Game game) : base(game)
2023-01-07 18:46:26 +00:00
{
Name = "Uninstall LANCommander Game";
Plugin = plugin;
}
public override void Uninstall(UninstallActionArgs args)
{
try
{
var gameManager = new LANCommander.SDK.GameManager(Plugin.LANCommanderClient, Plugin.Settings.InstallDirectory);
2023-08-21 23:44:20 +00:00
gameManager.Uninstall(Game.InstallDirectory);
}
catch (Exception ex)
{
2023-01-07 18:46:26 +00:00
}
2023-08-21 23:44:20 +00:00
2023-01-07 18:46:26 +00:00
InvokeOnUninstalled(new GameUninstalledEventArgs());
}
}
}