Pascal Scripting: ExtractArchive

Prototype:

procedure ExtractArchive(const ArchiveFileName, DestDir, Password: String; const FullPaths: Boolean; const OnExtractionProgress: TOnExtractionProgress);

Description:

Extracts the specified archive to the specified directory, with or without preserving full path names.

An exception will be raised if there was an error.

The supported archive formats, beyond .7z, and the support for password-protected and multi-volume archives, depend on the ArchiveExtraction [Setup] section directive.

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

When extracting without preservering path names (i.e. FullPaths is set to False), ensure that the archive does not contain multiple files with the same name. Doing so will help avoid file-in-use errors.

See CodeDownloadFiles.iss for an example of archive extraction using just a [Files] entry instead.

Remarks:

TOnExtractionProgress is defined as:

TOnExtractionProgress = function(const ArchiveName, FileName: String; const Progress, ProgressMax: Int64): Boolean;

Return True to allow the extraction to continue, False otherwise.

See also:

CreateExtractionPage
CreateDownloadPage
DownloadTemporaryFile
ExtractTemporaryFile