diff --git a/TwitchDownloaderWPF/Extensions/VersionExtensions.cs b/TwitchDownloaderWPF/Extensions/VersionExtensions.cs new file mode 100644 index 00000000..f461f9fb --- /dev/null +++ b/TwitchDownloaderWPF/Extensions/VersionExtensions.cs @@ -0,0 +1,9 @@ +using System; + +namespace TwitchDownloaderWPF.Extensions +{ + public static class VersionExtensions + { + public static Version StripRevisionIfDefault(this Version version) => version.Revision < 1 ? new Version(version.Major, version.Minor, version.Build) : version; + } +} \ No newline at end of file diff --git a/TwitchDownloaderWPF/MainWindow.xaml.cs b/TwitchDownloaderWPF/MainWindow.xaml.cs index 008ca79b..d99f7f5b 100644 --- a/TwitchDownloaderWPF/MainWindow.xaml.cs +++ b/TwitchDownloaderWPF/MainWindow.xaml.cs @@ -90,7 +90,8 @@ private async void Window_Loaded(object sender, RoutedEventArgs e) // it will sometimes start behind other windows, usually (but not always) due to the user's actions. FlashTaskbarIconIfNotForeground(TimeSpan.FromSeconds(3)); - var currentVersion = Assembly.GetExecutingAssembly().GetName().Version!; + // Despite not specifying a revision in the AssemblyVersion, the compiler still adds one. We don't want that. + var currentVersion = Assembly.GetExecutingAssembly().GetName().Version!.StripRevisionIfDefault(); #if DEBUG Title = $"Twitch Downloader v{currentVersion} - DEBUG"; #else