views:

2158

answers:

10

I need to compress multiple files into a single archive using Delphi. I'd prefer to use freeware components or open-source components because I am very very cheap :-)

My primary requirements are:

  1. Possible to encrypt the archive
  2. Can create common archives that can be opened by anyone with a copy of WinZip

Does anyone have suggestions with components that they have used? Please feel free to suggest free as well as commercial components/libraries.

+2  A: 

Have you looked at the answers to this question?

Craig Stuntz
I've considered that method, but the answers focus primarily on 7-zip type solutions. I'm also looking for some comments anyone has with their experience using these tools.
Mick
The advantage of 7-zip is that it works really, really well on any ZIP you ever throw at it. Other components tend to work mostly OK for *most* ZIPs.
Craig Stuntz
one other advantage is 7-zip does a better job of compressing the file - The 7z files are at least 30% smaller than a the zip file
Charles Faiga
+8  A: 

Perhaps DelphiZip is what you are looking for, it seems to support encryption, too, and is WinZip compatible. It is released under LGPL.

schnaader
A: 

Shell to the command line and get a free zip program to do the work?

John Paul Jones
That's not what I'm looking for. I want more control in order to retrieve such things as real progress indicators, as well as having no external application dependencies.
Mick
A: 

There are infozips zip32 and unzip32 dlls. They can be used from Delphi (even from Visual Basic), there are interface units/modules for both. The interface isn't as good as I would have liked it, but it works.

dummzeuch
A: 

You could use 7zip (LZMA) bindings for Pascal (compatible with Delphi): http://www.birtles.org.uk/programming/

Guillermo Bonvehi
+4  A: 

I recommend ZipForge from ComponentAce.

Erick Sasse
Agreed. It also supports Unicode file names.
TOndrej
A: 

Another Delphi resource to look at would be InnoSetup. The source code is available and with a little work might give you an edge up on what your trying to do. There is an option to create self extracting zip archives which are compatible with WinZip,

My thoughts are not to use the program, but to use his source as a starting point since it is very heavily tested and extremely solid.

skamradt
+2  A: 

I`m using madZip from madCollection

Alin Sfetcu
I wasn't even aware of this one. Nice!
Mick
A: 

I'm surprised no-one has mentioned JclCompression yet - it's part of the well-known Jedi Code Library (JCL). Here's a view of the unit itself : http://jcl.svn.sourceforge.net/viewvc/jcl/trunk/jcl/source/common/JclCompression.pas?view=markup

Note, it's compatible with 7-zip DLL version 4.64 - newer versions might not be backwards-compatible...

PatrickvL
+2  A: 

KaZip is an open-source ZIP archiver. Here is its description:

KAZIP is fast, simple ZIP archiver and dearchiver which uses most popular ZIP format.Inflate - Deflate zip compression format (no encryption support and no multidisk support).KAZip is totaly based on Delphi VCL - no DLL, ActiveX or other external libraries.KAZip is totaly stream oriented so you can deal with data only in memory without creating temporary files, etc. If you need to add zip-unzip functionality to your application,KAZIP is the right solution. Additional ZipListView and ZipTreeView components for easy visualisation.Functionality:Zip-Unzip using Inflate-DeflateBZip2 unzipping trough usage of BZIP2 units from Edison Mera Menndez.Functions:Adding Files, Folders, Streams; Selecting, Deselecting, Checking;Extracting to files and streams;Delete and Rename filesCreate, Delete and Rename foldersTest, RepairMany new properties and methods, improved speed.A very complex Zip Browser demo application is included

It is not compatible with Delphi 2009 yet, but with some minor changes in the source code, you can make it work in Delphi 2009 too. Actually, that's what I did.

Regards

vcldeveloper