private void CheckForUpdate()

in Source/Program.cs [509:546]


        private void CheckForUpdate()
        {
            if (updateCheck)
                return;

            updateCheck = true;

            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"http://aka.ms/livematrixversion");
                request.AllowAutoRedirect = false;

                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                if (response.StatusCode == HttpStatusCode.Moved)
                {
                    const string versionParamName = "version=";

                    string location = response.Headers["Location"];
                    int index = location.IndexOf(versionParamName, StringComparison.OrdinalIgnoreCase);

                    string parsedVersion = location.Substring(index + versionParamName.Length);
                    Version latestVersion = new Version(parsedVersion);

                    if (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version < latestVersion)
                    {
                        MessageBox.Show("You are not running the latest version of XboxLiveResiliencyPluginForFiddler. Please download the latest version from GDNP.");
                    }
                    else
                    {
                        ChangeStatusText("Running the latest version of XboxLiveResiliencyPluginForFiddler: " + latestVersion.ToString());
                    }
                }
            }
            catch (Exception)
            {
                // Empty
            }
        }