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:
parent
cefeec3676
commit
e7672ebf46
1 changed files with 6 additions and 3 deletions
|
@ -80,14 +80,17 @@ int main( int argc, char *argv[] )
|
||||||
|
|
||||||
ZeroMemory( &si, sizeof(si) );
|
ZeroMemory( &si, sizeof(si) );
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
ZeroMemory( &pi, sizeof(pi) );
|
|
||||||
|
|
||||||
/* Start a subprocess running the executable of the
|
/* Start and wait for a process with the same filename as
|
||||||
sub folder of the cuand wait for its completion */
|
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,
|
if ( CreateProcess( szPath, GetCommandLine(), NULL, NULL,
|
||||||
FALSE, 0, NULL, NULL, &si, &pi ) )
|
FALSE, 0, NULL, NULL, &si, &pi ) )
|
||||||
{
|
{
|
||||||
WaitForSingleObject( pi.hProcess, INFINITE );
|
WaitForSingleObject( pi.hProcess, INFINITE );
|
||||||
|
GetExitCodeProcess( pi.hProcess, &err );
|
||||||
CloseHandle( pi.hProcess );
|
CloseHandle( pi.hProcess );
|
||||||
CloseHandle( pi.hThread );
|
CloseHandle( pi.hThread );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue