Skip to content

Commit

Permalink
Added github release details to update pane. fixed udpater fetching l…
Browse files Browse the repository at this point in the history
…owest version.
  • Loading branch information
Mgamerz committed Dec 13, 2017
1 parent 81f7e40 commit 162d68b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 16 additions & 5 deletions AlotAddOnGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,24 @@ private async void RunApplicationUpdater2()
AddonFilesLabel.Text = "Checking for application updates";
var versInfo = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
var client = new GitHubClient(new ProductHeaderValue("ALOTAddonGUI"));
var user = await client.Repository.Release.GetAll("Mgamerz", "ALOTAddonGUI");
if (user.Count > 0)
var releases = await client.Repository.Release.GetAll("Mgamerz", "ALOTAddonGUI");
if (releases.Count > 0)
{
//The release we want to check is always the latest, so [0]
Release latest = null;
foreach (Release r in user)
Version latestVer = new Version("0.0.0.0");
foreach (Release r in releases)
{
if (!USING_BETA && r.Prerelease)
{
continue;
}
latest = r;
Version releaseVersion = new Version(r.TagName);
if (releaseVersion > latestVer)
{
latest = r;
latestVer = releaseVersion;
}
}
if (latest != null)
{
Expand All @@ -419,7 +425,12 @@ private async void RunApplicationUpdater2()
{
versionInfo += "\nThis is a beta build. You are receiving this update because you have opted into Beta Mode in settings.";
}
MessageDialogResult result = await this.ShowMessageAsync("Update Available", "ALOT Addon Builder " + releaseName + " is available.\n" + versionInfo + "\nInstall the update?", MessageDialogStyle.AffirmativeAndNegative);
MetroDialogSettings mds = new MetroDialogSettings();
mds.AffirmativeButtonText = "Update";
mds.NegativeButtonText = "Later";
mds.DefaultButtonFocus = MessageDialogResult.Affirmative;

MessageDialogResult result = await this.ShowMessageAsync("Update Available", "ALOT Addon Builder " + releaseName + " is available.\n========================\n" + versionInfo + "\n"+latest.Body+ "\n========================\nInstall the update?", MessageDialogStyle.AffirmativeAndNegative,mds);
if (result == MessageDialogResult.Affirmative)
{

Expand Down
4 changes: 2 additions & 2 deletions AlotAddOnGUI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[assembly: AssemblyCulture("")]

// Version informationr(
[assembly: AssemblyVersion("2.0.61.428")]
[assembly: AssemblyFileVersion("2.0.61.428")]
[assembly: AssemblyVersion("2.0.71.442")]
[assembly: AssemblyFileVersion("2.0.71.442")]
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]

0 comments on commit 162d68b

Please sign in to comment.