mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 00:16:50 +00:00
Improved error handling as requested.
This commit is contained in:
parent
63aee03969
commit
f2b86cd5a0
@ -189,20 +189,30 @@ void LegitimacyCheck() {
|
|||||||
"snap/steam/common/.local/share/Steam/steamapps" // snap
|
"snap/steam/common/.local/share/Steam/steamapps" // snap
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::filesystem::path steamappsPath;
|
||||||
std::filesystem::path libraryFoldersPath;
|
std::filesystem::path libraryFoldersPath;
|
||||||
|
bool steamappsFolderFound = false;
|
||||||
bool libraryFoldersFound = false;
|
bool libraryFoldersFound = false;
|
||||||
|
|
||||||
for (const auto& path : steamappsCommonPaths) {
|
for (const auto& path : steamappsCommonPaths) {
|
||||||
std::filesystem::path fullPath = homeDir / path / "libraryfolders.vdf";
|
steamappsPath = homeDir / path;
|
||||||
if (std::filesystem::exists(fullPath)) {
|
if (std::filesystem::exists(steamappsPath)) {
|
||||||
libraryFoldersPath = fullPath;
|
steamappsFolderFound = true;
|
||||||
libraryFoldersFound = true;
|
libraryFoldersPath = steamappsPath / "libraryfolders.vdf";
|
||||||
break;
|
if (std::filesystem::exists(libraryFoldersPath)) {
|
||||||
|
libraryFoldersPath = libraryFoldersPath;
|
||||||
|
libraryFoldersFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!steamappsFolderFound) {
|
||||||
|
error("Unsupported Steam installation.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!libraryFoldersFound) {
|
if (!libraryFoldersFound) {
|
||||||
error("Did not find a valid path to a libraryfolders.vdf file.");
|
error("libraryfolders.vdf is missing.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user