INNO脚本代码:
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"
[Code]
var
freespacelabel: TLabel;
FreeSpace, TotalSpace: Cardinal;
procedure ShowFreeSpaceOnDisc(Sender: TObject);
begin
GetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text), True, FreeSpace, TotalSpace);
freespacelabel.Caption:= '磁盘可用空间: ' + IntToStr(FreeSpace) + ' MB。';
end;
1