Adds a remote file to the DwinsHs_DwonloadsList download queue, the file will be downloaded when the DwinsHs_CurPageChanged procedure is executed (the Setup wizard moves to the pre-defined downloading wizard page). You can use the DwinsHs_AppendMirrorFile procedure to add one mirror source, or add multile mirror sources for the remote file in the BeforeDownlaod callback function of the DwinsHs_CurPageChanged procedure.
You should use the procedure in the BeforeDownload callback function specified by the BeforeDownload parameter of the DwinsHs_CurPageChanged procedure.
For a remote file which added using the procedure, you need to install it by yourself using the Pascal script in the "[Code]" section, such as moving or extracting (if it is an archive) it to the application's folder, except the file was downloaded into the application's folder directly. You can do this in the AfterDownload callback procedure of the DwinsHs_CurPageChanged procedure, or the CurStepChanged event procedure.
type
TReadMethod = (rmGet, rmPost, rmActive, rmPassive);
#ifdef UNICODE // For UNICODE Inno Setup
procedure DwinsHs_AppendRemoteFile(Filename: string; URL, Agent: AnsiString;
Method: TReadMethod; FileSize: Int64);
#else // For ANSI Inno Setup
procedure DwinsHs_AppendRemoteFile(Filename: string; URL, Agent: AnsiString;
Method: TReadMethod; FileSize: LongInt);
#endif
Specifies the path and name of the local file the remote file will be saved as.
Specifies the full address of remote file, or specifies 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
Specifies 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.
Specifies 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:
Specifies the file size 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 if the parameter is set to FILESIZE_QUERY_SERVER (0), FILESIZE_UNKNOWN (-1), or FILESIZE_KEEP_FORMER (-2).
The procedure is avaliable only when the DwinsHs_Use_Predefined_Downloading_WizardPage marco is defined.
Copyright © 2001-2022, Han-soft Corporation. All rights reserved.