mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Introduce support for choosing and resolving the application's data root (system user dir vs. portable app folder). Adds DataLocationConfig model, DataLocationResolver (load/save/resolve/migrate), a UI prompt (DataLocationPromptWindow) and an OOBE step (DataLocationOobeStep) to let users pick and optionally migrate existing data. Wire the chosen data root into the launcher flow and host launch plan (forwarded via --data-root and LMD_DATA_ROOT), and add AppDataPathProvider to let runtime services read the effective data root (initialized in Program.Main). Update various services (logging, settings, DB, plugin/market, startup registry, etc.) to use the new provider/resolver and register the config type in the JSON context. This enables portable installs, safe migration, and runtime overrides via CLI or environment variable.
24 lines
474 B
C#
24 lines
474 B
C#
namespace LanMountainDesktop.Launcher.Models;
|
|
|
|
internal enum DataLocationMode
|
|
{
|
|
System,
|
|
Portable
|
|
}
|
|
|
|
internal sealed class DataLocationConfig
|
|
{
|
|
public string DataLocationMode { get; set; } = "System";
|
|
|
|
public string? SystemDataPath { get; set; }
|
|
|
|
public string? PortableDataPath { get; set; }
|
|
}
|
|
|
|
internal sealed class DataLocationPromptResult
|
|
{
|
|
public DataLocationMode SelectedMode { get; init; }
|
|
|
|
public bool MigrateExistingData { get; init; }
|
|
}
|