|
use this function
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
/////////////////////////////////////////////////Example/////////////////////////////////
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAn siChar): longword;
var
Remaining: Integer;
begin
if OveralPct<=Wizardform.ProgressGauge.Max then
Wizardform.Progressgauge.Position := OveralPct;
Result := ISDoneCancel;
with WizardForm.ProgressGauge do begin
WizardForm.Caption:='Installing - <<{#AppName}>>';
if OveralPct>0 then
begin
WizardForm.Caption:='Installing - <<{#AppName}>>'+(' Wait:' + TimeStr1);
end;
if WizardForm.ProgressGauge.Max <> 0 then
WizardForm.StatusLabel.Caption :='Unpacking Archives ' + NumToStr((WizardForm.ProgressGauge.Position * 100) / WizardForm.ProgressGauge.Max) + '%';
WizardForm.FilenameLabel.Caption :=' Extracting File: '+ MinimizePathName(CurrentFile, WizardForm.FilenameLabel.Font, WizardForm.ProgressGauge.Width-ScaleX(80));
end;
end;
|