mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-25 01:44:15 +08:00
fixed some mistakes + missing reg patch
This commit is contained in:
parent
7feca7f173
commit
0237152b82
@ -304,7 +304,7 @@ bool patch_registry_hkcs()
|
|||||||
void cleanup_registry_hkcs()
|
void cleanup_registry_hkcs()
|
||||||
{
|
{
|
||||||
if (orig_steam_hkcs_2) {
|
if (orig_steam_hkcs_2) {
|
||||||
dbg_log::write("restoring registry entries (HKCU) #1");
|
dbg_log::write("restoring registry entries (HKCS) #1");
|
||||||
HKEY Registrykey = { 0 };
|
HKEY Registrykey = { 0 };
|
||||||
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"steam\\Shell\\Open\\Command", 0, KEY_ALL_ACCESS, &Registrykey) == ERROR_SUCCESS) {
|
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"steam\\Shell\\Open\\Command", 0, KEY_ALL_ACCESS, &Registrykey) == ERROR_SUCCESS) {
|
||||||
RegSetValueExW(Registrykey, L"", NULL, REG_SZ, (const BYTE *)OrgCommand_hkcs, Size1_hkcs);
|
RegSetValueExW(Registrykey, L"", NULL, REG_SZ, (const BYTE *)OrgCommand_hkcs, Size1_hkcs);
|
||||||
@ -315,7 +315,7 @@ void cleanup_registry_hkcs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!orig_steam_hkcs_1) {
|
if (!orig_steam_hkcs_1) {
|
||||||
dbg_log::write("removing registry entries (HKCU) #2 (added by loader)");
|
dbg_log::write("removing registry entries (HKCS) #2 (added by loader)");
|
||||||
HKEY Registrykey = { 0 };
|
HKEY Registrykey = { 0 };
|
||||||
RegDeleteKeyA(HKEY_CLASSES_ROOT, "steam");
|
RegDeleteKeyA(HKEY_CLASSES_ROOT, "steam");
|
||||||
}
|
}
|
||||||
@ -507,10 +507,10 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
|
|||||||
}
|
}
|
||||||
} else { // steam://run/
|
} else { // steam://run/
|
||||||
constexpr const static wchar_t STEAM_LAUNCH_CMD_1[] = L"steam://run/";
|
constexpr const static wchar_t STEAM_LAUNCH_CMD_1[] = L"steam://run/";
|
||||||
constexpr const static wchar_t STEAM_LAUNCH_CMD_2[] = L"run/";
|
constexpr const static wchar_t STEAM_LAUNCH_CMD_2[] = L"-- \"steam://rungameid/";
|
||||||
AppId.clear(); // we don't care about the app id in the ini
|
AppId.clear(); // we don't care about the app id in the ini
|
||||||
std::wstring my_cmd = lpCmdLine && lpCmdLine[0] ? std::wstring(lpCmdLine) : std::wstring();
|
std::wstring my_cmd = lpCmdLine && lpCmdLine[0] ? std::wstring(lpCmdLine) : std::wstring();
|
||||||
dbg_log::write(L"persistent mode 2 detecting steam launch cmd from: " + my_cmd);
|
dbg_log::write(L"persistent mode 2 detecting steam launch cmd from: '" + my_cmd + L"'");
|
||||||
if (my_cmd.find(STEAM_LAUNCH_CMD_1) == 0) {
|
if (my_cmd.find(STEAM_LAUNCH_CMD_1) == 0) {
|
||||||
AppId = my_cmd.substr(sizeof(STEAM_LAUNCH_CMD_1) / sizeof(wchar_t), my_cmd.find_first_of(L" \t"));
|
AppId = my_cmd.substr(sizeof(STEAM_LAUNCH_CMD_1) / sizeof(wchar_t), my_cmd.find_first_of(L" \t"));
|
||||||
dbg_log::write("persistent mode 2 got steam launch cmd #1");
|
dbg_log::write("persistent mode 2 got steam launch cmd #1");
|
||||||
@ -543,6 +543,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
patch_registry_hkcs();
|
||||||
// if (!patch_registry_hkcs()) { // this fails due to admin rights, not a big deal
|
// if (!patch_registry_hkcs()) { // this fails due to admin rights, not a big deal
|
||||||
// cleanup_registry_hkcu();
|
// cleanup_registry_hkcu();
|
||||||
// cleanup_registry_hklm();
|
// cleanup_registry_hklm();
|
||||||
@ -625,8 +626,10 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
|
|||||||
CloseHandle(processInfo.hThread);
|
CloseHandle(processInfo.hThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PersistentMode == L"1" || (PersistentMode == L"2" && AppId.empty()) ) {
|
if (PersistentMode == L"1" ) {
|
||||||
MessageBoxA(NULL, "Press OK when you have finished playing to close the loader", "Cold Client Loader (waiting)", MB_OK);
|
MessageBoxA(NULL, "Press OK when you have finished playing to close the loader", "Cold Client Loader (waiting)", MB_OK);
|
||||||
|
} else if (PersistentMode == L"2" && AppId.empty()) {
|
||||||
|
MessageBoxA(NULL, "Start the game, then press OK when you have finished playing to close the loader", "Cold Client Loader (waiting)", MB_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PersistentMode != L"2" || AppId.empty()) { // persistent mode 0 or 1, or mode 2 without app id
|
if (PersistentMode != L"2" || AppId.empty()) { // persistent mode 0 or 1, or mode 2 without app id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user