client: Windows 客户端(WinUI3 壳 + agent-core;调试用 Electron 壳存档);localserver token 改为常数时间比较

This commit is contained in:
Qiufeng
2026-08-20 20:38:21 +08:00
parent 33b7d57498
commit 9abf7f8213
60 changed files with 10025 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
using Microsoft.Win32;
namespace EveryPublish.Client.Services;
/// <summary>开机自启(HKCU Run)</summary>
public static class AutoStart
{
private const string RunKey = @"Software\Microsoft\Windows\CurrentVersion\Run";
private const string ValueName = "EveryPublishClient";
public static bool IsEnabled()
{
using var key = Registry.CurrentUser.OpenSubKey(RunKey);
return key?.GetValue(ValueName) != null;
}
public static void SetEnabled(bool enabled)
{
using var key = Registry.CurrentUser.CreateSubKey(RunKey);
if (key == null) return;
if (enabled)
{
var exe = Environment.ProcessPath ?? "";
key.SetValue(ValueName, "\"" + exe + "\" --minimized");
}
else
{
key.DeleteValue(ValueName, false);
}
}
}