public void CheckForUpdates() { try { // Set Main Wiwndow Title and update global strings. string text = FetchBbsVersion(out WWIV_Version, out WWIV_Build); // HERE FOR UPDATE CheckUpdates instance = new CheckUpdates(); instance.UpdateHeartbeat(); } catch (Exception ex) { MessageBox.Show("The Following Error Occured: " + ex); } }
public void MainForm_Load(object sender, EventArgs e) { notifyIcon1.Text = "WWIV Telnet Server: Offline"; // Launch Telnet Server on Startup if (Properties.Settings.Default.autostart) { Console.WriteLine("AutoStarting Server."); startToolStripMenuItem_Click(sender, e); } // Launch Local Node of Startup if (Properties.Settings.Default.launchLocalNodeAtStartup) { Console.WriteLine("AutoStarting Local Node."); runLocalNodeToolStripMenuItem_Click(sender, e); } // Launch binkp.cmd for WWIVNet on Startup if (Properties.Settings.Default.launchNetworkAtStartup) { Console.WriteLine("AutoStarting WWIVNet."); ProcessStartInfo binkP = new ProcessStartInfo("binkp.cmd"); binkP.WindowStyle = ProcessWindowStyle.Minimized; Process.Start(binkP); } // Fetch Current WWIV Version And Build Number Process p = new Process(); string bbsExe = Properties.Settings.Default.executable; p.StartInfo.FileName = bbsExe; p.StartInfo.Arguments = "-V"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); char[] delimiter = { '[', '.', ']' }; string currentVersion = output; string[] partsVersion; partsVersion = currentVersion.Split(delimiter); string majorVersion = partsVersion[1]; string minorVersion = partsVersion[2]; string buildVersion = partsVersion[3]; string revisVersion = partsVersion[4]; string displayVersion; displayVersion = (majorVersion + "." + minorVersion + "." + buildVersion + "." + revisVersion); string currentFullVersion; currentFullVersion = "WWIV5 Telnet Server - Running WWIV: " + displayVersion; // Set Main Wiwndow Title Text = currentFullVersion; // Update Global Strings WWIV_Version = displayVersion; WWIV_Build = revisVersion; // HERE FOR UPDATE CheckUpdates instance = new CheckUpdates(); instance.UpdateHeartbeat(); }