Creating Compressed (Zipped) Folder using Delphi

compressed-folder, delphi, winapi, winzip, zip

Solution

If you are using Delphi X2, just use TZipFile from System.Zip:

To Zip a folder, use:

TZipFile.ZipDirectoryContents('ZipFile.zip', 'C:\Zip\this\right\now');

To Zip files, use:

Zip := TZipFile.Create;
try
  Zip.Open('ZipFile.zip', zmWrite);

  Zip.Add('FileToBeZipped.txt');
  Zip.Add('ThisWillBeCompressedAgainForSureAndBecomeSmaller.zip');
finally
  Zip.Free;
end

Problem

Can I create Windows XP's Compressed (Zipped) Folder using Delphi?

Original source

Related problems