From 5da17d48813ab515a100706f1236ef7edc358ead Mon Sep 17 00:00:00 2001 From: clovett Date: Sun, 7 Jul 2024 21:09:23 -0700 Subject: [PATCH] Fix install button on changes report. --- Source/WPF/MoneyPackage/Package.appxmanifest | 2 +- Source/WPF/MyMoney/MainWindow.xaml.cs | 21 +++++++++++++++---- .../PublishProfiles/ClickOnceProfile.pubxml | 4 ++-- Source/WPF/MyMoney/Setup/changes.xml | 3 ++- Source/WPF/Version/Version.cs | 4 ++-- Source/WPF/Version/Version.props | 4 ++-- Source/WPF/Version/VersionMaster.txt | 2 +- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Source/WPF/MoneyPackage/Package.appxmanifest b/Source/WPF/MoneyPackage/Package.appxmanifest index 43909838..593de892 100644 --- a/Source/WPF/MoneyPackage/Package.appxmanifest +++ b/Source/WPF/MoneyPackage/Package.appxmanifest @@ -1,6 +1,6 @@  - + MyMoney.Net Chris Lovett diff --git a/Source/WPF/MyMoney/MainWindow.xaml.cs b/Source/WPF/MyMoney/MainWindow.xaml.cs index 80866886..2d59ab03 100644 --- a/Source/WPF/MyMoney/MainWindow.xaml.cs +++ b/Source/WPF/MyMoney/MainWindow.xaml.cs @@ -4551,10 +4551,6 @@ private void OnChangeListRequestCompleted(object sender, SetupRequestEventArgs e this.ButtonShowUpdateInfoCaption.Text = "View Updates"; this.ButtonShowUpdateInfo.Visibility = System.Windows.Visibility.Visible; } - if (changes != null) - { - Task.Run(() => this.SaveCachedChangeList(changes)); - } // and see if we just installed a new version. string exe = ProcessHelper.MainExecutable; @@ -4568,6 +4564,21 @@ private void OnChangeListRequestCompleted(object sender, SetupRequestEventArgs e this.settings.LastExeTimestamp = lastWrite; this.ShowChangeInfo(previous, changes, e.NewVersionAvailable); } + + if (changes != null) + { + Task.Run(() => this.SaveCachedChangeList(changes)); + } + + } + + private string GetMinimumVersion(string version1, string version2) + { + if (Version.TryParse(version1, out Version v1) && Version.TryParse(version2, out Version v2) && v1 > v2) + { + return version2; + } + return version1; } private void OnButtonShowUpdateInfoClick(object sender, RoutedEventArgs e) @@ -4578,6 +4589,8 @@ private void OnButtonShowUpdateInfoClick(object sender, RoutedEventArgs e) private void ShowChangeInfo(string previousVersion, XDocument changeList, bool installButton) { + previousVersion = this.GetMinimumVersion(previousVersion, this.settings.ExeVersion); + if (changeList == null) { changeList = this.GetCachedChangeList(); diff --git a/Source/WPF/MyMoney/Properties/PublishProfiles/ClickOnceProfile.pubxml b/Source/WPF/MyMoney/Properties/PublishProfiles/ClickOnceProfile.pubxml index 71246d03..910d1f30 100644 --- a/Source/WPF/MyMoney/Properties/PublishProfiles/ClickOnceProfile.pubxml +++ b/Source/WPF/MyMoney/Properties/PublishProfiles/ClickOnceProfile.pubxml @@ -4,8 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - 25 - 2.1.0.25 + 26 + 2.1.0.26 True Release True diff --git a/Source/WPF/MyMoney/Setup/changes.xml b/Source/WPF/MyMoney/Setup/changes.xml index 984fecf8..4845dc20 100644 --- a/Source/WPF/MyMoney/Setup/changes.xml +++ b/Source/WPF/MyMoney/Setup/changes.xml @@ -1,7 +1,8 @@  - + - Add "Export HTML..." to all reports. + - Fix install button. - Add "move" transaction command so you can move a transaction and all it's attachments to a different account. diff --git a/Source/WPF/Version/Version.cs b/Source/WPF/Version/Version.cs index 3b6d2e54..1ee2956a 100644 --- a/Source/WPF/Version/Version.cs +++ b/Source/WPF/Version/Version.cs @@ -6,5 +6,5 @@ // And also sync this with the MSIX package manifest in // ~\MyMoney.Net\Source\WPF\MoneyPackage\Package.appxmanifest -[assembly: AssemblyVersion("2.1.0.25")] -[assembly: AssemblyFileVersion("2.1.0.25")] +[assembly: AssemblyVersion("2.1.0.26")] +[assembly: AssemblyFileVersion("2.1.0.26")] diff --git a/Source/WPF/Version/Version.props b/Source/WPF/Version/Version.props index b42ac02c..772e5378 100644 --- a/Source/WPF/Version/Version.props +++ b/Source/WPF/Version/Version.props @@ -1,7 +1,7 @@  - 25 - 2.1.0.25 + 26 + 2.1.0.26 \ No newline at end of file diff --git a/Source/WPF/Version/VersionMaster.txt b/Source/WPF/Version/VersionMaster.txt index ddb6a1a4..a5e916de 100644 --- a/Source/WPF/Version/VersionMaster.txt +++ b/Source/WPF/Version/VersionMaster.txt @@ -1 +1 @@ -2.1.0.25 \ No newline at end of file +2.1.0.26 \ No newline at end of file