mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-08-16 16:27:15 +00:00
fix windows build and implement suggestion from lionkor
This commit is contained in:
parent
29445f65ce
commit
a714dc3188
@ -42,10 +42,14 @@ std::string GetGamePath() {
|
|||||||
if (Path.empty()) {
|
if (Path.empty()) {
|
||||||
sk = R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)";
|
sk = R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)";
|
||||||
openRes = RegOpenKeyEx(HKEY_CURRENT_USER, sk, 0, KEY_ALL_ACCESS, &hKey);
|
openRes = RegOpenKeyEx(HKEY_CURRENT_USER, sk, 0, KEY_ALL_ACCESS, &hKey);
|
||||||
if (openRes == ERROR_SUCCESS) goto GotAppDataDir;
|
if (openRes != ERROR_SUCCESS) {
|
||||||
openRes = RegOpenKeyEx(HKEY_CURRENT_USER, sk.insert(51, "User "), 0, KEY_ALL_ACCESS, &hKey);
|
sk = R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders)";
|
||||||
if (openRes != ERROR_SUCCESS) fatal("Cannot get Local Appdata directory");
|
openRes = RegOpenKeyEx(HKEY_CURRENT_USER, sk, 0, KEY_ALL_ACCESS, &hKey);
|
||||||
GotAppDataDir:
|
}
|
||||||
|
if (openRes != ERROR_SUCCESS) {
|
||||||
|
fatal("Cannot get Local Appdata directory");
|
||||||
|
}
|
||||||
|
|
||||||
Path = QueryKey(hKey, 5);
|
Path = QueryKey(hKey, 5);
|
||||||
Path += "\\BeamNG.drive\\";
|
Path += "\\BeamNG.drive\\";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user