diff --git a/changelog.md b/changelog.md index 82e46f5..933d9fa 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,12 @@ ## AniMoe Version 0.0.2 +### Fixes: +- Fixed the Navigation Pane where it breaks the ui when the window is maximized. + ### What's new? - Added a new installer (animoe_setup.exe) where you can install AniMoe without using any scripts. -- Testing out the automatic updator function. -- Some packages bumped. +- Added a new In-App updater feature. +- Both AniMoe.msix and animoe_setup.exe are now signed with a proper certificate. +- Bumped some packages to latest version. [GitHub](https://github.com/CosmicPredator/AniMoe) | [Download](https://github.com/CosmicPredator/AniMoe/releases/latest/) \ No newline at end of file diff --git a/src/AniMoe.App/AniMoe.App.csproj b/src/AniMoe.App/AniMoe.App.csproj index a1396d8..809542b 100644 --- a/src/AniMoe.App/AniMoe.App.csproj +++ b/src/AniMoe.App/AniMoe.App.csproj @@ -16,7 +16,7 @@ Window-Icon.ico 10.0.19041.0 False - False + True False E:\Notes\ False @@ -25,6 +25,8 @@ E:\fonts 0 x64 + 34FD2A46959D50DE9A7A7899E5DDF7A3C6F7CC79 + SHA256 diff --git a/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml b/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml index 269e701..a86d95e 100644 --- a/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml +++ b/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml @@ -21,62 +21,66 @@ - + + - - - - - - - - - - - - - - - - - + + + + - - + Style="{ThemeResource TitleTextBlockStyle}" + Text="Update Available!" /> - + Grid.Row="1" + Orientation="Vertical" + Spacing="5"> + + + + + + + + + + + Margin="0,10,0,0" + FontSize="17" + FontWeight="Medium" + Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" + Text="Changelog:" /> + + + + + + + - - + + diff --git a/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml.cs b/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml.cs index 6ffa9f9..e8145cc 100644 --- a/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml.cs +++ b/src/AniMoe.App/Controls/SettingsViewControls/UpdateDialog.xaml.cs @@ -20,6 +20,7 @@ namespace AniMoe.App.Controls.SettingsViewControls public sealed partial class UpdateDialog : ContentDialog { public GithubModel Model; + public Uri AssetUrl; public UpdateDialog(GithubModel model) { this.InitializeComponent(); @@ -27,24 +28,20 @@ public UpdateDialog(GithubModel model) DataContext = this; } - private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { args.Cancel = true; - foreach(var i in Model.Assets) - { - if (i.Name.Contains(".msix")) - { - Debug.WriteLine(i.Name); - Debug.WriteLine(i.Size); - Debug.WriteLine(i.BrowserDownloadUrl); - } - } + LoaderStackPanel.Visibility = Visibility.Visible; + await new UpdateService().UpdateAniMoe(AssetUrl); + LoaderStackPanel.Visibility = Visibility.Collapsed; } private void ContentDialog_Loaded(object sender, RoutedEventArgs e) { + var selectedMsix = Model.Assets.First(x => x.Name.Contains(".msix")); + AssetUrl = selectedMsix.BrowserDownloadUrl; double assetSize = Math.Round( - (Model.Assets.First(x => x.Name.Contains(".msix")).Size * 0.000001), 2); + (selectedMsix.Size * 0.000001), 2); SizeTextBlock.Text = $"{assetSize}MB"; } diff --git a/src/AniMoe.App/Controls/UserViewControls/UserOverviewPage.xaml b/src/AniMoe.App/Controls/UserViewControls/UserOverviewPage.xaml index 5bdbb14..20939ab 100644 --- a/src/AniMoe.App/Controls/UserViewControls/UserOverviewPage.xaml +++ b/src/AniMoe.App/Controls/UserViewControls/UserOverviewPage.xaml @@ -136,8 +136,8 @@ + diff --git a/src/AniMoe.App/ViewModels/UpdateViewModel.cs b/src/AniMoe.App/ViewModels/UpdateViewModel.cs index 5ddec06..3caf71d 100644 --- a/src/AniMoe.App/ViewModels/UpdateViewModel.cs +++ b/src/AniMoe.App/ViewModels/UpdateViewModel.cs @@ -42,7 +42,7 @@ private async Task runRequest() LoaderState = true; Model = await handler.CheckLatestRelease(); LoaderState = false; - if (Model.TagName.CompareTo(CurrentAppVersion) < 0) + if (Model.TagName.CompareTo(CurrentAppVersion) > 0) { _dispatcherQueue.TryEnqueue(async () => { diff --git a/src/AniMoe.App/Views/MasterView.xaml.cs b/src/AniMoe.App/Views/MasterView.xaml.cs index 840394a..3171938 100644 --- a/src/AniMoe.App/Views/MasterView.xaml.cs +++ b/src/AniMoe.App/Views/MasterView.xaml.cs @@ -118,7 +118,7 @@ private void RepositionTitleBar() } else { - MasterNavView.PaneDisplayMode = NavigationViewPaneDisplayMode.Left; + MasterNavView.PaneDisplayMode = NavigationViewPaneDisplayMode.LeftCompact; } } } diff --git a/src/AniMoe.Updater/Entry.cs b/src/AniMoe.Updater/Entry.cs index 419a8f2..6776d46 100644 --- a/src/AniMoe.Updater/Entry.cs +++ b/src/AniMoe.Updater/Entry.cs @@ -8,15 +8,15 @@ namespace AniMoe.Updater { - public class Entry + public class UpdateService { - public async Task UpdateAniMoe() + public async Task UpdateAniMoe(Uri assetUrl) { uint res = ReopenHandler.RegisterApplicationRestart(null, ReopenHandler.RestartFlags.NONE); PackageManager pm = new(); var data = await pm.UpdatePackageAsync( - new Uri("https://i-will-do.with-your.mom/r/AniMoe.App_0.0.2.102_x64.msix"), + assetUrl, null, DeploymentOptions.ForceApplicationShutdown ); diff --git a/src/AniMoe.Updater/UpdateHandler.cs b/src/AniMoe.Updater/UpdateHandler.cs index 7de0220..d11f487 100644 --- a/src/AniMoe.Updater/UpdateHandler.cs +++ b/src/AniMoe.Updater/UpdateHandler.cs @@ -25,13 +25,9 @@ public UpdateHandler(HttpClient httpClient) Package.Current.Id.Version.Minor, Package.Current.Id.Version.Build); - // It's a read-only access token. So, You can't do anything but reading public repos - _accessToken = - "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"; _baseUrl = @"https://api.github.com/repos/CosmicPredator/AniMoe/releases/latest"; _httpClient.DefaultRequestHeaders.Add("Accept", "application/vnd.github+json"); - _httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {_accessToken}"); _httpClient.DefaultRequestHeaders.Add("X-GitHub-Api-Version", "2022-11-28"); _httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0");