5

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?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
tmighty
  • 10,734
  • 21
  • 104
  • 218

1 Answers1

7

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;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992