Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Added support for version.xml in Azure CDN and redondant URL
Browse files Browse the repository at this point in the history
  • Loading branch information
xpouyat committed Nov 8, 2016
1 parent 99ac8eb commit 53e84aa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
30 changes: 16 additions & 14 deletions AMSExplorer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,15 @@ public static string ReturnS(int number)
public static Uri AllReleaseNotesUrl = null;
public static string MessageNewVersion = string.Empty;

public static void CheckAMSEVersion()
public static async void CheckAMSEVersion()
{
var webClient = new WebClient();
webClient.DownloadStringCompleted += DownloadVersionRequestCompleted;
webClient.DownloadStringAsync(new Uri(Constants.GitHubAMSEVersion));
webClient.DownloadStringCompleted += (sender, e) => DownloadVersionRequestCompleted(true, sender, e);
//webClient.DownloadStringCompleted += DownloadVersionRequestCompleted;
webClient.DownloadStringAsync(new Uri(Constants.GitHubAMSEVersionPrimary));
}

public static void DownloadVersionRequestCompleted(object sender, DownloadStringCompletedEventArgs e)
public static void DownloadVersionRequestCompleted(bool firsttry,object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error == null)
{
Expand Down Expand Up @@ -520,13 +521,6 @@ public static void DownloadVersionRequestCompleted(object sender, DownloadString
if (versionAMSEGitHub > versionAMSELocal)
{
MessageNewVersion = string.Format("A new version ({0}) is available on GitHub: {1}", versionAMSEGitHub, Constants.GitHubAMSEReleases);
/* // OLD CODE
if (MessageBox.Show(string.Format("A new version of Azure Media Services Explorer ({0}) is available." + Constants.endline + "Would you like to download it ?", versionAMSEGitHub), "Update available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{ // user selected yes
System.Diagnostics.Process.Start(Constants.GitHubAMSELink);
Environment.Exit(0);
}
*/
var form = new SoftwareUpdate(ReleaseNotesUrl, versionAMSEGitHub, BinaryUrl);
form.ShowDialog();
}
Expand All @@ -536,9 +530,15 @@ public static void DownloadVersionRequestCompleted(object sender, DownloadString

}
}
}

else if( firsttry)
{
var webClient = new WebClient();
webClient.DownloadStringCompleted += (sender2, e2) => DownloadVersionRequestCompleted(false, sender2, e2);

webClient.DownloadStringAsync(new Uri(Constants.GitHubAMSEVersionSecondary));
;
}
}



Expand Down Expand Up @@ -897,7 +897,9 @@ static UInt32 GetBrowserEmulationMode()

public class Constants
{
public const string GitHubAMSEVersion = "https://raw.githubusercontent.com/Azure/Azure-Media-Services-Explorer/master/version.xml";
public const string GitHubAMSEVersionPrimary = "https://amsexplorer.azureedge.net/release/version.xml";
public const string GitHubAMSEVersionSecondary = "https://raw.githubusercontent.com/Azure/Azure-Media-Services-Explorer/master/version.xml";

public const string GitHubAMSEReleases = "https://github.com/Azure/Azure-Media-Services-Explorer/releases";
public const string GitHubAMSELink = "http://aka.ms/amse";

Expand Down
4 changes: 2 additions & 2 deletions AMSExplorer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.44.5.0")]
[assembly: AssemblyFileVersion("3.44.5.0")]
[assembly: AssemblyVersion("3.44.6.0")]
[assembly: AssemblyFileVersion("3.44.6.0")]
4 changes: 2 additions & 2 deletions SetupAMSExplorer/SetupAMSExplorer.isl
Original file line number Diff line number Diff line change
Expand Up @@ -4469,9 +4469,9 @@ UwBpAG4AZwBsAGUASQBtAGEAZwBlAAEARQB4AHAAcgBlAHMAcwA=
<row><td>PROGMSG_IIS_ROLLBACKVROOTS</td><td>##IDS_PROGMSG_IIS_ROLLBACKVROOTS##</td><td/></row>
<row><td>PROGMSG_IIS_ROLLBACKWEBSERVICEEXTENSIONS</td><td>##IDS_PROGMSG_IIS_ROLLBACKWEBSERVICEEXTENSIONS##</td><td/></row>
<row><td>PROGRAMFILETOLAUNCHATEND</td><td>[INSTALLDIR]AMSExplorer.Primary output</td><td/></row>
<row><td>ProductCode</td><td>{53F49A26-A39E-40B6-858F-FF55B868F4AB}</td><td/></row>
<row><td>ProductCode</td><td>{FB81C486-6ADE-43FE-B08B-F4FF430009A8}</td><td/></row>
<row><td>ProductName</td><td>Azure Media Services Explorer</td><td/></row>
<row><td>ProductVersion</td><td>3.44.5.0</td><td/></row>
<row><td>ProductVersion</td><td>3.44.6.0</td><td/></row>
<row><td>ProgressType0</td><td>install</td><td/></row>
<row><td>ProgressType1</td><td>Installing</td><td/></row>
<row><td>ProgressType2</td><td>installed</td><td/></row>
Expand Down

0 comments on commit 53e84aa

Please sign in to comment.