Article View: microsoft.public.vc.language
Article #113Re: CreateProcess w/muti apps launched
From: InstallShield Software Corp.
Date: Mon, 20 Sep 1999 00:00
Date: Mon, 20 Sep 1999 00:00
63 lines
2338 bytes
2338 bytes
Here is a function that I used that seems to work well for launching IS
setups.
HTH,
Eric
InstallShield Support
unsigned long RunSetupAndWait(LPSTR);
unsigned long RunSetupAndWait(LPSTR szFullCmdLine){
PROCESS_INFORMATION ProcInfo;
STARTUPINFO StartupInfo;
BOOL bRval;
unsigned long nExitCode;
long lRetVal;
GetStartupInfo(&StartupInfo);
bRval=CreateProcess(NULL,szFullCmdLine,NULL,NULL,
FALSE, CREATE_NEW_PROCESS_GROUP,
NULL, NULL, &StartupInfo, &ProcInfo);
if( bRval == 0
// return a error code
return 999;
}
do{
lRetVal = WaitForSingleObject(ProcInfo.hProcess, 0);
//setup is complete
if ( (lRetVal < WAIT_TIMEOUT) || (lRetVal > WAIT_TIMEOUT) ){
break;
}
//sleep to allow setup.exe to initialize itself and free CPU.
PeekMessage() will work too.
Sleep(2000);
}
while (TRUE);
GetExitCodeProcess(ProcInfo.hProcess, &nExitCode);
return nExitCode;
}
kbozek@my-deja.com wrote in message <7s5d8h$eun$1@nnrp1.deja.com>...
>I am using InstallShield to Launch another Installshield app.
>Installshield has its own launch and wait function. However, I noted
>that after it decabs, the function returns even though the installer is
>not finished. It seems that InstallShield launches a process afer
>decabbing and returns on the decabbing function.
>
>I created a Win32 app using CreateProcess. However, it behaves the
>same as the IS app when using waitforsingleobject. I know that there
>is a Msgwaitformultiple object function but can't get it to work.
>Checked MSDN without finding a specific. Help....
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
>
Technical Details
Message-ID:
<37e66674.0@news.installshield.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7s5d8h$eun$1@nnrp1.deja.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111184,ac5b9e7085f943a2 X-Google-Attributes: gid111184,public X-Google-Thread: f7a51,ac5b9e7085f943a2 X-Google-Attributes: gidf7a51,public From: "InstallShield Software Corp." <ericp@installshield.com> Subject: Re: CreateProcess w/muti apps launched Date: 1999/09/20 Message-ID: <37e66674.0@news.installshield.com> X-Deja-AN: 527495345 References: <7s5d8h$eun$1@nnrp1.deja.com> X-Trace: 20 Sep 1999 11:53:08 -0600, 172.16.1.1 Newsgroups: microsoft.public.vc.language,installshield.is5.general X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4