this should be a simple question… When I use
ChildProcess::start(), I always need to specify a full path to the executable. It would be quite nice if it could use the path environment variable… I am however not sure why it doesn’t work already. I am on Windows here and looking at the implementation it falls down to
CreateProcess in the end.
ok = CreateProcess (nullptr, const_cast<LPWSTR> (command.toWideCharPointer()), nullptr, nullptr, TRUE, CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, nullptr, nullptr, &startupInfo, &processInfo) != FALSE;
Well, there is this
lpEnvironment parameter which is described on MSDN as:
lpEnvironment [in, optional] A pointer to the environment block for the new process. If this parameter is NULL, the new process uses the environment of the calling process.
So it looks like it should work. I am however not sure whether the parent process (that is, my JUCE app), can see the path correctly…