From 827c2c24f84f31e20ed8a11635c7b2b8d239d645 Mon Sep 17 00:00:00 2001 From: cperthuisoc Date: Sat, 11 Apr 2020 18:34:59 -0700 Subject: [PATCH] Fixed the launch of adb when using the Android SDK path on Windows --- renderdoc/os/win32/win32_process.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/renderdoc/os/win32/win32_process.cpp b/renderdoc/os/win32/win32_process.cpp index c8fe4c96a..f04d44937 100644 --- a/renderdoc/os/win32/win32_process.cpp +++ b/renderdoc/os/win32/win32_process.cpp @@ -998,19 +998,27 @@ uint32_t Process::LaunchProcess(const char *app, const char *workingDir, const c { HANDLE hChildStdOutput_Rd = NULL, hChildStdError_Rd = NULL; + rdcstr appPath = app; + size_t len = appPath.length(); + rdcstr ext; + if(len > 4) + ext = strlower(appPath.substr(len - 4)); + if(ext != ".exe") + appPath += ".exe"; + PROCESS_INFORMATION pi = - RunProcess(app, workingDir, cmdLine, {}, internal, result ? &hChildStdOutput_Rd : NULL, - result ? &hChildStdError_Rd : NULL); + RunProcess(appPath.c_str(), workingDir, cmdLine, {}, internal, + result ? &hChildStdOutput_Rd : NULL, result ? &hChildStdError_Rd : NULL); if(pi.dwProcessId == 0) { if(!internal) - RDCWARN("Couldn't launch process '%s'", app); + RDCWARN("Couldn't launch process '%s'", appPath.c_str()); return 0; } if(!internal) - RDCLOG("Launched process '%s' with '%s'", app, cmdLine); + RDCLOG("Launched process '%s' with '%s'", appPath.c_str(), cmdLine); ResumeThread(pi.hThread);