Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
fixed check for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
teocomi committed Aug 27, 2016
1 parent ba569dc commit 384827c
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Bcfier/UserControls/BcfierPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,25 @@ private void CheckUpdates()
return;
string version = release.tag_name.Replace("v", "");
var mine = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
var online = Version.Parse(version);
if (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.CompareTo(Version.Parse(version)) < 0 && release.assets.Any())
if (mine.CompareTo(online) < 0 && release.assets.Any())
{
var dialog = new NewVersion();
dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
dialog.Description.Text = release.name + " has been released on " + release.published_at.ToLongDateString() + "\ndo you want to check it out now?";
//dialog.NewFeatures.Text = document.Element("Bcfier").Element("Changelog").Element("NewFeatures").Value;
//dialog.BugFixes.Text = document.Element("Bcfier").Element("Changelog").Element("BugFixes").Value;
//dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
dialog.ShowDialog();
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
Process.Start(release.assets.First().browser_download_url);
Application.Current.Dispatcher.Invoke((Action)delegate {
var dialog = new NewVersion();
dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
dialog.Description.Text = release.name + " has been released on " + release.published_at.ToLongDateString() + "\ndo you want to check it out now?";
//dialog.NewFeatures.Text = document.Element("Bcfier").Element("Changelog").Element("NewFeatures").Value;
//dialog.BugFixes.Text = document.Element("Bcfier").Element("Changelog").Element("BugFixes").Value;
//dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
dialog.ShowDialog();
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
Process.Start(release.assets.First().browser_download_url);
});
}
}
catch (System.Exception ex1)
Expand Down

0 comments on commit 384827c

Please sign in to comment.