Skip to content
Snippets Groups Projects

SCRUM#87 - Get distro info on Windows

Merged Lais Frigério requested to merge issue/87 into development
2 files
+ 4
14
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 3
5
@@ -155,19 +155,17 @@ std::string get_distro_win() {
try {
cmd = exec("systeminfo");
} catch (std::string err) {
throw std::string("unknown distro");
return err;
}
const std::string key = "Nome do sistema operacional:";
const std::string key = "Microsoft Windows";
std::size_t found;
found = cmd.find(key);
std::istringstream iss(cmd);
while (std::getline(iss, line)) {
found = line.find(key);
if (found != std::string::npos) {
return line.substr(found+key.length()+1,
// remove key
line.length()-(found+key.length()+1));
return line.substr(found);
}
}
} else if (!IsWindowsXPSP1OrGreater()) {
Loading