更新启动

This commit is contained in:
GukSang.Jin
2026-06-15 10:46:27 +08:00
parent 147ab67ea8
commit 0ccf78b392

View File

@@ -3,11 +3,14 @@ using Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services;
using Serilog;
using System;
using System.IO;
using System.Threading;
namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance
{
internal sealed class Program
{
private const string SingleInstanceMutexName = @"Global\FootwearSlipResistancePerformance";
[STAThread]
public static int Main(string[] args)
{
@@ -20,6 +23,16 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance
return MachineLicenseService.RunElevatedInstall(args[1]);
}
using var singleInstanceMutex = new Mutex(
initiallyOwned: true,
SingleInstanceMutexName,
out var isFirstInstance);
if (!isFirstInstance)
{
Log.Warning("检测到鞋类整鞋防滑性能试验程序已在运行,本次启动已取消");
return 0;
}
Log.Information("鞋类整鞋防滑性能试验程序启动");
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
return 0;