VCLZip:
(*With VCLZip1 do
begin
ZipName := 'C:/BACKUP.ZIP';
FilesList.Add('C:/MYFILES/*.PAS'); /* Zip all .PAS files */
Recurse := True; /* Recurse directories */
StorePaths := True; /* Keep path information */
PackLevel := 9; /* Highest level of compression */
NumberZipped := Zip; /* Return value of Zip is the actual number of files zipped */
end;
---
With Unzipper do
begin
ZipName := 'c:/test/Zipfile.zip' // set the zip filename
ReadZip; // open it and read its information
// List filenames in zip file
for i := 0 to Count-1 do MemoPad.Lines.Add( Filename + #9 + Pathname );
// extract some files
// determine which files to unzip
FilesList.Add( '*.cpp' ); // unzip all .cpp files
FilesList.Add( 'myprog.exe' ); // unzip myprog.exe
FilesList.Add( '?<0-9>*/*.h' ); // .h files, if 2nd letter of dir starts with digit only
FilesList.Add( Filename[Count-1] ); // extract last entry in zipfile
DoAll := False; // Don't unzip all files
DestDir := 'c:/mydir' // Set destination directory
RecreateDirs := False; // don't recreate directory structures
RetainAttributes := True // Set attributes to original after unzipping
NumUnzipped := Unzip; // Extract files, return value is the number of files actually unzipped
end; *)