Example #1
0
        public bool CheckForUpdate(bool includePrerelease)
        {
            Release latestRelease = GetLatestRelease(includePrerelease);

            if (latestRelease != null && latestRelease.Version > CurrentVersion)
            {
                UpdateAvailableForm form = new UpdateAvailableForm(latestRelease, CurrentVersion);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        latestRelease.InitiateDownload();
                        Environment.Exit(0);
                    }
                    catch
                    {
                        MessageBox.Show(
                            "Failed to initiate download. Please check you have an active Internet connection and try again.",
                            "Update error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
Example #2
0
        public bool CheckForUpdate(bool includePrerelease)
        {
            Release latestRelease = GetLatestRelease(includePrerelease);

            if (latestRelease != null && latestRelease.Version > CurrentVersion)
            {
                UpdateAvailableForm form = new UpdateAvailableForm(latestRelease, CurrentVersion);
                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    try
                    {
                        latestRelease.InitiateDownload();
                        Environment.Exit(0);
                    }
                    catch
                    {
                        MessageBox.Show(
                            "Failed to initiate download. Please check you have an active Internet connection and try again.",
                            "Update error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }


                }
                else
                {
                    return true;
                }
            }

            return false;
        }