Better launch of the aria2 process.

By setting the ApplicationName to NULL, CreateProcessW will
search for the application in the path.
This commit is contained in:
Matthieu Gautier 2018-10-31 11:12:44 +01:00
parent ccb3d8639d
commit 1787e30440
1 changed files with 3 additions and 4 deletions

View File

@ -55,15 +55,14 @@ void WinImpl::run(const commandLine_t& commandLine)
STARTUPINFOW startInfo = {0}; STARTUPINFOW startInfo = {0};
PROCESS_INFORMATION procInfo; PROCESS_INFORMATION procInfo;
startInfo.cb = sizeof(startInfo); startInfo.cb = sizeof(startInfo);
const char* binary = commandLine[0];
std::cerr << "running " << binary << std::endl;
std::ostringstream oss; std::ostringstream oss;
for(auto& item: commandLine) { for(auto& item: commandLine) {
oss << item << " "; oss << item << " ";
} }
auto wCommandLine = toWideChar(oss.str());
if (CreateProcessW( if (CreateProcessW(
toWideChar(binary).get(), NULL,
toWideChar(oss.str()).get(), wCommandLine.get(),
NULL, NULL,
NULL, NULL,
false, false,