function InitializeSetup: Boolean;
var Path:string ;
ResultCode: Integer;
begin
if RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v2.0') then
begin
Result := true;
end
else
begin
if MsgBox('系统检测到您没有安装.Net Framework2.0,是否立刻下载并安装?', mbConfirmation, MB_YESNO) = idYes then
begin
Path := ExpandConstant('{pf}\Internet Explorer\iexplore.exe');
Exec(Path, 'http://www.xxx.com/down/dotnetfx2.exe', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
MsgBox('请安装好.Net Framework2.0环境后,再运行本安装包程序!',mbInformation,MB_OK);
Result := false;
end
else
begin
MsgBox('没有安装.Net Framework2.0环境,无法运行XXX程序,本安装程序即将退出!',mbInformation,MB_OK);
Result := false;
end;
end;
end;