如何添加inno安装盘容量,可用空间,安装所需等...
答案 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;