如果在 Inno Setup 中多次调用 Abort() 会发生什么

What happens if Abort() is called multiple times in Inno Setup

如果我多次使用 Abort() 会发生什么,例如:

[Code]

function InitializeSetup(): Boolean;
begin
  Result := True;
  { Some Initialization }
  try
    { some code }
    Abort();
  except
    MsgBox('Abort is called');
    Abort(); { Abort is called Second time. Is this create any problem? }
  end;
end;

Abort 抛出一个异常,你显然知道,因为你正在捕获它。见 documentation:

Abort raises a special "silent exception" which operates like any other exception, but does not display an error message to the end user.

如果异常没有离开事件函数,因为你使用 try...except 语句捕获它,Inno Setup 永远不会了解它,所以它对它。

只有后者调用 Abort 抛出的异常才会离开事件函数并对 Inno Setup 产生任何影响。