|
@@ -258,7 +258,8 @@ end;
|
|
|
|
|
|
procedure CopySourceFileToDestFile(const SourceF, DestF: TFile;
|
|
procedure CopySourceFileToDestFile(const SourceF, DestF: TFile;
|
|
const ISSigVerify: Boolean; [ref] const ISSigAvailableKeys: TArrayOfECDSAKey;
|
|
const ISSigVerify: Boolean; [ref] const ISSigAvailableKeys: TArrayOfECDSAKey;
|
|
- const ISSigAllowedKeys: AnsiString; const ISSigSourceFilename: String; AMaxProgress: Integer64);
|
|
|
|
|
|
+ const ISSigAllowedKeys: AnsiString; const ISSigSourceFilename: String;
|
|
|
|
+ const AExpectedSize: Integer64);
|
|
{ Copies all bytes from SourceF to DestF, incrementing process meter as it
|
|
{ Copies all bytes from SourceF to DestF, incrementing process meter as it
|
|
goes. Assumes file pointers of both are 0. }
|
|
goes. Assumes file pointers of both are 0. }
|
|
const
|
|
const
|
|
@@ -306,7 +307,8 @@ begin
|
|
SHA256Init(Context);
|
|
SHA256Init(Context);
|
|
end;
|
|
end;
|
|
|
|
|
|
- Inc6464(AMaxProgress, CurProgress);
|
|
|
|
|
|
+ var MaxProgress := CurProgress;
|
|
|
|
+ Inc6464(MaxProgress, AExpectedSize);
|
|
BytesLeft := SourceF.Size;
|
|
BytesLeft := SourceF.Size;
|
|
|
|
|
|
{ To avoid file system fragmentation, preallocate all of the bytes in the
|
|
{ To avoid file system fragmentation, preallocate all of the bytes in the
|
|
@@ -331,8 +333,10 @@ begin
|
|
|
|
|
|
NewProgress := CurProgress;
|
|
NewProgress := CurProgress;
|
|
Inc64(NewProgress, BufSize);
|
|
Inc64(NewProgress, BufSize);
|
|
- if Compare64(NewProgress, AMaxProgress) > 0 then
|
|
|
|
- NewProgress := AMaxProgress;
|
|
|
|
|
|
+ { In case the source file was larger than we thought it was, stop the
|
|
|
|
+ progress bar at the maximum amount }
|
|
|
|
+ if Compare64(NewProgress, MaxProgress) > 0 then
|
|
|
|
+ NewProgress := MaxProgress;
|
|
SetProgress(NewProgress);
|
|
SetProgress(NewProgress);
|
|
|
|
|
|
ProcessEvents;
|
|
ProcessEvents;
|
|
@@ -346,7 +350,7 @@ begin
|
|
|
|
|
|
{ In case the source file was shorter than we thought it was, bump the
|
|
{ In case the source file was shorter than we thought it was, bump the
|
|
progress bar to the maximum amount }
|
|
progress bar to the maximum amount }
|
|
- SetProgress(AMaxProgress);
|
|
|
|
|
|
+ SetProgress(MaxProgress);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure AddAttributesToFile(const DisableFsRedir: Boolean;
|
|
procedure AddAttributesToFile(const DisableFsRedir: Boolean;
|