Hi,
I encountered the same problem.
My CD-ROM's folder is as below:
/////////////My CD-ROM/////////////
M:\
\AP
\Driver
-Setup.exe
-Autorun.inf
///////////////////////////////////////
The Setup.exe in root is a VC++ program which calls the subfolder \AP\Setup.exe which is InstallScript project; There is another InstallScript MSI Setup.exe under the subfolder \Driver. The VC++ program Setup.exe uses CreateProcess to perform subfolders install program, and waiting these programs exit.
While Setup.exe perform the InstallScript program, it seems not wait, but if is InstallScript MSI program, it waits. If I copy all to my HDD, all running correctly(it waits). It's strange!
Is InstallScript project have child process, so the VC program cant wait? Or I use wrong way? I use InstallShield 10.5. Below is my code:
////////////////////////////////////////////////////////////////////////////////////////////////
#define ITEM2SETUPPATH ".\\AP\\Setup.exe"
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD dwExit;
TCHAR apIns[MAX_PATH];
HWND hWndMain = this->m_hWnd;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
wsprintf(apIns, "%s%s", szCurModPath, ITEM2SETUPPATH);
if( !CreateProcess( NULL, apIns, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) )
{
::AfxMessageBox("CreateProcess() failed!");
return;
}
//Set itself to bottom.
::ShowWindow(hWndMain, SW_MINIMIZE);
WaitForSingleObject( pi.hProcess, INFINITE ); // Wait until child process exits.
GetExitCodeProcess(pi.hProcess, &dwExit);
CloseHandle( pi.hProcess ); // Close process and thread handles.
CloseHandle( pi.hThread );
//Set itself to desktop
::ShowWindow(hWndMain, SW_RESTORE);
//////////////////////////////////////////////////////////////////////////////////////////////
Anyone can help me??
Edited by mmppeegg, 27 April 2007 - 09:24.