在安装程序之前,预先安装别的程序

写在下面的函数里

procedure CurStepChanged(CurStep: TSetupStep);
if_need_vc_x64 := NeedInstallVC8SP1_x64();
 if (CurStep=ssInstall) and (if_need_vc_x64) then begin
  ExtractTemporaryFile('vc_redist.x64.exe');
  Exec(ExpandConstant('{tmp}/vc_redist.x64.exe'), '/qb', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  if not (ResultCode = 0) 
  then begin
    MsgBox('VC++ 2015 Redistributable which is mandatory!',mbCriticalError, MB_OK)      
  end;

 end;
原文地址:https://www.cnblogs.com/liujx2019/p/10307599.html