Fixes for the UpdateService and AboutForm, they were using the wrong version.

This commit is contained in:
Robin 2018-12-13 13:39:52 +01:00
commit f1c8a34a93
3 changed files with 444 additions and 440 deletions

View file

@ -24,6 +24,7 @@
#region Usings #region Usings
using System; using System;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -90,7 +91,8 @@ namespace Greenshot.Components
_coreConfiguration = coreConfiguration; _coreConfiguration = coreConfiguration;
_eventAggregator = eventAggregator; _eventAggregator = eventAggregator;
_updateNotificationViewModelFactory = updateNotificationViewModelFactory; _updateNotificationViewModelFactory = updateNotificationViewModelFactory;
LatestVersion = CurrentVersion = GetType().Assembly.GetName().Version; var version = FileVersionInfo.GetVersionInfo(GetType().Assembly.Location);
LatestVersion = CurrentVersion = new Version(version.FileMajorPart, version.FileMinorPart, version.FileBuildPart);
_coreConfiguration.LastSaveWithVersion = CurrentVersion.ToString(); _coreConfiguration.LastSaveWithVersion = CurrentVersion.ToString();
} }

View file

@ -117,7 +117,7 @@ namespace Greenshot.Forms {
this.linkLblBugs.Size = new System.Drawing.Size(465, 23); this.linkLblBugs.Size = new System.Drawing.Size(465, 23);
this.linkLblBugs.TabIndex = 8; this.linkLblBugs.TabIndex = 8;
this.linkLblBugs.TabStop = true; this.linkLblBugs.TabStop = true;
this.linkLblBugs.Text = "http://getgreenshot.org/tickets/?version=" + Assembly.GetEntryAssembly().GetName().Version; this.linkLblBugs.Text = "http://getgreenshot.org/tickets/?version=" + _versionProvider.CurrentVersion;
this.linkLblBugs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); this.linkLblBugs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked);
// //
// lblBugs // lblBugs
@ -135,7 +135,7 @@ namespace Greenshot.Forms {
this.linkLblDonations.Size = new System.Drawing.Size(465, 23); this.linkLblDonations.Size = new System.Drawing.Size(465, 23);
this.linkLblDonations.TabIndex = 10; this.linkLblDonations.TabIndex = 10;
this.linkLblDonations.TabStop = true; this.linkLblDonations.TabStop = true;
this.linkLblDonations.Text = "http://getgreenshot.org/support/?version=" + Assembly.GetEntryAssembly().GetName().Version; this.linkLblDonations.Text = "http://getgreenshot.org/support/?version=" + _versionProvider.CurrentVersion;
this.linkLblDonations.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); this.linkLblDonations.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked);
// //
// lblDonations // lblDonations

View file

@ -51,6 +51,7 @@ namespace Greenshot.Forms
public sealed partial class AboutForm : AnimatingForm public sealed partial class AboutForm : AnimatingForm
{ {
private readonly IGreenshotLanguage _greenshotlanguage; private readonly IGreenshotLanguage _greenshotlanguage;
private readonly IVersionProvider _versionProvider;
private static readonly LogSource Log = new LogSource(); private static readonly LogSource Log = new LogSource();
// Variables are used to define the location of the dots // Variables are used to define the location of the dots
@ -141,6 +142,7 @@ namespace Greenshot.Forms
) : base(coreConfiguration, greenshotlanguage) ) : base(coreConfiguration, greenshotlanguage)
{ {
_greenshotlanguage = greenshotlanguage; _greenshotlanguage = greenshotlanguage;
_versionProvider = versionProvider;
// Make sure our resources are removed again. // Make sure our resources are removed again.
Disposed += Cleanup; Disposed += Cleanup;
FormClosing += Cleanup; FormClosing += Cleanup;