From c87ee1b81dc0f9790ec6e825d8b22f5377b9f50c Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 29 Oct 2023 23:16:58 +0100 Subject: [PATCH] Fix launch after update bug Build command line properly, must prepend executable name first since that gets populated into arg 0. --- r5dev/sdklauncher/sdkupdater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/r5dev/sdklauncher/sdkupdater.cpp b/r5dev/sdklauncher/sdkupdater.cpp index 5f8424b7..ac8a3ebe 100644 --- a/r5dev/sdklauncher/sdkupdater.cpp +++ b/r5dev/sdklauncher/sdkupdater.cpp @@ -208,9 +208,12 @@ int main(int argc, char** argv) // Initialize startup info struct. startupInfo.cb = sizeof(STARTUPINFOA); + char commandLine[256]; + V_snprintf(commandLine, sizeof(commandLine), "launcher.exe %s", "-launch"); + BOOL createResult = CreateProcessA( "launcher.exe", // lpApplicationName - (LPSTR)"-launch", // lpCommandLine + commandLine, // lpCommandLine NULL, // lpProcessAttributes NULL, // lpThreadAttributes FALSE, // bInheritHandles