finding beatsaber installation

This commit is contained in:
mrbesen 2021-06-04 21:47:28 +02:00
parent bd2c91e39a
commit 4dcfcee3dd
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 5 additions and 3 deletions

View File

@ -43,7 +43,7 @@ std::string findBeatsaberInstallation() {
if(!line.empty() && line[0] == '\t') {
int num;
char pathbuffer[512];
int res = sscanf(line.c_str(), "\t\"%d\" \t\"%s\"", &num, pathbuffer);
int res = sscanf(line.c_str(), "\t\"%d\" \t\"%[^\"]512s", &num, pathbuffer);
if(res == 2) {
std::string path(pathbuffer);
paths.push_back(path + "/steamapps/");
@ -52,11 +52,13 @@ std::string findBeatsaberInstallation() {
}
libinfo.close();
std::cout << paths.size() << " steam libs found" << std::endl;
//std::cout << paths.size() << " steam libs found" << std::endl;
//search in libs for beatsaber
for(const std::string& it : paths) {
std::ifstream appmanifest(it + "appmanifest_" + std::to_string(STEAMGAMEID) + ".acf");
const std::string appmani = it + "appmanifest_" + std::to_string(STEAMGAMEID) + ".acf";
//std::cout << "Try to read file: " << appmani << std::endl;
std::ifstream appmanifest(appmani);
if(appmanifest.is_open()) {
//found it!
//do stuff with the manifest???