Return exit code from child process

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6059 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2010-04-16 14:56:30 +00:00
parent cefeec3676
commit e7672ebf46

View file

@ -80,14 +80,17 @@ int main( int argc, char *argv[] )
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
/* Start a subprocess running the executable of the
sub folder of the cuand wait for its completion */
/* Start and wait for a process with the same filename as
ourself located in SUBFOLDER.
WARNING: The subprocess can't parse GetCommandLine()
to find its own path since we pass the wrong path! */
if ( CreateProcess( szPath, GetCommandLine(), NULL, NULL,
FALSE, 0, NULL, NULL, &si, &pi ) )
{
WaitForSingleObject( pi.hProcess, INFINITE );
GetExitCodeProcess( pi.hProcess, &err );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}