diff --git a/App/Configuration/ConfigService.cs b/App/Configuration/ConfigService.cs index b0ee61f8..708acb58 100644 --- a/App/Configuration/ConfigService.cs +++ b/App/Configuration/ConfigService.cs @@ -47,6 +47,11 @@ public sealed partial class ConfigService : GeneralService /// 本地配置文件路径。 /// public static string LocalConfigPath { get; } = Path.Combine(FileService.DataPath, "config.v1.yml"); + + /// + /// 自定义主页文件路径。 + /// + public static string CustomPagePath { get; } = Path.Combine(FileService.DataPath, "Custom_CE.xaml"); #region Getters & Setters @@ -192,6 +197,21 @@ private static void _InitializeProviders() return trafficCenter; } }; + }, + () => // custom page file + { + // try migrate + if (!File.Exists(CustomPagePath)) + { + _TryMigrate(CustomPagePath, [ + new ConfigMigration + { + From = Path.Combine(FileService.DataPath, "Custom.xaml"), + To = CustomPagePath, + OnMigration = XamlMigration + } + ]); + } } ]; try { Task.WaitAll(inits.Select(Task.Run).ToArray()); } @@ -202,6 +222,10 @@ void SharedJsonMigration(string from, string to) { File.Copy(from, to); } + void XamlMigration(string from, string to) + { + File.Copy(from, to); + } void CatIniMigration(string from, string to) { var lines = File.ReadAllLines(from);