如何在inno设置中添加磁盘信息

时间:2014-07-10 18:38:33

标签: inno-setup

如何添加inno安装盘容量,可用空间,安装所需等...

http://s5.postimg.org/998yq4vgn/inno.png

1 个答案:

答案 0 :(得分:2)

您可以使用GetSpaceOnDisk函数在Program Files驱动器上获取并显示可用的兆字节。

function GetSpaceOnDisk(const Path: String; const InMegabytes: Boolean; var Free, Total: Cardinal): Boolean;


Example:
var
  Path: String;
  FreeMB, TotalMB: Cardinal;
begin
  // Get and display free megabytes on the Program Files drive
  Path := ExpandConstant('{pf}');
  if GetSpaceOnDisk(Path, True, FreeMB, TotalMB) then
  begin
    MsgBox('There are ' + IntToStr(FreeMB) + ' megabytes free on ' +
      Path, mbInformation, MB_OK);
  end
  else begin
    // the function failed
  end;
end;