Uninstall games
This commit is contained in:
parent
787a983c03
commit
fead35e612
3 changed files with 43 additions and 0 deletions
|
@ -87,6 +87,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="UninstallController.cs" />
|
||||||
<Compile Include="InstallController.cs" />
|
<Compile Include="InstallController.cs" />
|
||||||
<Compile Include="LANCommanderClient.cs" />
|
<Compile Include="LANCommanderClient.cs" />
|
||||||
<Compile Include="PlayniteClient.cs" />
|
<Compile Include="PlayniteClient.cs" />
|
||||||
|
|
|
@ -74,6 +74,14 @@ namespace LANCommander.Playnite.Extension
|
||||||
yield return new LANCommanderInstallController(this, args.Game);
|
yield return new LANCommanderInstallController(this, args.Game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<UninstallController> GetUninstallActions(GetUninstallActionsArgs args)
|
||||||
|
{
|
||||||
|
if (args.Game.PluginId != Id)
|
||||||
|
yield break;
|
||||||
|
|
||||||
|
yield return new LANCommanderUninstallController(this, args.Game);
|
||||||
|
}
|
||||||
|
|
||||||
public override ISettings GetSettings(bool firstRunSettings)
|
public override ISettings GetSettings(bool firstRunSettings)
|
||||||
{
|
{
|
||||||
return Settings;
|
return Settings;
|
||||||
|
|
34
LANCommander.Playnite.Extension/UninstallController.cs
Normal file
34
LANCommander.Playnite.Extension/UninstallController.cs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
using Playnite.SDK;
|
||||||
|
using Playnite.SDK.Models;
|
||||||
|
using Playnite.SDK.Plugins;
|
||||||
|
using LANCommander.SDK.Extensions;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ICSharpCode.SharpZipLib.Zip;
|
||||||
|
using ICSharpCode.SharpZipLib.Core;
|
||||||
|
|
||||||
|
namespace LANCommander.Playnite.Extension
|
||||||
|
{
|
||||||
|
public class LANCommanderUninstallController : UninstallController
|
||||||
|
{
|
||||||
|
private PlayniteLibraryPlugin Plugin;
|
||||||
|
|
||||||
|
public LANCommanderUninstallController(PlayniteLibraryPlugin plugin, Game game) : base(game)
|
||||||
|
{
|
||||||
|
Name = "Uninstall LANCommander Game";
|
||||||
|
Plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Uninstall(UninstallActionArgs args)
|
||||||
|
{
|
||||||
|
Directory.Delete(Game.InstallDirectory, true);
|
||||||
|
|
||||||
|
InvokeOnUninstalled(new GameUninstalledEventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue