This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
UpTool2/UpTool2/Task/RemoveTask.cs
CreepyCrafter24 c186afa8b4 Stage changes
2020-04-08 20:57:50 +02:00

38 lines
811 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using UpToolLib.DataStructures;
using UpToolLib.Tool;
namespace UpTool2.Task
{
class RemoveTask : IKnownAppTask
{
public override App App { get; }
private readonly Action? _postInstall;
public RemoveTask(App app, Action? postInstall = null)
{
App = app;
_postInstall = postInstall;
}
public override void Run()
{
#if !DEBUG
try
{
#endif
AppExtras.Remove(App, true);
_postInstall?.Invoke();
#if !DEBUG
}
catch (Exception e1)
{
MessageBox.Show(e1.ToString(), "Removal failed");
}
#endif
}
}
}