2025-05-05 20:43:28 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using Avalonia;
|
2024-12-18 12:37:00 +03:00
|
|
|
|
|
|
|
|
|
|
namespace Nebula.Launcher;
|
|
|
|
|
|
|
2025-01-05 17:05:23 +03:00
|
|
|
|
public static class Program
|
2024-12-18 12:37:00 +03:00
|
|
|
|
{
|
2025-05-05 20:43:28 +03:00
|
|
|
|
private static Mutex? _mutex;
|
|
|
|
|
|
public static bool IsNewInstance;
|
|
|
|
|
|
[STAThread]
|
2025-01-14 22:10:16 +03:00
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
2025-05-05 20:43:28 +03:00
|
|
|
|
_mutex = new Mutex(true, $"Global\\Nebula.Launcher", out IsNewInstance);
|
2025-01-14 22:10:16 +03:00
|
|
|
|
BuildAvaloniaApp()
|
|
|
|
|
|
.StartWithClassicDesktopLifetime(args);
|
2025-05-05 20:43:28 +03:00
|
|
|
|
|
|
|
|
|
|
if (IsNewInstance)
|
|
|
|
|
|
_mutex.ReleaseMutex();
|
2025-01-14 22:10:16 +03:00
|
|
|
|
}
|
2024-12-18 12:37:00 +03:00
|
|
|
|
|
|
|
|
|
|
// Avalonia configuration, don't remove; also used by visual designer.
|
2024-12-30 22:23:55 +03:00
|
|
|
|
private static AppBuilder BuildAvaloniaApp()
|
2025-01-14 22:10:16 +03:00
|
|
|
|
{
|
|
|
|
|
|
return AppBuilder.Configure<App>()
|
2024-12-18 12:37:00 +03:00
|
|
|
|
.UsePlatformDetect()
|
|
|
|
|
|
.WithInterFont()
|
|
|
|
|
|
.LogToTrace();
|
2025-01-14 22:10:16 +03:00
|
|
|
|
}
|
2025-05-05 20:43:28 +03:00
|
|
|
|
}
|
|
|
|
|
|
|