added terminate process

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@922 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-09-04 20:47:03 +00:00
parent 74875edfc5
commit 0dcf9ff3c4

View file

@ -81,7 +81,7 @@ void ExecScript(BOOL log) {
OSVERSIONINFO osv={sizeof(osv)};
HANDLE newstdout=0,read_stdout=0;
DWORD dwRead = 1;
DWORD dwExit = !STILL_ACTIVE;
DWORD dwExit;
HGLOBAL memory;
char *szBuf;
GetVersionEx(&osv);
@ -106,7 +106,9 @@ void ExecScript(BOOL log) {
CloseHandle(read_stdout);
pushstring("error");
}
WaitForSingleObject(pi.hProcess,INFINITE);
if (WaitForSingleObject(pi.hProcess,INFINITE)==WAIT_TIMEOUT) {
TerminateProcess(pi.hProcess,GetExitCodeProcess(pi.hProcess,&dwExit));
}
PeekNamedPipe(read_stdout, 0, 0, 0, &dwRead, NULL);
memory = GlobalAlloc(GMEM_MOVEABLE,dwRead+1);
szBuf = (char *)GlobalLock(memory);