From 8d145bfa0471104ef1e7ec6d0cd65cb27a79c2c0 Mon Sep 17 00:00:00 2001 From: a Date: Thu, 1 Aug 2024 01:05:32 +0300 Subject: [PATCH] don't add backslash at end of steam install path --- tools/steamclient_loader/win/ColdClientLoader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/steamclient_loader/win/ColdClientLoader.cpp b/tools/steamclient_loader/win/ColdClientLoader.cpp index 3845c4f5..f86f98ad 100644 --- a/tools/steamclient_loader/win/ColdClientLoader.cpp +++ b/tools/steamclient_loader/win/ColdClientLoader.cpp @@ -227,7 +227,9 @@ bool patch_registry_hklm() return false; } - const auto my_path = common_helpers::to_wstr(pe_helpers::get_current_exe_path()); + auto path_no_backslash = pe_helpers::get_current_exe_path(); + path_no_backslash = path_no_backslash.substr(0, path_no_backslash.size() - 1); + const auto my_path = common_helpers::to_wstr(path_no_backslash); RegSetValueExW(Registrykey, L"InstallPath", NULL, REG_SZ, (const BYTE*)my_path.c_str(), static_cast((my_path.size() + 1) * sizeof(my_path[0]))); RegSetValueExW(Registrykey, L"SteamPID", NULL, REG_DWORD, (const BYTE *)&ProcessID, sizeof(DWORD)); RegSetValueExW(Registrykey, L"Universe", NULL, REG_SZ, (const BYTE *)STEAM_UNIVERSE, (DWORD)sizeof(STEAM_UNIVERSE));