3
votes

I have added the following code to my script:

[Code]
function IsSomeAppInstalled: Boolean;
begin
  Result := FileExists(ExpandConstant('{pf32}\SomeApp\Some.dll'));
end;

function InitializeSetup(): Boolean;
begin
   Boolean bIsInstalled := IsSomeAppInstalled();
   MsgBox('IsSomeAppInstalled: ' + IntToStr(Integer(bIsInstalled)),
     mbInformation, MB_OK);
   Result := true;
end;

The line

Boolean bIsInstalled := IsSomeAppInstalled();

raises the error

Internal error (20)

What might be the error here?

1

1 Answers

5
votes

In Pascal (Script) you declare variables using var keyword before the actual code:

function InitializeSetup(): Boolean;
var
  bIsInstalled: Boolean;
begin
  bIsInstalled := IsSomeAppInstalled();
  MsgBox('IsSomeAppInstalled: ' + IntToStr(Integer(bIsInstalled)),
    mbInformation, MB_OK);
  Result := true;
end;