From 5d0464e8bf727c826a8d3d7aac9777ac8440590b Mon Sep 17 00:00:00 2001 From: Alexander <87954949+absoluteSpacehead@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:58:21 +0100 Subject: [PATCH] startup shit --- MercuryLauncher/MercuryLauncher.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/MercuryLauncher/MercuryLauncher.cpp b/MercuryLauncher/MercuryLauncher.cpp index e2ac236..4b76d8f 100644 --- a/MercuryLauncher/MercuryLauncher.cpp +++ b/MercuryLauncher/MercuryLauncher.cpp @@ -229,7 +229,7 @@ int RunLawin() startupInfo.cb = sizeof(STARTUPINFO); PROCESS_INFORMATION processInformation = { 0 }; std::wstring cmd = L"cmd /c npm i"; - CreateProcessW(nullptr, &cmd[0], nullptr, nullptr, FALSE, CREATE_NO_WINDOW, nullptr, (localAppData + L"\\LawinServer").c_str(), &startupInfo, &processInformation); + CreateProcessW(nullptr, &cmd[0], nullptr, nullptr, FALSE, 0x0, nullptr, (localAppData + L"\\LawinServer").c_str(), &startupInfo, &processInformation); WaitForSingleObject(processInformation.hProcess, INFINITE); @@ -379,7 +379,14 @@ int SetupOT() PROCESS_INFORMATION processInformation = { 0 }; std::wstring cmd(BINARY_PATH_OT); cmd += L" -log -AUTH_LOGIN=unknown -AUTH_PASSWORD=5001 -AUTH_TYPE=exchangecode"; - CreateProcessW(BINARY_PATH_OT, &cmd[0], nullptr, nullptr, FALSE, 0x0, nullptr, nullptr, &startupInfo, &processInformation); + + bool success = CreateProcessW(BINARY_PATH_OT, &cmd[0], nullptr, nullptr, FALSE, 0x0, nullptr, nullptr, &startupInfo, &processInformation); + + if (!success) + { + std::cerr << "\nFailed to launch Fortnite. (" << GetLastError() << ")\n"; + return 3; + } AssignProcessToJobObject(job, processInformation.hProcess); @@ -446,7 +453,13 @@ int Setup18() std::wstring cmdl(BINARY_PATH_1_8); cmdl += L" -skippatchcheck -epicportal -HTTP=WinInet -log"; - CreateProcessW(BINARY_PATH_1_8, &cmdl[0], nullptr, nullptr, FALSE, 0x0, nullptr, nullptr, &startupInfo, &processInformation); + bool success = CreateProcessW(BINARY_PATH_1_8, &cmdl[0], nullptr, nullptr, FALSE, 0x0, nullptr, nullptr, &startupInfo, &processInformation); + + if (!success) + { + std::cerr << "\nFailed to launch Fortnite. (" << GetLastError() << ")\n"; + return 5; + } AssignProcessToJobObject(job, processInformation.hProcess);