private void updatechecker_DoWork(object sender, DoWorkEventArgs e) { string url = "http://deathsnacks.tk/dota2/mist_update.txt"; string response = Util.HTTPRequest(url); if (response != "") { var strings = response.Split('\n'); if (strings.Length < 2) { return; } string latestVer = strings[0]; if (Properties.Settings.Default.SkipUpdate && Properties.Settings.Default.SkippedVersion != latestVer.Trim()) { Properties.Settings.Default.SkipUpdate = false; Properties.Settings.Default.Save(); string[] changelog = strings.Skip(1).ToArray(); if (!string.IsNullOrEmpty(string.Join("\r\n", changelog))) { Updater updater = new Updater(latestVer, string.Join("\r\n", changelog), log); updater.ShowDialog(); updater.Activate(); } } else if (!Properties.Settings.Default.SkipUpdate && latestVer.Trim() != Friends.mist_ver) { string[] changelog = strings.Skip(1).ToArray(); if (!string.IsNullOrEmpty(string.Join("\r\n", changelog))) { Updater updater = new Updater(latestVer, string.Join("\r\n", changelog), log); updater.ShowDialog(); updater.Activate(); } } else { } } }
private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e) { string url = "http://www.thectscommunity.com/dev/update_check.php"; string response = Util.HTTPRequest(url); if (response != "") { string latestVer = Util.ParseBetween(response, "<version>", "</version>"); if (latestVer != Friends.mist_ver) { string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false); if (!string.IsNullOrEmpty(changelog[0])) { Updater updater = new Updater(latestVer, changelog[0], bot.log); updater.ShowDialog(); updater.Activate(); } } else { MessageBox.Show("Congratulations, Mist is up-to-date! Thank you for using Mist :)", "Latest Version", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("Failed to connect to the update server! Please try again later.", "Update Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
private void updatechecker_DoWork(object sender, DoWorkEventArgs e) { string response = SteamTrade.SteamWeb.Fetch(Util.UpdateCheckUrl); if (response != "") { string latestVer = Util.ParseBetween(response, "<version>", "</version>"); if (Properties.Settings.Default.SkipUpdate && Properties.Settings.Default.SkippedVersion != latestVer.Trim()) { Properties.Settings.Default.SkipUpdate = false; Properties.Settings.Default.Save(); string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false); if (!string.IsNullOrEmpty(changelog[0])) { Updater updater = new Updater(latestVer, changelog[0], log); updater.ShowDialog(); updater.Activate(); } } else if (!Properties.Settings.Default.SkipUpdate && latestVer.Trim() != Friends.MistVersion) { string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false); if (!string.IsNullOrEmpty(changelog[0])) { Updater updater = new Updater(latestVer, changelog[0], log); updater.ShowDialog(); updater.Activate(); } } else { } } }
private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e) { string response = SteamTrade.SteamWeb.Fetch(Util.UpdateCheckUrl); if (response != "") { string latestVer = Util.ParseBetween(response, "<version>", "</version>"); if (latestVer != Friends.MistVersion) { string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false); if (!string.IsNullOrEmpty(changelog[0])) { Updater updater = new Updater(latestVer, changelog[0], bot.log); updater.ShowDialog(); updater.Activate(); } } else { MetroFramework.MetroMessageBox.Show(this, "Congratulations, Mist is up-to-date! Thank you for using Mist :)", "Latest Version", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } } else { MetroFramework.MetroMessageBox.Show(this, "Failed to connect to the update server! Please try again later.", "Update Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
private void updatechecker_DoWork(object sender, DoWorkEventArgs e) { string url = "http://www.thectscommunity.com/dev/update_check.php"; string response = Util.HTTPRequest(url); if (response != "") { string latestVer = Util.ParseBetween(response, "<version>", "</version>"); if (Properties.Settings.Default.SkipUpdate && Properties.Settings.Default.SkippedVersion != latestVer.Trim()) { Properties.Settings.Default.SkipUpdate = false; Properties.Settings.Default.Save(); string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false); if (!string.IsNullOrEmpty(changelog[0])) { Updater updater = new Updater(latestVer, changelog[0], log); updater.ShowDialog(); updater.Activate(); } } else if (!Properties.Settings.Default.SkipUpdate && latestVer.Trim() != Friends.mist_ver) { string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false); if (!string.IsNullOrEmpty(changelog[0])) { Updater updater = new Updater(latestVer, changelog[0], log); updater.ShowDialog(); updater.Activate(); } } else { } } }