Netch.Global.NetchExecutable

This commit is contained in:
ChsBuffer
2021-02-18 18:34:01 +08:00
parent 710dd646b9
commit 0eb60d0c90
4 changed files with 5 additions and 3 deletions

View File

@@ -22,6 +22,8 @@ namespace Netch
public static readonly string NetchDir = Application.StartupPath;
public static readonly string NetchExecutable = Application.ExecutablePath;
/// <summary>
/// 主窗体的静态实例
/// </summary>

View File

@@ -69,7 +69,7 @@ namespace Netch
}
Logging.Info($"版本: {UpdateChecker.Owner}/{UpdateChecker.Repo}@{UpdateChecker.Version}");
Task.Run(() => { Logging.Info($"主程序 SHA256: {Utils.Utils.SHA256CheckSum(Application.ExecutablePath)}"); });
Task.Run(() => { Logging.Info($"主程序 SHA256: {Utils.Utils.SHA256CheckSum(Global.NetchExecutable)}"); });
Task.Run(() =>
{
Logging.Info("启动单实例");

View File

@@ -41,7 +41,7 @@ namespace Netch.Updater
MoveDirectory(Path.Combine(extractPath, "Netch"), Global.NetchDir, true);
Global.Mutex.ReleaseMutex();
Process.Start(Application.ExecutablePath);
Process.Start(Global.NetchExecutable);
Global.MainForm.Exit(true);
}

View File

@@ -257,7 +257,7 @@ namespace Netch.Utils
td.Principal.RunLevel = TaskRunLevel.Highest;
td.Triggers.Add(new LogonTrigger());
td.Actions.Add(new ExecAction(Application.ExecutablePath));
td.Actions.Add(new ExecAction(Global.NetchExecutable));
td.Settings.ExecutionTimeLimit = TimeSpan.Zero;
td.Settings.DisallowStartIfOnBatteries = false;