mirror of https://github.com/kiwix/libkiwix.git
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:
parent
ccb3d8639d
commit
1787e30440
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue