mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Remove Uninstall reg key when agent uninstalls itself.
This commit is contained in:
parent
a0ef956e57
commit
4e877ded68
@ -1,4 +1,5 @@
|
||||
using Remotely.Shared.Utilities;
|
||||
using Microsoft.Win32;
|
||||
using Remotely.Shared.Utilities;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@ -12,7 +13,14 @@ namespace Remotely.Agent.Services
|
||||
if (EnvironmentHelper.IsWindows)
|
||||
{
|
||||
Process.Start("cmd.exe", "/c sc delete Remotely_Service");
|
||||
var currentDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
||||
var view = Environment.Is64BitOperatingSystem ?
|
||||
"/reg:64" :
|
||||
"/reg:32";
|
||||
|
||||
Process.Start("cmd.exe", @$"/c REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Remotely /f {view}");
|
||||
|
||||
var currentDir = Path.GetDirectoryName(typeof(Uninstaller).Assembly.Location);
|
||||
Process.Start("cmd.exe", $"/c timeout 5 & rd /s /q \"{currentDir}\"");
|
||||
}
|
||||
else if (EnvironmentHelper.IsLinux)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user