From 1787e304404827292416a8a57cd3e3d5c18c2b3f Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 31 Oct 2018 11:12:44 +0100 Subject: [PATCH] Better launch of the aria2 process. By setting the ApplicationName to NULL, CreateProcessW will search for the application in the path. --- src/subprocess_windows.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/subprocess_windows.cpp b/src/subprocess_windows.cpp index 226bd5d15..54c36824d 100644 --- a/src/subprocess_windows.cpp +++ b/src/subprocess_windows.cpp @@ -55,15 +55,14 @@ void WinImpl::run(const commandLine_t& commandLine) STARTUPINFOW startInfo = {0}; PROCESS_INFORMATION procInfo; startInfo.cb = sizeof(startInfo); - const char* binary = commandLine[0]; - std::cerr << "running " << binary << std::endl; std::ostringstream oss; for(auto& item: commandLine) { oss << item << " "; } + auto wCommandLine = toWideChar(oss.str()); if (CreateProcessW( - toWideChar(binary).get(), - toWideChar(oss.str()).get(), + NULL, + wCommandLine.get(), NULL, NULL, false,