From 8d9c8539f476aee94c58ab2c683f7bdda31cf8cd Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 31 Oct 2023 20:07:42 +0800 Subject: [PATCH] fix crash due to package path api not available in older windows 10 --- src/MicaApps.Mail.UWP/App.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MicaApps.Mail.UWP/App.xaml.cs b/src/MicaApps.Mail.UWP/App.xaml.cs index 57971b8..9484543 100644 --- a/src/MicaApps.Mail.UWP/App.xaml.cs +++ b/src/MicaApps.Mail.UWP/App.xaml.cs @@ -30,7 +30,8 @@ public App() private async Task InitalizeDatabaseAsync() { - await Services.GetService().Session.ExecuteReaderAsync(await PathIO.ReadTextAsync(Path.Combine(Package.Current.InstalledPath, "Assets", "sql.sql"))); + var path = Package.Current.InstalledLocation.Path; + await Services.GetService().Session.ExecuteReaderAsync(await PathIO.ReadTextAsync(Path.Combine(path, "Assets", "sql.sql"))); } private IServiceProvider RegisterServices()