DwinsHs_ReadRemoteURL function:

Downloads the given file or fetch the response immediately. Returns once the file has been downloaded, or the response has been received. The Setup window will not be frozen during downloading. If you click on the "Cancel" button or click on the window's Close button to exit the Setup wizard, the download operation will be terminated automatically.

Declaration:

type
  TReadMethod = (rmGet, rmPost, rmActive, rmPassive);
  #ifdef UNICODE// For UNICODE Inno Setup
  TOnRead = function (URL, Agent: AnsiString; Method: TReadMethod;
    Index, TotalSize, ReadSize, CurrentSize: Int64; var ReadStr: AnsiString): Boolean;
  #else // For ANSI Inno Setup
  TOnRead = function (URL, Agent: AnsiString; Method: TReadMethod;
    Index, TotalSize, ReadSize, CurrentSize: LongInt; var ReadStr: AnsiString): Boolean;
  #endif
#ifdef UNICODE // For UNICODE Inno Setup
function DwinsHs_ReadRemoteURL(URL, Agent: AnsiString; Method: TReadMethod; var Response:
  AnsiString; var Size: Int64; SaveFilename: string; OnRead: TOnRead): Integer;
#else // For ANSI Inno Setup
function DwinsHs_ReadRemoteURL(URL, Agent: AnsiString; Method: TReadMethod; var Response:
  AnsiString; var Size: LongInt; SaveFilename: string; OnRead: TOnRead): Integer;
#endif

Parameters:

Return:

Returns the error code in integer, it can be one of the following values:

If the error code is between 1 and 10, you can call the DllGetLastError function to retrieve a specific error message.

Note:

If you click on the "Cancel" button or click on the window's Close button to exit the Setup wizard, or change the value of global variable DwinsHs_CancelDownload to cdExit or cdBack, the download operation will be terminated automatically, and the function will returns the error code READ_ERROR_CANCELED (9).