| 572 | } |
| 573 | |
| 574 | static std::string FindGameInstallPath(const std::string& steamPath, uint32_t appId) { |
| 575 | for (const auto& libPath : GetSteamLibraryPaths(steamPath)) { |
| 576 | auto manifestPath = libPath / "steamapps" / ("appmanifest_" + std::to_string(appId) + ".acf"); |
| 577 | std::ifstream mf(manifestPath); |
| 578 | if (!mf) continue; |
| 579 | |
| 580 | std::string line; |
| 581 | while (std::getline(mf, line)) { |
| 582 | auto pos = line.find("\"installdir\""); |
| 583 | if (pos == std::string::npos) continue; |
| 584 | auto q1 = line.rfind('"'); |
| 585 | auto q2 = q1 == std::string::npos ? std::string::npos : line.rfind('"', q1 - 1); |
| 586 | if (q1 != std::string::npos && q2 != std::string::npos && q1 > q2) { |
| 587 | auto installDir = line.substr(q2 + 1, q1 - q2 - 1); |
| 588 | return FileUtil::PathToUtf8(libPath / "steamapps" / "common" / FileUtil::Utf8ToPath(installDir)); |
| 589 | } |
| 590 | } |
| 591 | } |
| 592 | return {}; |
| 593 | } |
| 594 | |
| 595 | bool IsAppInstalled(const std::string& steamPath, uint32_t appId) { |
| 596 | return AutoCloudScan::IsAppInstalled(steamPath, appId); |
nothing calls this directly
no test coverage detected