mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Improve launcher startup flow, logging, and host resolution. Key changes: add detailed startup logging and standardized preview messages; unify CLI vs GUI handling and error/result reporting (write result file when requested); refactor DeploymentLocator to a more robust host resolution (new HostResolutionResult, explicit/portable/published/debug resolution paths, legacy fallback); overhaul LauncherFlowCoordinator to better handle IPC stages, activation retries, window lifecycle, plugin/update flows and error reporting; add CommandContext helpers (IsGui/IsPreview/ExplicitAppRoot) and JSON context options; tighten async usage and ConfigureAwait calls; add better UI error handling and consistent exit codes. Several UX/debug conveniences and robustness fixes included.
39 lines
875 B
C#
39 lines
875 B
C#
namespace LanMountainDesktop.Shared.Contracts.Launcher;
|
|
|
|
public enum StartupStage
|
|
{
|
|
Initializing,
|
|
LoadingSettings,
|
|
LoadingPlugins,
|
|
InitializingUI,
|
|
ShellInitialized,
|
|
DesktopVisible,
|
|
ActivationRedirected,
|
|
ActivationFailed,
|
|
Ready
|
|
}
|
|
|
|
public record StartupProgressMessage
|
|
{
|
|
public StartupStage Stage { get; init; }
|
|
|
|
public int ProgressPercent { get; init; }
|
|
|
|
public string? Message { get; init; }
|
|
|
|
public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.UtcNow;
|
|
}
|
|
|
|
public static class LauncherIpcConstants
|
|
{
|
|
public const string PipeName = "LanMountainDesktop_Launcher";
|
|
|
|
public const string LauncherPidEnvVar = "LMD_LAUNCHER_PID";
|
|
|
|
public const string PackageRootEnvVar = "LMD_PACKAGE_ROOT";
|
|
|
|
public const string VersionEnvVar = "LMD_VERSION";
|
|
|
|
public const string CodenameEnvVar = "LMD_CODENAME";
|
|
}
|