Files
LanMountainDesktop/LanMountainDesktop.Launcher/Shell/EntryHandlers/LaunchEntryHandlers.cs
2026-05-31 19:41:10 +08:00

31 lines
977 B
C#

using Avalonia.Controls.ApplicationLifetimes;
using LanMountainDesktop.Launcher.Views;
namespace LanMountainDesktop.Launcher.Shell.EntryHandlers;
internal static class LaunchEntryHandler
{
public static SplashWindow CreateSplashWindow()
{
var window = new SplashWindow();
try
{
var appRoot = Commands.ResolveAppRoot(LauncherRuntimeContext.Current);
var versionInfo = new DeploymentLocator(appRoot).GetVersionInfo();
window.SetVersionInfo(versionInfo.Version, versionInfo.Codename);
}
catch (Exception ex)
{
Logger.Warn($"Failed to set splash version info: {ex.Message}");
}
return window;
}
public static Task RunAsync(
IClassicDesktopStyleApplicationLifetime desktop,
CommandContext context,
SplashWindow splashWindow) =>
LauncherCompositionRoot.RunOrchestratorWithSplashAsync(desktop, context, splashWindow);
}