The global variable saves all download items which were added using the DwinsHs_AppendRemoteFile procedure or DwinsHs_Check function. These download items will be downloaded when the DwinsHs_CurPageChanged procedure is executed (the Setup wizard moves to the pre-defined downloading wizard page).
type
TReadMethod = (rmGet, rmPost, rmActive, rmPassive);
TDownloadItem = record
Filename: string;
URL: AnsiString;
Agent: AnsiString;
Method: TReadMethod;
#ifdef UNICODE// For UNICODE Inno Setup
FileSize: Int64;
RealSize: Int64;
#else// For ANSI Inno Setup
FileSize: LongInt;
RealSize: LongInt;
#endif
Required: Boolean;
Downloaded: Boolean;
end;
var
DwinsHs_DownloadsList: array of TDownloadItem;
You can change value of the global variable in the BeforeDownload callback function specified by the BeforeDownload parameter of the DwinsHs_CurPageChanged procedure.
The global variable DwinsHs_DownloadsList is a dynamic array, every array element is a TDownloadItem record, it contains the following fields:
Contains the path and name of the local file the remote file will be saved as.
Contains the full address of remote file, or contains the address of server script. the "http", "https" and "ftp" schemes are supported. Optional username, password and port number can be included. For "http" and "https" schemes, an optional parameters string can be included too.
Format:
[<scheme>://][<username>[:<password>]@]<host>[:<port>] [/<path>][?<parameters>]
For example:
http://username:password@www.mywebsite.com:8080/images/file.jpg
https://www.mywebsite.com/license/verify.php?license_key=xxx-xxx-xxx-xxx&license_type=2
ftp://username:password@www.mywebsite.com:2121/images/file.jpg
Contains the user agent string. Your server can use the string to determine whether the request is sent by your installation package, or determine which installation package sends the request, etc.
Contains the HTTP methods for an "http" or "https" request. Or the transfer mode for an "ftp" request. It can be one of the following values:
Contains the file size specified in the FileSize parameter of DwinsHs_AppendRemoteFile procedure or DwinsHs_Check function, in bytes. It will be used to caculate the download progress and remaining time. This avoids delays before the download begins because the script doesn't have to fetch the file size from the server.
Note, the file size will be fetched from the server and then be saved into the RealSize field if the field is set to FILESIZE_QUERY_SERVER (0), FILESIZE_UNKNOWN (-1), or FILESIZE_KEEP_FORMER (-2).
Contains the real file size which is fetched from server if the RealSize field is set to FILESIZE_QUERY_SERVER (0), FILESIZE_UNKNOWN (-1), or FILESIZE_KEEP_FORMER (-2), in bytes. Otherwisr it's equal to the value of FileSize field.
Its value is true after you add the remote file using the DwinsHs_AppendRemoteFile procedure or DwinsHs_Check function. It will be change to false if you use the DwinsHs_RemoveRemoteFile function or use the DwinsHs_RemoveAllRemoteFiles procedure to remove it.
Its value is true if the file has been downloaded successfully, and the file will be ignored when downloading files from remote server in the pre-defined downloading wizard page. Otherwise, its value is false, and the file will be downloaded when the DwinsHs_CurPageChanged procedure is executed (the Setup wizard moves to the pre-defined downloading wizard page), then its value will be change to true if the download completes successfully.
You can change it to false in the BeforeDownload callback function specified by the BeforeDownload parameter of the DwinsHs_CurPageChanged procedure, in order to re-download the remote file.
The variable is avaliable only when the DwinsHs_Use_Predefined_Downloading_WizardPage marco is defined.
Copyright © 2001-2022, Han-soft Corporation. All rights reserved.