3 Commits
v2.6.2 ... 193

Author SHA1 Message Date
Tixx
db1aad37a8 Change and debug CreateProcessW params 2025-09-23 22:40:36 +02:00
Tixx
c03b1d5946 Bump version to v2.6.3 2025-09-17 09:20:21 +02:00
Tixx
5e73c7bce2 Check outdated registry entry for GameDir 2025-09-17 09:19:50 +02:00
3 changed files with 31 additions and 2 deletions

View File

@@ -148,7 +148,13 @@ void StartGame(std::wstring Dir) {
debug(L"BeamNG executable path: " + Dir); debug(L"BeamNG executable path: " + Dir);
bSuccess = CreateProcessW(nullptr, (wchar_t*)(Dir + gameArgs).c_str(), nullptr, nullptr, TRUE, 0, nullptr, BaseDir.c_str(), &si, &pi); wchar_t* lpApplicationName = Dir.data();
wchar_t* lpCommandLine = (Dir + gameArgs).data();
debug(L"lpApplicationName: " + std::wstring(lpApplicationName));
debug(L"lpCommandLine: " + std::wstring(lpCommandLine));
bSuccess = CreateProcessW(lpApplicationName, lpCommandLine, nullptr, nullptr, TRUE, 0, nullptr, BaseDir.c_str(), &si, &pi);
if (bSuccess) { if (bSuccess) {
info("Game Launched!"); info("Game Launched!");
GamePID = pi.dwProcessId; GamePID = pi.dwProcessId;

View File

@@ -197,6 +197,29 @@ void LegitimacyCheck() {
lowExit(5); lowExit(5);
} }
} }
} else {
std::wstring Result;
std::string K3 = R"(Software\BeamNG\BeamNG.drive)";
HKEY hKey;
LONG dwRegOPenKey = OpenKey(HKEY_CURRENT_USER, K3.c_str(), &hKey);
if (dwRegOPenKey == ERROR_SUCCESS) {
Result = QueryKey(hKey, 3);
if (Result.empty()) {
debug("Failed to QUERY key HKEY_CURRENT_USER\\Software\\BeamNG\\BeamNG.drive");
lowExit(6);
}
GameDir = Result;
debug(L"GameDir from registry: " + Result);
} else {
debug("Failed to OPEN key HKEY_CURRENT_USER\\Software\\BeamNG\\BeamNG.drive");
lowExit(7);
}
K3.clear();
Result.clear();
RegCloseKey(hKey);
} }
delete[] appDataPath; delete[] appDataPath;

View File

@@ -87,7 +87,7 @@ std::string GetVer() {
return "2.6"; return "2.6";
} }
std::string GetPatch() { std::string GetPatch() {
return ".2"; return ".3";
} }
beammp_fs_string GetEP(const beammp_fs_char* P) { beammp_fs_string GetEP(const beammp_fs_char* P) {