I am new to Inno Setup scripting and I am trying to install .NET framework 3.5 using below code as a prerequisite. The Check
function is executing multiple times. Can some one please help me understand why?
Note: All other sections (Setup
, Icons
, etc) in this below code are having proper contents.
[Files]
Source: "Frameworks\dotnetfx35setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; \
BeforeInstall: Install35Framework; Check: Framework35IsNotInstalled
[Code]
function IsDotNetDetected(version: string; service: Cardinal): boolean;
begin
Result := { ... };
end;
function Framework35IsNotInstalled: Boolean;
begin
if IsDotNetDetected('v3.5', 1) then
begin
MsgBox('Framework35IsNotInstalled: FALSE ', mbConfirmation, MB_YESNO);
Result := False;
end else begin
MsgBox('Framework35IsNotInstalled: TRUE ', mbConfirmation, MB_YESNO);
Result := True;
end;
end;
procedure Install35Framework;
begin
{ ... }
end;