View Single Post
  #4  
Old 05-03-2017, 10:41
rinaldo's Avatar
rinaldo rinaldo is offline
Registered User
 
Join Date: Sep 2015
Location: Rome
Posts: 433
Thanks: 101
Thanked 696 Times in 191 Posts
rinaldo is on a distinguished road
if you want to use another directory to remove here


DiskSpace.iss
Code:
procedure ObjectFunc(Sender: TObject);
var Drive: String;
begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
TotalSpaceLabel.Caption:= ExpandConstant('{cm:TotalSpace} ') +MbOrTb(TotalMB);
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ') +MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
InstallSpacelabel.Caption:=ExpandConstant('{cm:Required} ')+MbOrTb({#NeedInstallSize});
NeedSpaceLabel.Caption:= ExpandConstant('{cm:NeedSpace} ') +MbOrTb({#NeedSize});
WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize});
BtnSetEnabled(hNextBtn, true);
if (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize}) then begin
FreeSpaceLabel.Font.Color:={#FontColor};
end else begin
BtnSetEnabled(hDirBrowseBtn, False);
BtnSetEnabled(hGroupBrowseBtn, False);
WizardForm.DirEdit.Enabled:=False;
WizardForm.GroupEdit.Enabled:=False;
FreeSpaceLabel.Font.Color:=$0000FF;
BtnSetFontColor(hNextBtn, $0000FF, $0000FF, $0000FF, $0000FF);
end;end;

Last edited by rinaldo; 05-03-2017 at 10:50.
Reply With Quote
The Following User Says Thank You to rinaldo For This Useful Post:
Simorq (05-03-2017)