//vc++ 安装环境检查 plat:x64 x86 functionIsVCPPDetected(version:string;plat:string): Boolean; var success: Boolean; key,versionkey:string; build,versionBuild:cardinal; begin versionkey:=version; versionBuild:=0;
case version of '13': begin versionkey:='12.0'; versionBuild:=40660; end;
'15': begin versionkey:='14.0'; versionBuild:=23026; end; '19': begin versionkey:='14.0'; versionBuild:=28720; end;
//安装包初始化 functionInitializeSetup(): Boolean; var Path:string ; ResultCode: Integer; Success:Boolean; begin Success:=true;
ifnot IsVCPPDetected('19','x86') then begin MsgBox('软件运行需要 Microsoft Visual C++ 2019 Redistributable x86, 即将开始安装vc redist x86。', mbInformation, MB_OK);
ifnot IsVCPPDetected('19','x86') then begin if MsgBox('Microsoft Visual C++ 2019 Redistributable x86组件安装失败,部分功能无法使用,是否继续安装!',mbInformation,MB_YesNo) = IDYES then begin Success:=true; endelsebegin Success := false; result:=Success; Exit; end; end elsebeginend; end;