DIZipWriter is a Delphi component to create PKZip-compatible ZIP archives. Archive output is based on TStream and writes directlyfiles (TFileStream), memory (TMemoryStream), or database BLOBs (TBlobStream).
TDIZipWriter.CloseZip
returns the position of ZipStream
right after the end of the ZIP archive. This value can be used to trim the stream or file in case extra data was previously written by CloseCurrentEntry
which failed and reset the stream position.
Delphi compilers with support for the inline
directive (starting with Delphi 2005) failed to compile DIZipWriter *.bpl packages for the Demo and Commercial editions. They generated a “[dcc32 Fatal Error] DIUtils: F2051 Unit DIContainers was compiled with a different version of DIUtils.StrSameIW”. Regular *.exe applications compiled without problems. The DIZipWriter Source Code also compiled to both *.bpl packages and *.exe applications with no problems.
TYuBZip2Compressor
compression engine to bzip2 1.0.8.DI.inc
include file. Directly link in DICompilers.inc
instead.DI_No_ZipWriter_Component
compiler directive. TDIZipWriter
now always descends from TComponent
. Affects source code only.DI_No_Classes
compiler directive. The Classes
unit is always used. Source code only.DI_No_Range_Checking
compiler directive to DIC_Unsafe
. Source code only.TYuLzmaCompressor
sets end of stream flag as required by recent versions of 7-Zip.TDIWriter.Write
caused ZIP archives to be written incorrectly. Fixed.TDIZipWriter.DataType
property allows to determine the data type attribute for each ZIP entry. The options are dtBinary
, dtText
, or dtUnknown
. For the latter, TDIZipWriter
determines the data type automatically. This new property was explicitly requested by some users who found that certain ZIP software apparently unzips differently depending on the data type.TDIZipWriter
:Old: | New: |
---|---|
AddAnsiString | TDIZipWriter.AddStrA |
AddWideString | TDIZipWriter.AddStrW |
WriteAnsiString | TDIZipWriter.WriteStrA |
WriteWideString | TDIZipWriter.WriteStrW |
NewZipFile
and NewZipStream
have an OffSet
parameter which specifies the final position of the Zip archive within the output file or stream. While Offset
is usually zero, it might differ when appending a Zip archive to a SFX stub in order to create self extracting Zip archvies. There are SFX stubs freely available on the Internet.NewZipFile
now raises an exception just as any other new .zip file which can not be created.