user3352424
user3352424

Reputation: 21

How to add disk information in inno setup

How to add in inno setup disk capacity, free space, required for instalation, etc...

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

Upvotes: 1

Views: 1074

Answers (1)

LEo
LEo

Reputation: 462

you can use the function GetSpaceOnDisk to get and display free megabytes on the Program Files drive.

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;

Upvotes: 2

Related Questions