Refactor data location paths and add background service

Refactor DataLocationResolver to centralize data path resolution (ResolveLauncherDataPath, ResolveDesktopDataPath, ResolveConfigPath, ResolveLauncherLogsPath, ResolveLauncherStatePath) and replace usages of the previous ".launcher" layout with a "Launcher" folder. Update API: LoadConfig/SaveConfig reorganized and ApplyLocationChoice now accepts an optional custom path and migration flag; migration logic updated accordingly. Update dependent services and views (Logger, DeploymentLocator, UpdateEngineService, OobeStateService, StartupAttemptRegistry, LauncherDebugSettingsStore, OobeWindow) to use the new resolver APIs and paths. Add LauncherBackgroundService to load/validate/cache a custom splash background image and wire it into SplashWindow (AXAML/Axaml.cs) with UI placeholders and overlay. Misc: minor cleanup of Oobe/Splash XAML and related code adjustments and logging improvements.
This commit is contained in:
lincube
2026-04-25 18:14:29 +08:00
parent 5b4b9f32b5
commit 05ffadd1a0
13 changed files with 381 additions and 143 deletions

View File

@@ -104,7 +104,7 @@ internal static class LauncherDebugSettingsStore
{
var appRoot = Commands.ResolveAppRoot(CommandContext.FromArgs([]));
var resolver = new DataLocationResolver(appRoot);
return Path.Combine(resolver.ResolveDataRoot(), ".launcher");
return resolver.ResolveLauncherDataPath();
}
catch
{
@@ -115,7 +115,7 @@ internal static class LauncherDebugSettingsStore
var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
if (!string.IsNullOrWhiteSpace(appData))
{
return Path.Combine(appData, "LanMountainDesktop", ".launcher");
return Path.Combine(appData, "LanMountainDesktop", "Launcher");
}
}
catch
@@ -124,11 +124,11 @@ internal static class LauncherDebugSettingsStore
try
{
return Path.Combine(AppContext.BaseDirectory, ".launcher");
return Path.Combine(AppContext.BaseDirectory, "Launcher");
}
catch
{
return Path.Combine(Directory.GetCurrentDirectory(), ".launcher");
return Path.Combine(Directory.GetCurrentDirectory(), "Launcher");
}
}
}