/// <summary>
/// Checks if a BuildTools.jar exists, and if it exists, which version it is. It then checks the api on jenkins to see if
/// there is a newer version available. If there is, or if a BuildTools.jar does not exist, this method will return true.
/// Returns false if no update is needed.
/// </summary>
/// <returns>True if an update is needed.</returns>
public bool CheckUpdate(out bool bad)
{
bad = false;
if (!GetJson())
{
bad = true;
return(false);
}
if (File.Exists(Dir + (string)_json["buildTools"]["name"]))
{
int number = (int)_api["number"];
bool success = GetBuildNumberFromJar(out int currentBuildNumber);
if (success)
{
bool update = currentBuildNumber < number;
if (update)
{
_form.AppendText("BuildTools is out of date");
}
return(update);
}
}
else
{
_form.AppendText("BuildTools does not exist");
}
return(true);
}