C
CJ
Unregistered / Unconfirmed
GUEST, unregistred user!
环境:Microsoft Windows 2000 Advanced Server<br> Borland Delphi 5 Pack #1 ADO Pack #2<br> InstallSheilder Express Limited Edition for Delphi 5 2.12<br>用以下函数调用InstallSheilder Express 制作的安装盘不能得到期望的效果<br>procedure ExecAndWait(Filename:String);<br>var<br> bCreateProcess: boolean;<br> lpStartupInfo: TStartupInfo;<br> lpProcessInformation: TProcessInformation;<br>begin<br> FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0);<br> lpStartupInfo.cb := Sizeof(TStartupInfo);<br> lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;<br> lpStartupInfo.wShowWindow := SW_NORMAL;<br> bCreateProcess := CreateProcess(nil, PChar(Filename),<br> nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,<br> nil, nil, lpStartupInfo, lpProcessInformation);<br> if bCreateProcess then //Wait for exit<br> WaitForSingleObject(lpProcessInformation.hProcess, infinite);<br>end;<br><br>procedure TForm1.btnDataClick(Sender: TObject);<br>begin<br> ExecAndWait(DefaultPath + 'mdac_typ.exe');<br>end;<br><br>procedure TForm1.btnRecoverClick(Sender: TObject);<br>begin<br> ExecAndWait(DefaultPath + 'BININST/SETUP.EXE');<br>end;<br><br>procedure TForm1.btnClearDataClick(Sender: TObject);<br>begin<br> ExecAndWait(DefaultPath + 'DATAINST/SETUP.exe');<br>end;<br><br>procedure TForm1.btnFullClick(Sender: TObject);<br>begin<br> btnRecover.Click;<br> btnClearData.Click;<br> btnData.Click;<br>end;<br>被调用的SETUP程序不被执行,而我的程序也死,强行结束之,setup执行了...