Extracting self-executing zip files lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- Caravelle · 2014-01-06 23:58 Hi Can some kind soul please advise a comparative beginner with Lazarus how I would go about dealing with some awkward compressed files.  I have no choice about the format, which seems unnecessarily over- complicated to me.  There are 4 zip files, downloaded from the internet, which contain .mdb files and I am seeking a one-click solution to the process of extracting the mdbs, reading the 7 tables contained in the mdbs and converting them to one sqlite table.  I have got the process of converting the mdb tables to sqlite all sorted out, the problem is extracting the 4 zip files to reveal the mdbs. The current long-winded process I am trying to avoid is this: download each of the 4 zip files; doubleclick on them to open them in Windows File Explorer.  Each one reveals a single .exe file.  When doubleclicked the .exe files open (after an unnecessary security warning) in WinRAR with a dialog to select the location to extract to and finally I click the "Extract" button.  Perhaps I should add that the filenames are always the same, the location they should be extracted to is always the same, and the tedious process has to be endured twice a week.  It must be possible to automate it somehow.  Please?    No point in discussing why the zips unzip into self- executing archives which then have to be un-archived, in my opinion it would be quicker to download the mdbs without any compression at all but as I said, I have no choice, that's how they are provided. Many thanks Caravelle ---------------------------------------------------------------------- BigChimp · 2014-01-07 10:46 $(fpcdir)\packages\paszlib\examples\extractodt.pas should get you started on extracting zip files (whether self extracting or regular). See also http://wiki.lazarus.freepascal.org/paszlib#TZipper ---------------------------------------------------------------------- Caravelle · 2014-01-07 18:40 Thank you, I shall start there.   I had been searching/Googling for hours, I found several components that promised to unzip but none mentioned self-executables in the description.  One looked promising but every time I clicked the URL to download it I got some pdf utility instead.  There comes a time when you just have to give up and ask for help ! Thanks again Caravelle ---------------------------------------------------------------------- Caravelle · 2014-01-07 20:09 Hi again It's taken a while to find the file you referred to, in the end I found it by using the search tool in Explorer.  The full path is: C:\lazarus\fpc\2.62\source\packages\paszlib\examples\ Cheers Caravelle ---------------------------------------------------------------------- Caravelle · 2014-01-07 21:45 All solved, thanks.  This works nicely: Code: [Select]procedure TForm1.Button2Click(Sender: TObject); begin   UnZipper := TUnZipper.create;   UnZipper.FileName := 'C:\Users\Michael\Downloads\PB_airl.zip';   UnZipper.OutputPath := 'C:\PlaneBase\Unzip';   UnZipper.Examine;   UnZipper.UnzipAllFiles;   UnZipper.FileName := 'C:\PlaneBase\Unzip\PB_airl.exe';   UnZipper.OutputPath := 'C:\PlaneBase\Unzip';   UnZipper.Examine;   UnZipper.UnzipAllFiles;   UnZipper.Free; end; All I have to do now is arrange things so that the program cycles through the various files, that shouldn't be a problem. Many thanks again. Caravelle