[Inno Setup] 执行程序,返回值不为0时提示用户

procedure LoadPerfCounter();
var
  Ret : Integer;
begin
  if Exec(ExpandConstant('{sys}') + 'lodctr.exe',
         '/m:test.man', ExpandConstant('{app}') ,SW_HIDE, ewWaitUntilTerminated, Ret) then
  begin
    if Ret <> 0 then
    begin
      MsgBox('Error when loading performance counters.' + #13#10 + SysErrorMessage(Ret), mbError, MB_OK);
    end;       
  end;
end;
原文地址:https://www.cnblogs.com/liujx2019/p/10522763.html