Parcourir la source

Use the same progress protection while extracting and downloading as while copying an external file.

Martijn Laan il y a 3 mois
Parent
commit
2a32a45277

+ 15 - 19
Projects/Src/Compression.SevenZipDLLDecoder.pas

@@ -15,7 +15,7 @@ unit Compression.SevenZipDLLDecoder;
 interface
 interface
 
 
 uses
 uses
-  Windows, Shared.FileClass, Shared.VerInfoFunc, Compression.SevenZipDecoder;
+  Windows, Shared.FileClass, Shared.VerInfoFunc, Shared.Int64Em, Compression.SevenZipDecoder;
 
 
 function SevenZipDLLInit(const SevenZipLibrary: HMODULE;
 function SevenZipDLLInit(const SevenZipLibrary: HMODULE;
   [ref] const VersionNumbers: TFileVersionNumbers): Boolean;
   [ref] const VersionNumbers: TFileVersionNumbers): Boolean;
@@ -33,7 +33,7 @@ procedure ExtractArchiveRedir(const DisableFsRedir: Boolean;
   was found. }
   was found. }
 type
 type
   TArchiveFindHandle = type NativeUInt;
   TArchiveFindHandle = type NativeUInt;
-  TOnExtractToHandleProgress = procedure(Bytes: Cardinal);
+  TOnExtractToHandleProgress = procedure(const Bytes, Param: Integer64);
 function ArchiveFindFirstFileRedir(const DisableFsRedir: Boolean;
 function ArchiveFindFirstFileRedir(const DisableFsRedir: Boolean;
   const ArchiveFilename, DestDir, Password: String;
   const ArchiveFilename, DestDir, Password: String;
   const RecurseSubDirs, ExtractIntent: Boolean;
   const RecurseSubDirs, ExtractIntent: Boolean;
@@ -41,7 +41,7 @@ function ArchiveFindFirstFileRedir(const DisableFsRedir: Boolean;
 function ArchiveFindNextFile(const FindFile: TArchiveFindHandle; out FindFileData: TWin32FindData): Boolean;
 function ArchiveFindNextFile(const FindFile: TArchiveFindHandle; out FindFileData: TWin32FindData): Boolean;
 function ArchiveFindClose(const FindFile: TArchiveFindHandle): Boolean;
 function ArchiveFindClose(const FindFile: TArchiveFindHandle): Boolean;
 procedure ArchiveFindExtract(const FindFile: TArchiveFindHandle; const DestF: TFile;
 procedure ArchiveFindExtract(const FindFile: TArchiveFindHandle; const DestF: TFile;
-  const OnExtractToHandleProgress: TOnExtractToHandleProgress);
+  const OnExtractToHandleProgress: TOnExtractToHandleProgress; const OnExtractToHandleProgressParam: Integer64);
 
 
 type
 type
   TFileTimeHelper = record helper for TFileTime
   TFileTimeHelper = record helper for TFileTime
@@ -54,7 +54,7 @@ implementation
 uses
 uses
   Classes, SysUtils, Forms, Variants, ActiveX, ComObj, Generics.Collections,
   Classes, SysUtils, Forms, Variants, ActiveX, ComObj, Generics.Collections,
   Compression.SevenZipDLLDecoder.Interfaces, PathFunc,
   Compression.SevenZipDLLDecoder.Interfaces, PathFunc,
-  Shared.Int64Em, Shared.SetupMessageIDs, Shared.CommonFunc,
+  Shared.SetupMessageIDs, Shared.CommonFunc,
   SetupLdrAndSetup.Messages, SetupLdrAndSetup.RedirFunc,
   SetupLdrAndSetup.Messages, SetupLdrAndSetup.RedirFunc,
   Setup.LoggingFunc, Setup.MainFunc, Setup.InstFunc;
   Setup.LoggingFunc, Setup.MainFunc, Setup.InstFunc;
 
 
@@ -175,6 +175,7 @@ type
     FIndex: UInt32;
     FIndex: UInt32;
     FDestF: TFile;
     FDestF: TFile;
     FOnExtractToHandleProgress: TOnExtractToHandleProgress;
     FOnExtractToHandleProgress: TOnExtractToHandleProgress;
+    FOnExtractToHandleProgressParam: Integer64;
     FPreviousProgress: UInt64;
     FPreviousProgress: UInt64;
   protected
   protected
     { IArchiveExtractCallback }
     { IArchiveExtractCallback }
@@ -186,7 +187,8 @@ type
   public
   public
     constructor Create(const InArchive: IInArchive; const numItems: UInt32;
     constructor Create(const InArchive: IInArchive; const numItems: UInt32;
       const Password: String; const Index: UInt32; const DestF: TFile;
       const Password: String; const Index: UInt32; const DestF: TFile;
-      const OnExtractToHandleProgress: TOnExtractToHandleProgress);
+      const OnExtractToHandleProgress: TOnExtractToHandleProgress;
+      const OnExtractToHandleProgressParam: Integer64);
   end;
   end;
 
 
 { Helper functions }
 { Helper functions }
@@ -779,12 +781,14 @@ end;
 
 
 constructor TArchiveExtractToHandleCallback.Create(const InArchive: IInArchive;
 constructor TArchiveExtractToHandleCallback.Create(const InArchive: IInArchive;
   const numItems: UInt32; const Password: String; const Index: UInt32;
   const numItems: UInt32; const Password: String; const Index: UInt32;
-  const DestF: TFile; const OnExtractToHandleProgress: TOnExtractToHandleProgress);
+  const DestF: TFile; const OnExtractToHandleProgress: TOnExtractToHandleProgress;
+  const OnExtractToHandleProgressParam: Integer64);
 begin
 begin
   inherited Create(InArchive, numItems, Password);
   inherited Create(InArchive, numItems, Password);
   FIndex := Index;
   FIndex := Index;
   FDestF := DestF;
   FDestF := DestF;
   FOnExtractToHandleProgress := OnExtractToHandleProgress;
   FOnExtractToHandleProgress := OnExtractToHandleProgress;
+  FOnExtractToHandleProgressParam := OnExtractToHandleProgressParam;
 end;
 end;
 
 
 function TArchiveExtractToHandleCallback.GetIndices: TArchiveExtractBaseCallback.TArrayOfUInt32;
 function TArchiveExtractToHandleCallback.GetIndices: TArchiveExtractBaseCallback.TArrayOfUInt32;
@@ -837,17 +841,7 @@ begin
       System.TMonitor.Exit(FLock);
       System.TMonitor.Exit(FLock);
     end;
     end;
 
 
-    { Also see Setup.Install THTTPDataReceiver.OnReceiveData }
-    var Bytes := Progress - FPreviousProgress;
-    while Bytes > 0 do begin
-      var BytesToReport: Cardinal;
-      if Bytes > High(BytesToReport) then
-        BytesToReport := High(BytesToReport)
-      else
-        BytesToReport := Bytes;
-      FOnExtractToHandleProgress(BytesToReport);
-      Dec(Bytes, BytesToReport);
-    end;
+    FOnExtractToHandleProgress(Integer64(Progress-FPreviousProgress), FOnExtractToHandleProgressParam);
     FPreviousProgress := Progress;
     FPreviousProgress := Progress;
   end;
   end;
 end;
 end;
@@ -1124,7 +1118,8 @@ begin
 end;
 end;
 
 
 procedure ArchiveFindExtract(const FindFile: TArchiveFindHandle; const DestF: TFile;
 procedure ArchiveFindExtract(const FindFile: TArchiveFindHandle; const DestF: TFile;
-  const OnExtractToHandleProgress: TOnExtractToHandleProgress);
+  const OnExtractToHandleProgress: TOnExtractToHandleProgress;
+  const OnExtractToHandleProgressParam: Integer64);
 begin
 begin
   const State = ArchiveFindStates[CheckFindFileHandle(FindFile)];
   const State = ArchiveFindStates[CheckFindFileHandle(FindFile)];
 
 
@@ -1135,7 +1130,8 @@ begin
 
 
   const ExtractCallback: IArchiveExtractCallback =
   const ExtractCallback: IArchiveExtractCallback =
     TArchiveExtractToHandleCallback.Create(State.InArchive, State.numItems,
     TArchiveExtractToHandleCallback.Create(State.InArchive, State.numItems,
-      State.Password, State.currentIndex, DestF, OnExtractToHandleProgress);
+      State.Password, State.currentIndex, DestF, OnExtractToHandleProgress,
+      OnExtractToHandleProgressParam);
   (ExtractCallback as TArchiveExtractToHandleCallback).Extract;
   (ExtractCallback as TArchiveExtractToHandleCallback).Extract;
 end;
 end;
 
 

+ 2 - 2
Projects/Src/Setup.FileExtractor.pas

@@ -2,7 +2,7 @@ unit Setup.FileExtractor;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2010 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -16,7 +16,7 @@ uses
   Shared.Struct, ChaCha20;
   Shared.Struct, ChaCha20;
 
 
 type
 type
-  TExtractorProgressProc = procedure(Bytes: Cardinal);
+  TExtractorProgressProc = procedure(const Bytes: Cardinal);
 
 
   TFileExtractor = class
   TFileExtractor = class
   private
   private

+ 44 - 42
Projects/Src/Setup.Install.pas

@@ -12,7 +12,7 @@ unit Setup.Install;
 interface
 interface
 
 
 uses
 uses
-  Classes, SHA256, Shared.FileClass, Shared.SetupTypes;
+  Classes, SHA256, Shared.FileClass, Shared.SetupTypes, Shared.Int64Em;
 
 
 procedure ISSigVerifyError(const AError: TISSigVerifySignatureError;
 procedure ISSigVerifyError(const AError: TISSigVerifySignatureError;
   const ASigFilename: String = '');
   const ASigFilename: String = '');
@@ -26,14 +26,15 @@ procedure PerformInstall(var Succeeded: Boolean; const ChangesEnvironment,
 
 
 type
 type
   TOnDownloadProgress = function(const Url, BaseName: string; const Progress, ProgressMax: Int64): Boolean of object;
   TOnDownloadProgress = function(const Url, BaseName: string; const Progress, ProgressMax: Int64): Boolean of object;
-  TOnSimpleDownloadProgress = procedure(Bytes: Cardinal);
+  TOnSimpleDownloadProgress = procedure(const Bytes, Param: Integer64);
 
 
 procedure ExtractTemporaryFile(const BaseName: String);
 procedure ExtractTemporaryFile(const BaseName: String);
 function ExtractTemporaryFiles(const Pattern: String): Integer;
 function ExtractTemporaryFiles(const Pattern: String): Integer;
 function DownloadFile(const Url, CustomUserName, CustomPassword: String;
 function DownloadFile(const Url, CustomUserName, CustomPassword: String;
   const DestF: TFile; const ISSigVerify: Boolean; const ISSigAllowedKeys: AnsiString;
   const DestF: TFile; const ISSigVerify: Boolean; const ISSigAllowedKeys: AnsiString;
   const ISSigSourceFilename: String;
   const ISSigSourceFilename: String;
-  const OnSimpleDownloadProgress: TOnSimpleDownloadProgress): Int64;
+  const OnSimpleDownloadProgress: TOnSimpleDownloadProgress;
+  const OnSimpleDownloadProgressParam: Integer64): Int64;
 function DownloadTemporaryFile(const Url, BaseName, RequiredSHA256OfFile: String;
 function DownloadTemporaryFile(const Url, BaseName, RequiredSHA256OfFile: String;
   const ISSigVerify: Boolean; const ISSigAllowedKeys: AnsiString;
   const ISSigVerify: Boolean; const ISSigAllowedKeys: AnsiString;
   const OnDownloadProgress: TOnDownloadProgress): Int64;
   const OnDownloadProgress: TOnDownloadProgress): Int64;
@@ -49,7 +50,7 @@ uses
   SetupLdrAndSetup.InstFunc, Setup.InstFunc, Setup.InstFunc.Ole, Setup.SecurityFunc, SetupLdrAndSetup.Messages,
   SetupLdrAndSetup.InstFunc, Setup.InstFunc, Setup.InstFunc.Ole, Setup.SecurityFunc, SetupLdrAndSetup.Messages,
   Setup.MainFunc, Setup.LoggingFunc, Setup.FileExtractor,
   Setup.MainFunc, Setup.LoggingFunc, Setup.FileExtractor,
   Compression.Base, PathFunc, ISSigFunc, Shared.CommonFunc.Vcl, Compression.SevenZipDLLDecoder,
   Compression.Base, PathFunc, ISSigFunc, Shared.CommonFunc.Vcl, Compression.SevenZipDLLDecoder,
-  Shared.CommonFunc, SetupLdrAndSetup.RedirFunc, Shared.Int64Em, Shared.SetupMessageIDs,
+  Shared.CommonFunc, SetupLdrAndSetup.RedirFunc, Shared.SetupMessageIDs,
   Setup.WizardForm, Shared.DebugStruct, Setup.DebugClient, Shared.VerInfoFunc, Setup.ScriptRunner, Setup.RegDLL, Setup.Helper,
   Setup.WizardForm, Shared.DebugStruct, Setup.DebugClient, Shared.VerInfoFunc, Setup.ScriptRunner, Setup.RegDLL, Setup.Helper,
   Shared.ResUpdateFunc, Setup.DotNetFunc, TaskbarProgressFunc, NewProgressBar, RestartManager,
   Shared.ResUpdateFunc, Setup.DotNetFunc, TaskbarProgressFunc, NewProgressBar, RestartManager,
   Net.HTTPClient, Net.URLClient, NetEncoding, RegStr;
   Net.HTTPClient, Net.URLClient, NetEncoding, RegStr;
@@ -220,13 +221,26 @@ begin
   if NeedToAbortInstall then Abort;
   if NeedToAbortInstall then Abort;
 end;
 end;
 
 
-procedure ExtractorProgressProc(Bytes: Cardinal);
+procedure InternalProgressProc(const Bytes: Cardinal);
 begin
 begin
   IncProgress(Bytes);
   IncProgress(Bytes);
   ProcessEvents;
   ProcessEvents;
 end;
 end;
 
 
-procedure JustProcessEventsProc(Bytes: Cardinal);
+procedure ExternalProgressProc64(const Bytes, MaxProgress: Integer64);
+begin
+  var NewProgress := CurProgress;
+  Inc6464(NewProgress, Bytes);
+  { In case the source file was larger than we thought it was, stop the
+    progress bar at the maximum amount. Also see CopySourceFileToDestFile. }
+  if Compare64(NewProgress, MaxProgress) > 0 then
+    NewProgress := MaxProgress;
+  SetProgress(NewProgress);
+  
+  ProcessEvents;
+end;
+
+procedure JustProcessEventsProc64(const Bytes, Param: Integer64);
 begin
 begin
   ProcessEvents;
   ProcessEvents;
 end;
 end;
@@ -341,7 +355,6 @@ procedure CopySourceFileToDestFile(const SourceF, DestF: TFile;
   goes. Assumes file pointers of both are 0. }
   goes. Assumes file pointers of both are 0. }
 var
 var
   BytesLeft: Integer64;
   BytesLeft: Integer64;
-  NewProgress: Integer64;
   BufSize: Cardinal;
   BufSize: Cardinal;
   Buf: array[0..16383] of Byte;
   Buf: array[0..16383] of Byte;
   Context: TSHA256Context;
   Context: TSHA256Context;
@@ -377,15 +390,7 @@ begin
     if ISSigVerify then
     if ISSigVerify then
       SHA256Update(Context, Buf, BufSize);
       SHA256Update(Context, Buf, BufSize);
 
 
-    NewProgress := CurProgress;
-    Inc64(NewProgress, BufSize);
-    { 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);
-
-    ProcessEvents;
+    ExternalProgressProc64(To64(BufSize), MaxProgress);
   end;
   end;
 
 
   if ISSigVerify then begin
   if ISSigVerify then begin
@@ -1561,16 +1566,18 @@ var
             LastOperation := SetupMessages[msgErrorReadingSource];
             LastOperation := SetupMessages[msgErrorReadingSource];
             if SourceFile = '' then begin
             if SourceFile = '' then begin
               { Decompress a file }
               { Decompress a file }
-              FileExtractor.SeekTo(CurFileLocation^, ExtractorProgressProc);
+              FileExtractor.SeekTo(CurFileLocation^, InternalProgressProc);
               LastOperation := SetupMessages[msgErrorCopying];
               LastOperation := SetupMessages[msgErrorCopying];
-              FileExtractor.DecompressFile(CurFileLocation^, DestF, ExtractorProgressProc,
+              FileExtractor.DecompressFile(CurFileLocation^, DestF, InternalProgressProc,
                 not (foDontVerifyChecksum in CurFile^.Options));
                 not (foDontVerifyChecksum in CurFile^.Options));
             end
             end
             else if foExtractArchive in CurFile^.Options then begin
             else if foExtractArchive in CurFile^.Options then begin
               { Extract a file from archive. Note: ISSigVerify for archive has
               { Extract a file from archive. Note: ISSigVerify for archive has
                 already been handled by RecurseExternalArchiveCopyFiles. }
                 already been handled by RecurseExternalArchiveCopyFiles. }
               LastOperation := SetupMessages[msgErrorExtracting];
               LastOperation := SetupMessages[msgErrorExtracting];
-              ArchiveFindExtract(StrToInt(SourceFile), DestF, ExtractorProgressProc);
+              var MaxProgress := CurProgress;
+              Inc6464(MaxProgress, AExternalSize);
+              ArchiveFindExtract(StrToInt(SourceFile), DestF, ExternalProgressProc64, MaxProgress);
             end
             end
             else if foDownload in CurFile^.Options then begin
             else if foDownload in CurFile^.Options then begin
               { Download a file with or without ISSigVerify. Note: estimate of
               { Download a file with or without ISSigVerify. Note: estimate of
@@ -1578,6 +1585,8 @@ var
               LastOperation := SetupMessages[msgErrorDownloading];
               LastOperation := SetupMessages[msgErrorDownloading];
               const DownloadUserName = ExpandConst(CurFile^.DownloadUserName);
               const DownloadUserName = ExpandConst(CurFile^.DownloadUserName);
               const DownloadPassword = ExpandConst(CurFile^.DownloadPassword);
               const DownloadPassword = ExpandConst(CurFile^.DownloadPassword);
+              var MaxProgress := CurProgress;
+              Inc6464(MaxProgress, AExternalSize);
               if foISSigVerify in CurFile^.Options then begin
               if foISSigVerify in CurFile^.Options then begin
                 const ISSigTempFile = TempFile + ISSigExt;
                 const ISSigTempFile = TempFile + ISSigExt;
                 const ISSigDestF = TFileRedir.Create(DisableFsRedir, ISSigTempFile, fdCreateAlways, faReadWrite, fsNone);
                 const ISSigDestF = TFileRedir.Create(DisableFsRedir, ISSigTempFile, fdCreateAlways, faReadWrite, fsNone);
@@ -1585,11 +1594,11 @@ var
                   { Download the .issig file }
                   { Download the .issig file }
                   const ISSigUrl = GetISSigUrl(SourceFile, ExpandConst(CurFile^.DownloadISSigSource));
                   const ISSigUrl = GetISSigUrl(SourceFile, ExpandConst(CurFile^.DownloadISSigSource));
                   DownloadFile(ISSigUrl, DownloadUserName, DownloadPassword,
                   DownloadFile(ISSigUrl, DownloadUserName, DownloadPassword,
-                    ISSigDestF, False, '', '', JustProcessEventsProc);
+                    ISSigDestF, False, '', '', JustProcessEventsProc64, To64(0));
                   FreeAndNil(ISSigDestF);
                   FreeAndNil(ISSigDestF);
                   { Download and verify the actual file }
                   { Download and verify the actual file }
                   DownloadFile(SourceFile, DownloadUserName, DownloadPassword,
                   DownloadFile(SourceFile, DownloadUserName, DownloadPassword,
-                    DestF, True, CurFile^.ISSigAllowedKeys, TempFile, ExtractorProgressProc);
+                    DestF, True, CurFile^.ISSigAllowedKeys, TempFile, ExternalProgressProc64, MaxProgress);
                 finally
                 finally
                   ISSigDestF.Free;
                   ISSigDestF.Free;
                   { Delete the .issig file }
                   { Delete the .issig file }
@@ -1597,7 +1606,7 @@ var
                 end;
                 end;
               end else
               end else
                 DownloadFile(SourceFile, DownloadUserName, DownloadPassword,
                 DownloadFile(SourceFile, DownloadUserName, DownloadPassword,
-                  DestF, False, '', '', ExtractorProgressProc);
+                  DestF, False, '', '', ExternalProgressProc64, MaxProgress);
             end
             end
             else begin
             else begin
               { Copy a duplicated non-external file, or an external file }
               { Copy a duplicated non-external file, or an external file }
@@ -3676,6 +3685,7 @@ type
     FBaseName, FUrl: String;
     FBaseName, FUrl: String;
     FOnDownloadProgress: TOnDownloadProgress;
     FOnDownloadProgress: TOnDownloadProgress;
     FOnSimpleDownloadProgress: TOnSimpleDownloadProgress;
     FOnSimpleDownloadProgress: TOnSimpleDownloadProgress;
+    FOnSimpleDownloadProgressParam: Integer64;
     FAborted: Boolean;
     FAborted: Boolean;
     FProgress, FProgressMax: Int64;
     FProgress, FProgressMax: Int64;
     FLastReportedProgress, FLastReportedProgressMax: Int64;
     FLastReportedProgress, FLastReportedProgressMax: Int64;
@@ -3684,6 +3694,7 @@ type
     property Url: String write FUrl;
     property Url: String write FUrl;
     property OnDownloadProgress: TOnDownloadProgress write FOnDownloadProgress;
     property OnDownloadProgress: TOnDownloadProgress write FOnDownloadProgress;
     property OnSimpleDownloadProgress: TOnSimpleDownloadProgress write FOnSimpleDownloadProgress;
     property OnSimpleDownloadProgress: TOnSimpleDownloadProgress write FOnSimpleDownloadProgress;
+    property OnSimpleDownloadProgressParam: Integer64 write FOnSimpleDownloadProgressParam;
     property Aborted: Boolean read FAborted;
     property Aborted: Boolean read FAborted;
     property Progress: Int64 read FProgress;
     property Progress: Int64 read FProgress;
     property ProgressMax: Int64 read FProgressMax;
     property ProgressMax: Int64 read FProgressMax;
@@ -3719,25 +3730,14 @@ begin
     if Abort then
     if Abort then
       FAborted := True
       FAborted := True
   end else if Assigned(FOnSimpleDownloadProgress) then begin
   end else if Assigned(FOnSimpleDownloadProgress) then begin
-    { Also see Compression.SevenZipDLLDecoder TArchiveExtractToHandleCallback.HandleProgress }
-    var Bytes := Progress - FLastReportedProgress;
-    while Bytes > 0 do begin
-      var BytesToReport: Cardinal;
-      if Bytes > High(BytesToReport) then
-        BytesToReport := High(BytesToReport)
-      else
-        BytesToReport := Bytes;
-      try
-        FOnSimpleDownloadProgress(BytesToReport);
-      except
-        if ExceptObject is EAbort then begin
-          Abort := True;
-          FAborted := True;
-          Break;
-        end else
-          raise;
-      end;
-      Dec(Bytes, BytesToReport);
+    try
+      FOnSimpleDownloadProgress(Integer64(Progress-FLastReportedProgress), FOnSimpleDownloadProgressParam);
+    except
+      if ExceptObject is EAbort then begin
+        Abort := True;
+        FAborted := True;
+      end else
+        raise;
     end;
     end;
     FLastReportedProgress := Progress;
     FLastReportedProgress := Progress;
   end;
   end;
@@ -3806,7 +3806,8 @@ end;
 function DownloadFile(const Url, CustomUserName, CustomPassword: String;
 function DownloadFile(const Url, CustomUserName, CustomPassword: String;
   const DestF: TFile; const ISSigVerify: Boolean; const ISSigAllowedKeys: AnsiString;
   const DestF: TFile; const ISSigVerify: Boolean; const ISSigAllowedKeys: AnsiString;
   const ISSigSourceFilename: String;
   const ISSigSourceFilename: String;
-  const OnSimpleDownloadProgress: TOnSimpleDownloadProgress): Int64;
+  const OnSimpleDownloadProgress: TOnSimpleDownloadProgress;
+  const OnSimpleDownloadProgressParam: Integer64): Int64;
 var
 var
   HandleStream: THandleStream;
   HandleStream: THandleStream;
   HTTPDataReceiver: THTTPDataReceiver;
   HTTPDataReceiver: THTTPDataReceiver;
@@ -3832,6 +3833,7 @@ begin
     HTTPDataReceiver := THTTPDataReceiver.Create;
     HTTPDataReceiver := THTTPDataReceiver.Create;
     HTTPDataReceiver.Url := CleanUrl;
     HTTPDataReceiver.Url := CleanUrl;
     HTTPDataReceiver.OnSimpleDownloadProgress := OnSimpleDownloadProgress;
     HTTPDataReceiver.OnSimpleDownloadProgress := OnSimpleDownloadProgress;
+    HTTPDataReceiver.OnSimpleDownloadProgressParam := OnSimpleDownloadProgressParam;
 
 
     HTTPClient := THTTPClient.Create; { http://docwiki.embarcadero.com/RADStudio/Rio/en/Using_an_HTTP_Client }
     HTTPClient := THTTPClient.Create; { http://docwiki.embarcadero.com/RADStudio/Rio/en/Using_an_HTTP_Client }
     SetUserAgentAndSecureProtocols(HTTPClient);
     SetUserAgentAndSecureProtocols(HTTPClient);

+ 8 - 1
Projects/Src/Shared.Int64Em.pas

@@ -2,7 +2,7 @@ unit Shared.Int64Em;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -31,6 +31,7 @@ function Mul64(var X: Integer64; N: LongWord): Boolean;
 procedure Multiply32x32to64(N1, N2: LongWord; var X: Integer64);
 procedure Multiply32x32to64(N1, N2: LongWord; var X: Integer64);
 procedure Shr64(var X: Integer64; Count: LongWord);
 procedure Shr64(var X: Integer64; Count: LongWord);
 function StrToInteger64(const S: String; var X: Integer64): Boolean;
 function StrToInteger64(const S: String; var X: Integer64): Boolean;
+function To64(const Lo: Longword): Integer64;
 
 
 implementation
 implementation
 
 
@@ -287,4 +288,10 @@ begin
   SetString(Result, PChar(@Buf[I]), (High(Buf) + 1) - I);
   SetString(Result, PChar(@Buf[I]), (High(Buf) + 1) - I);
 end;
 end;
 
 
+function To64(const Lo: Longword): Integer64;
+begin
+  Result.Lo  := Lo;
+  Result.Hi := 0;
+end;
+
 end.
 end.