I am having trouble unzipping files using the Delphi 3rd Party component FlexCompress. Here is the Code, detailed explanation after the code:
MyZipReader := TFlexCompress.Create(myComponent);
MyZipReader.Name := 'MyReader';
MyZipReader.FileName := DataPath; //e.g. C:\Users\thisUser\AppData\Local\Temp\ThisTempFolder\ThisZip.zip
MyZipReader.OpenArchive(fmOpenRead);
MyZipReader.BaseDir := BasePath; //e.g. C:\Users\[...]\ThisTempFolder\UnzipHere\
MyZipReader.CreateDirs := TRUE;
MyZipReader.ExtractCorruptedFiles := TRUE;
MyZipReader.ExtractFiles := ('*.*');
MyZipReader.closeArchive;
All files will be extracted and placed accordingly, so that's OK.
BUT: All files are empty. No text no nothing.
I have no idea what I am doing wrong. If I extract an archive I packed with Flexcompress everything is OK but if I try this with an external archive this behaviour occurs. Is there some sort of switch I am missing? I would be grateful about every tip or idea! I also tried the options ReplaceReadOnly
and overwriteMode
. Did not help and I am out of Ideas. If anyone knows some sort of FlexCompress forum I would also appreciate a link, maybe I could find info there? Sadly componentAce does not seem to host something like this.
Edit(2021.12.14 - 1.17pm)
Extra information gathered in the process:
One should not set the ExtractCorruptedFiles
property to TRUE. This will prevent the eventhandler from raising an exception within the extractFiles()
procedure