/// <summary> /// Returns "true" if an update is available, "false" if one is not and "error" if there was an error. /// String because I need more options. If a new update is available or there was an error it already opens a dialog! /// </summary> /// <returns></returns> public static string CheckForUpdates() { Dictionary <string, string> isNewestVersion = Updates.IsNewestVersion(); if (isNewestVersion["isNewestVersion"] == "false") { bool extraButtonPressed = GetInput.ShowInfoDialog( "Update Available", "An update for this app is currently available.", "You are running " + Software.Type + " " + Software.Version + " and the newest version is " + isNewestVersion["newestVersion"] + ".\nClick the button on the bottom left to upgrade.\n\nNew in version " + isNewestVersion["newestVersion"] + ":\n" + isNewestVersion["changes"], new Button { IsEnabled = true, Text = "Download newest build" }); if (extraButtonPressed) { Process.Start(isNewestVersion["updateUrl"]); } return("true"); } else if (isNewestVersion["isNewestVersion"] == "error") { return("error"); // nothing } else { return("false"); // nothing } }
/// <summary> /// Returns "true" if an update is available, "false" if one is not and "error" if there was an error. /// String because I need more options. If a new update is available or there was an error it already opens a dialog! /// </summary> /// <returns></returns> public static string CheckForUpdates() { Dictionary <string, string> isNewestVersion = Updates.IsNewestVersion(); if (isNewestVersion["isNewestVersion"] == "false") { bool extraButtonPressed = GetInput.ShowInfoDialog( "Update Available", "An update for this app is currently available.", "You are running " + Software.Type + " " + Software.Version + " and the newest version is " + isNewestVersion["newestVersion"] + ".\nClick the button on the bottom left to upgrade.\n\nNew in version " + isNewestVersion["newestVersion"] + ":\n" + isNewestVersion["changes"], new Button { IsEnabled = true, Text = "Download newest build" }); if (extraButtonPressed) { switch (Software.Type) { case "alpha": Process.Start("https://github.com/iamtheyammer/gam-cros-win-wrapper/raw/master/ChromebookGUI/Installer/Tool+Installer/Installer.msi"); break; default: Process.Start("https://github.com/iamtheyammer/releases/latest"); break; } } return("true"); } else if (isNewestVersion["isNewestVersion"] == "error") { return("error"); // nothing } else { return("false"); // nothing } }