3

我已将以下代码添加到我的脚本中:

[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;

线

Boolean bIsInstalled := IsSomeAppInstalled();

引发错误

内部错误 (20)

这里可能有什么错误?

4

1 回答 1

5

在 Pascal (Script) 中,您在实际代码之前使用关键字声明变量:var

function InitializeSetup(): Boolean;
var
  bIsInstalled: Boolean;
begin
  bIsInstalled := IsSomeAppInstalled();
  MsgBox('IsSomeAppInstalled: ' + IntToStr(Integer(bIsInstalled)),
    mbInformation, MB_OK);
  Result := true;
end;
于 2019-03-27T22:01:18.313 回答