예제 #1
0
        public UpdatePopup(string LatestLauncherBuild)
        {
            if (FileSettingsSave.IgnoreVersion == LatestLauncherBuild)
            {
                //No Update Popup
            }
            else
            {
                InitializeComponent();
                SetVisuals();

                ChangelogText.Text = new WebClient().DownloadString(Self.mainserver + "/launcher/changelog");
                ChangelogText.Select(0, 0);
                ChangelogText.SelectionLength = 0;
                ChangelogText.TabStop         = false;

                Bitmap bitmap1 = Bitmap.FromHicon(SystemIcons.Information.Handle);
                UpdateIcon.Image = bitmap1;

                UpdateText.Text = "An update is available. Would you like to update?\nYour version: " + Application.ProductVersion + "\nUpdated version: " + LatestLauncherBuild;

                this.UpdateButton.DialogResult = DialogResult.OK;
                this.IgnoreButton.DialogResult = DialogResult.Cancel;
                this.SkipButton.DialogResult   = DialogResult.Ignore;
            }
        }
예제 #2
0
        public UpdatePopup()
        {
            DiscordLauncherPresence.Status("Start Up", "New Version Is Available: " + LauncherUpdateCheck.LatestLauncherBuild);
            InitializeComponent();
            SetVisuals();

            if (VisualsAPIChecker.GitHubAPI)
            {
                try
                {
                    ChangelogText.Text = (EnableInsiderDeveloper.Allowed() || EnableInsiderBetaTester.Allowed()) ?
                                         JsonConvert.DeserializeObject <List <GitHubRelease> >(LauncherUpdateCheck.VersionJSON)[0].Body.Replace("\r", Environment.NewLine) :
                                         JsonConvert.DeserializeObject <GitHubRelease>(LauncherUpdateCheck.VersionJSON).Body.Replace("\r", Environment.NewLine);
                }
                catch (Exception Error)
                {
                    LogToFileAddons.OpenLog("Update Popup", null, Error, null, true);
                    ChangelogText.Text = "\n" + Error.Message;
                    ChangelogBox.Text  = "Changelog Error:";
                }
            }
            else
            {
                ChangelogText.Text = "\nUnable to Retrieve Changelog";
                ChangelogBox.Text  = "Changelog Error:";
            }

            ChangelogText.Select(0, 0);
            ChangelogText.SelectionLength = 0;
            ChangelogText.TabStop         = false;

            Bitmap bitmap1 = Bitmap.FromHicon(SystemIcons.Information.Handle);

            UpdateIcon.Image = bitmap1;

            UpdateText.Text = "An update is available. Would you like to update?\nYour version: " + Application.ProductVersion +
                              "\nUpdated version: " + LauncherUpdateCheck.LatestLauncherBuild;

            this.UpdateButton.DialogResult = DialogResult.OK;
            this.IgnoreButton.DialogResult = DialogResult.Cancel;
            this.SkipButton.DialogResult   = DialogResult.Ignore;
        }