RDPWrapInstaller is an implementation of the RDPWrapper installer that allows you to programmatically manage the installation, uninstallation and other features of RDPWrapper
Install-Package ...
var rdpWrap = new RDPWrap();
await rdpWrap.Install();
await rdpWrap.Uninstall();
await rdpWrap.Reload();
private static RDPWrap _rdpWrap;
static async Task Main(string[] args)
{
_rdpWrap = new RDPWrap();
Console.WriteLine("I - install\n" +
"U - uninstall");
Console.Write("Command: ");
try
{
char cmd = Char.ToLower(Console.ReadKey().KeyChar);
Console.WriteLine();
var task = cmd switch
{
'i' => Install(),
'u' => Uninstall(),
_ => throw new ArgumentOutOfRangeException()
};
await task;
Console.WriteLine("Command completed.");
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex);
}
Console.ReadLine();
}
private static async Task Install()
{
if (!_rdpWrap.IsInstalled())
await _rdpWrap.Install();
}
private static async Task Uninstall()
{
if (_rdpWrap.IsInstalled())
await _rdpWrap.Uninstall();
}
RDPWrapInstaller is licensed under the MIT license.