v3.7.2: überprüfe die neuste Version nach download, wenn zumBeisiel html error in html steht

This commit is contained in:
Markus 2019-11-11 19:36:59 +01:00
parent 0414d3a8aa
commit 732b2d5940
2 changed files with 11 additions and 1 deletions

View File

@ -81,7 +81,7 @@ struct Settings {
proxy_ip = "127.0.0.1",
languages = "GerDub,GerSub,Eng,",
genaueHoster = "",
version = "3.7.1",
version = "3.7.2",
defaultFileVersion="1.6",
outputFilePath = "",
default_checkPath = "",

View File

@ -1059,6 +1059,16 @@ int ProgramManager::updateModus(Settings *settings)
std::string neusteVersion = html.substr(0, html.find("\n"));
html.erase(0, html.find("\n") + 1);

//Überprüfe onb neue Version einen . enthält
if(neusteVersion.find(".") == std::string::npos) {
size_t pos;
if((pos = html.find("h1>")) != std::string::npos)
std::cout << " => Das herunterladen ist fehlgeschlagen: " << html.substr(pos + 3, html.find("</h1>") - pos);
else
std::cout << " => Error: Die neuste Version ist ungültig: '" << neusteVersion << "'." << std::endl;
return -3;
}

//Gib Versionenunterschie aus
std::cout << " => INFO: Jetzige Version: '" << settings->version << "' - Neueste Version: '" << neusteVersion << "'" << std::endl;