Pascal Scripting: CreateDownloadPage

Prototype:

function CreateDownloadPage(const ACaption, ADescription: String; const OnDownloadProgress: TOnDownloadProgress): TDownloadWizardPage;

Description:

Creates a wizard page to download files and show progress.

Set OnDownloadProgress to a function to be informed of progress, or nil otherwise.

Unlike the other types of wizard pages, progress pages are not displayed as part of the normal page sequence (note that there is no AfterID parameter). A progress page can only be displayed programmatically by calling its Show method.

Remarks:

Call the Show method to activate and show the page. When you're finished with it, call the Hide method to revert to the previous page.

Always put the Hide call inside the finally part of a try..finally language construct, as demonstrated in CodeDownloadFiles.iss. Not calling Hide will result in the wizard being permanently stuck on the progress page.

To add a new file to download, call the Add method. Always call the Clear method before adding the first file.

To start the download, call the Download method. An exception will be raised if there was an error. Otherwise, Download returns the number of bytes downloaded.

See DownloadTemporaryFile for other considerations and the definition of TOnDownloadProgress.

Example:

See CodeDownloadFiles.iss for an example.

See also:

TDownloadWizardPage
DownloadTemporaryFile
CreateOutputProgressPage