Run macOS applications on your Windows desktop, with a background runtime and integrated app windows.
C++
#pragma once
#include <sstream>
#include <string>
namespace wsm::runtime {
// Older builds did not write wsm-installing. Recover their last recorded launch,
// but never treat a new VM, a failed installer or account setup as an active install.
inline bool legacy_install_needs_resume(const std::string& log) {
bool pending = false;
std::istringstream input(log); std::string line;
while (std::getline(input, line)) {
if (line.find("[downloading]") != std::string::npos || line.find("[creating]") != std::string::npos ||
line.find("[disk]") != std::string::npos || line.find("[copying]") != std::string::npos ||
line.find("[first_boot]") != std::string::npos || line.find("[finishing]") != std::string::npos ||
line.find("[ready]") != std::string::npos ||
line.find("installer reported an error") != std::string::npos ||
line.find("couldn't start the macOS installation command") != std::string::npos) pending = false;
if (line.find("guest$ ") != std::string::npos && line.find("/Resources/startosinstall") != std::string::npos &&
line.find("--agreetolicense --volume") != std::string::npos) pending = true;
}
return pending;
}
}