I need to extract a zip file with Delphi using the Abbrevia ABZIP module. But I would like to exclude files in the root of the zip file.
Example: my zip file contains this
myfile.txt
otherfile.txt
directory1\myfile.txt
directory2\file.txt
Now I would like to exclude \myfile.txt
but include \directory1\myfile.txt
I have tried the following:
procedure unzipFiles;
var
zp : TAbZipKit;
const
includepath = '*.*';
excludepath = '\myfile.txt'; // <<< various variants of "root" tried
begin
//
zp := TAbZipKit.Create(nil);
zp.OpenArchive(StartDir + '\zipfile.zip');
zp.BaseDirectory := StartDir;
zp.ExtractOptions := [eoCreateDirs, eoRestorePath];
zp.ExtractFilesEx(
includepath,
excludepath
);
zp.CloseArchive;
zp.Free;
end;
Which option am I missing to "catch" only the root location of "myfile.txt" ?
** EDIT ** : if there is a way to ONLY extract subdirectories, it would also be usable for me.