Copyright: Copyright © 1998-2007 TZipMaster by Russell Peters  v1.79  Sep, 30, 2004


ZipMaster component
 TZipMaster - Version 1.79

Hierarchy	Properties	Methods	Events

TZipMaster is a control designed to simplify the handling of Zip compressed files.

Description:

TZipMaster is a non-visual VCL component for managing zip files with some functions being a wrapper for a combined version of freeware Zip and Unzip dlls.

At run time, DelZip179.dll must be present on the hard disk where the application can find it - in ?:\WINDOWS\SYSTEM32 or else in your application directory, or a directory in the PATH.

If the DLL is statically linked to the component then the IDE must be able to locate and load the DLL .

It is also possible for an application to access a compressed version of the DLL stored in the it's resources (dynamic binding only).

The DLL is now fully re-entrant so multiple components (or applications) can share a single DLL .

This DLL is based on the InfoZip Official Freeware Zip/Unzip source code, but they are NOT equivalent to InfoZip's DLL's. We have modified the InfoZip source code to enhance their ease-of-use, power, and flexibility for use with Delphi and C++ Builder.  Please do NOT contact InfoZip for issues regarding this port.

TZipMaster is a component that uses the Add, and Extract methods to create or add files to, and extract files from Zip archives. The component can create self-extracting archives with the ConvertSFX method.

TZipMaster can encrypt and decrypt files through the Password property.

The OnMessage event fires when the  DLL reports status. The Trace and Verbose properties control the amount of information written to the Message property.

Overview  of changes v1.79

    - for specific changes see Details

     - for full package file details see Source files

Possibility of static binding

Static binding is an option for this release. By defining the compiler directive STATIC_LOAD_DELZIP_DLL and including the DelZip179.lib into your application static binding of the dll is possible.

The component will use its TZMStaticBind class instead of the normally used TZMDynamicBind class

Destination tested first

Before an operation is started a test is made that the result can be written to the indicated destination. If a write operation fails the operation is aborted and an error message given.

TempDir only on Hard Disc

Only the hard disc is accepted as destination for the TempDir.

Any other device would be too slow.

Functions now allowed for multi-volume archives

Functions Rename, Delete, AddFreshen and AddUpdate are now allowed for multi-volume archives.

To perform these operations a temporary single archive is build out of the multi-volume, then the operation is executed and finally the multi-volume archive is recreated out of the temporary archive.

Languages

1    The Default version ( US English) for the error and warning message is always available. If no other language is provided or available the default will be used.

      2	If the component needs to be used with more than one language, the messages in the required languages can be included in a resource file in the application. By setting the Language property the corresponding messages will be extracted from this resource. The languages have to be included in this resource in a special format, the format and tool are explained in resource format

      3	During run-time information about the language is available via the LanguageInfo property.

Dll and SFX stub's in resource

The dll and the .bin stubs for the SFX in different languages can be stored in the same resource as the languages see also resource format

New properties

Language  the language to be used.

LanguageInfo  during run time gives information of languages included in the resources

SFXLanguage Indicates the language that will be used when the SFX is executed A number of different ZBSFXxx.bin (and ZBSFXxx.res) stubs have been made to support different languages

Build Gives the version of the component as an integer number.

Version Gives the version as a formatted string

DLL_Loaded Loads/Unloads the (dynamic) DLL.

DLL_Path returns the path that the dll loaded from

DLL_Version returns the dll version as a string

DLL_Build returns the dll version as an integer;

New internal SFX code

The Internal SFX code is now the same as that of the TZipMasterSFXPlus component with some adaptations for use inside TZipMaster.

 This is an adaption of the TZipSFX component arranged to have similar language capabilities to ZipMaster.

Changed property

The set of values for the property AddStoreSuffixes has been expanded with some file types that contain already compressed content.

New functions in ZMUtils

Following functions have been added to ZMUtils:

-	GetVolumeLabel

-	IsSameFile

-	IsWinXP

 Now Distributed under the GNU LESSER GENERAL PUBLIC LICENSE

updated 2007-06-28


InfoZip information
To obtain the official [image] source code consult their Website: http://freesoftware.com/pub/infozip/Info-ZIP.html


Bug Reports

TZipMaster

Bug reports for TZipMaster, TZipBuilder, Dll's and the Self Extracting Code:

DelphiZip mailing list:	delphizip@freelists.org

When reporting bugs please mention: your Delphi or C++Builder version, Your ZipMaster or ZipBuilder version and the operating system you are using.

For errors in the translation of ZipMaster and ZipBuilder resource files:

Brazilian (Portuguese) translation found in ZipMsgBR.rc and ZipMsgBR.res

Walter Campelo:	walter@weasistemas.com.br

Chinese (People Republic of China) translation found in ZipMsgCN.rc and ZipMsgCN.res

[ GB(K) - commonly used in China and Singapore for simplified Chinese writing.]

wxf.amm:	wxf.amm@usa.net

Catalan translation found in ZipMsgCT.rc and ZipMsgCT.res

Jordi March i Nogué:	march_ribot@teleline.es

Czech translation found in ZipMsgCZ.rc and ZipMsgCZ.res

Ivo Eichler:	eichler@sce.cz

Danish translation found in ZipMsgDK.rc and ZipMsgDK.res

Nicolaj:	nikse@post11.tele.dk

Dutch translation found in ZipMsgNL.rc and ZipMsgNL.res

Chris Vleghert:	cvleghrt@worldonline.nl

Finnish translation found in ZipMsgFI.rc and ZipMsgFI.res

Jussi Siponen:	JIS@online.tietokone.fi

French translation found in ZipMsgFR.rc and ZipMsgFR.res

Laurent Hilsz:	hlcd@wanadoo.fr or  hilsz@piedte.cea.fr

German translation found in ZipMsgDE.rc and ZipMsgDE.res

Markus Stephany:	mirbir.st@t-online.de

Greek translation found in ZipMsgGR.rc and ZipMsgGR.res

x_gate:	gate7__@hotmail.com

Hungarian translation found in ZipMsgHU.rc and ZipMsgHU.res

Gál Tamás: 	tamas@rubin.hu

Italian translation found in ZipMsgIT.rc and ZipMsgIT.res

Fabrizio Atza:	faatza@tin.it

Malaysia translation found in ZipMsgMY.rc and ZipMsgMY.res

Azrin Aris:	azrin@rndtm.net.my

Norwegian translation found in ZipMsgNO.rc and ZipMsgNO.res

Vegard Larsen:	veglar@frisurf.no

Polish translation found in ZipMsgPL.rc and ZipMsgPL.res

Marcin Koteras:	bacik@pluton.farm.amwaw.edu.pl

Romanian translation found in ZipMsgRO.rc

Cristian Musat:	cristianm@bcr.ro

Russian translation found in ZipMsgRU.rc and ZipMsgRU.res

Alex Ozerov:	ozerov@aha.ru

Serbian/Yugoslavia translation found in ZipMsgYU.rc and ZipMsgYU.res

Dejan Maksimovic:	dmaksimovic@yahoo.com or maksa@cent.co.yu

Spanish translation found in ZipMsgS1.rc and ZipMsgS1.res

Saludos de WalySoft:	waly1@usa.net

Swedish translation found in ZipMsgSW.rc and ZipMsgSW.res

Johan Lindgren:	johan.lindgren@tt.se

Taiwanese (Traditional Chinese) translation found in ZipMsgTW.rc and ZipMsgTW.res

[ Big5 - commonly used in Taiwan and Hong Kong for traditional Chinese writing.]

Michael Tsai:	easyman@ms2.seeder.net

For errors in the translation of the SFX resources and source files:

Catalan SFX translation as found in Sfx1.CT and SfxStringsCT.pas

Jordi March i Nogué:	march_ribot@teleline.es

Czech SFX translation as found in Sfx1.CZ and SfxStringsCZ.pas

Ivo Eichler:	eichler@sce.cz

German translation found in ZipMsgDE.rc and ZipMsgDE.res

Roland Ruder:	r.ruder@gmx.de

Polish SFX translation as found in Sfx1PL.res, SfxStringsPL.pas and SfxGbls.pas

Marcin Koteras:	bacik@pluton.farm.amwaw.edu.pl or delphins@friko.onet.pl

Portuguese(Standard) SFX translation as found in Sfx1PT.res and SfxStringsPT.pas

Escola Secundaria de Silves:	info@esec-silves.rcts.pt

Russian SFX translation as found in Sfx1RU.res and SfxStringsRU.pas

Alex Ozerov:	ozerov@aha.ru

Serbian/Yugoslavia translation as found in SfxYU.res and SfxStringsYU.pas

Dejan Maksimovic:	dmaksimovic@yahoo.com or maksa@cent.co.yu

Spanish SFX translation as found in Sfx1SP.res and SfxStringsSP.pas

"Danny":	travolta@mx2.redestb.es


Contact  Information

TZipMaster

The latest version of TZipMaster, TZipBuilder and additional information such as bug fixes is available from:

http://www.delphizip.org

Please forward any comments or suggestions to support list at:

e-mail:	delphizip@freelists.org

or

 	problems@delphizip.org


Copyright and distribution policyilTo:cve
Distribution Policy, Guidelines for Legal  Re-distribution

TZipMaster

1.	This applies to both end-users and developers.  The meat of this package is the .DLL files, and they are needed by all of your end-users if you use this ZIP package in your program.

2.	You must not charge money for any part of the ZIP package. Warning:  The primary concern here is if you will market a new package that is only slightly more than a verbatim copy of this package, or one of it's demos.  ANY release you sell is OK as long as you charge ONLY for the changes you make.

3.	You MUST either distribute the source code for this ZIP package, or give a WWW site where it can be obtained freely. This can be on a Help...About screen, in printed documentation, or in text files distributed with your package.  Yes, it does seem odd to have this requirement for end-users who aren't programmers, but there is no mistake.  After all, it isn't hard to give them a URL and a few words explaining what it is for.

4.	You must document the Info-Zip's WWW home page URL, but don't expect any help from the Info-Zip group, since my release is only a derivative of their work.  They are very busy doing support for their "official" releases. Since much of the DLL source code comes from them, they deserve to be mentioned.

5.	You must handle product support with your own end-users. This is needed because I don't have enough time to do support for end-users.

6.	I will handle support issues with programmers using this package on a time-available basis. Since this is being distributed as freeware, you can't expect the kind of support you'd get from a commercial vendor.  Please limit your questions to those that directly pertain to this ZIP package.

7.	You may NOT distribute executable versions of my demo programs to end-users without my approval.  These are only example applications to teach you how to use this package.

8.	Distributed under the GNU LESSER GENERAL PUBLIC LICENSE


Thanks
Thanks...

TZipMaster

A big THANKS to all those who helped me and/or suggested improvements along the way:

Roger Aelbrecht

    Raymond Allan

J.A. Bijsterbosch

Tim Borman

Sam Chan

Julien Ferraro

Sebastian Hildebrandt

Alexander Hofmann

Jim Hoops

Teus de Jong

Matthew Kent

Greg Lorriman

Harald Marschalek

Almer.S. Tigelaar

Kenan Uzay

João Lira

Bob Dolan


Licence

  GNU LESSER GENERAL PUBLIC LICENSE

       Version 2.1, February 1999

 Copyright (C) 1991, 1999 Free Software Foundation, Inc.

     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 Everyone is permitted to copy and distribute verbatim copies

 of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL.  It also counts

 as the successor of the GNU Library Public License, version 2, hence

 the version number 2.1.]

    Preamble

  The licenses for most software are designed to take away your

freedom to share and change it.  By contrast, the GNU General Public

Licenses are intended to guarantee your freedom to share and change

free software--to make sure the software is free for all its users.

  This license, the Lesser General Public License, applies to some

specially designated software packages--typically libraries--of the

Free Software Foundation and other authors who decide to use it.  You

can use it too, but we suggest you first think carefully about whether

this license or the ordinary General Public License is the better

strategy to use in any particular case, based on the explanations below.

  When we speak of free software, we are referring to freedom of use,

not price.  Our General Public Licenses are designed to make sure that

you have the freedom to distribute copies of free software (and charge

for this service if you wish); that you receive source code or can get

it if you want it; that you can change the software and use pieces of

it in new free programs; and that you are informed that you can do

these things.

  To protect your rights, we need to make restrictions that forbid

distributors to deny you these rights or to ask you to surrender these

rights.  These restrictions translate to certain responsibilities for

you if you distribute copies of the library or if you modify it.

  For example, if you distribute copies of the library, whether gratis

or for a fee, you must give the recipients all the rights that we gave

you.  You must make sure that they, too, receive or can get the source

code.  If you link other code with the library, you must provide

complete object files to the recipients, so that they can relink them

with the library after making changes to the library and recompiling

it.  And you must show them these terms so they know their rights.

  We protect your rights with a two-step method: (1) we copyright the

library, and (2) we offer you this license, which gives you legal

permission to copy, distribute and/or modify the library.

  To protect each distributor, we want to make it very clear that

there is no warranty for the free library.  Also, if the library is

modified by someone else and passed on, the recipients should know

that what they have is not the original version, so that the original

author's reputation will not be affected by problems that might be

introduced by others.

  Finally, software patents pose a constant threat to the existence of

any free program.  We wish to make sure that a company cannot

effectively restrict the users of a free program by obtaining a

restrictive license from a patent holder.  Therefore, we insist that

any patent license obtained for a version of the library must be

consistent with the full freedom of use specified in this license.

  Most GNU software, including some libraries, is covered by the

ordinary GNU General Public License.  This license, the GNU Lesser

General Public License, applies to certain designated libraries, and

is quite different from the ordinary General Public License.  We use

this license for certain libraries in order to permit linking those

libraries into non-free programs.

  When a program is linked with a library, whether statically or using

a shared library, the combination of the two is legally speaking a

combined work, a derivative of the original library.  The ordinary

General Public License therefore permits such linking only if the

entire combination fits its criteria of freedom.  The Lesser General

Public License permits more lax criteria for linking other code with

the library.

  We call this license the "Lesser" General Public License because it

does Less to protect the user's freedom than the ordinary General

Public License.  It also provides other free software developers Less

of an advantage over competing non-free programs.  These disadvantages

are the reason we use the ordinary General Public License for many

libraries.  However, the Lesser license provides advantages in certain

special circumstances.

  For example, on rare occasions, there may be a special need to

encourage the widest possible use of a certain library, so that it becomes

a de-facto standard.  To achieve this, non-free programs must be

allowed to use the library.  A more frequent case is that a free

library does the same job as widely used non-free libraries.  In this

case, there is little to gain by limiting the free library to free

software only, so we use the Lesser General Public License.

  In other cases, permission to use a particular library in non-free

programs enables a greater number of people to use a large body of

free software.  For example, permission to use the GNU C Library in

non-free programs enables many more people to use the whole GNU

operating system, as well as its variant, the GNU/Linux operating

system.

  Although the Lesser General Public License is Less protective of the

users' freedom, it does ensure that the user of a program that is

linked with the Library has the freedom and the wherewithal to run

that program using a modified version of the Library.

  The precise terms and conditions for copying, distribution and

modification follow.  Pay close attention to the difference between a

"work based on the library" and a "work that uses the library".  The

former contains code derived from the library, whereas the latter must

be combined with the library in order to run.

  GNU LESSER GENERAL PUBLIC LICENSE

   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any software library or other

program which contains a notice placed by the copyright holder or

other authorized party saying it may be distributed under the terms of

this Lesser General Public License (also called "this License").

Each licensee is addressed as "you".

  A "library" means a collection of software functions and/or data

prepared so as to be conveniently linked with application programs

(which use some of those functions and data) to form executables.

  The "Library", below, refers to any such software library or work

which has been distributed under these terms.  A "work based on the

Library" means either the Library or any derivative work under

copyright law: that is to say, a work containing the Library or a

portion of it, either verbatim or with modifications and/or translated

straightforwardly into another language.  (Hereinafter, translation is

included without limitation in the term "modification".)

  "Source code" for a work means the preferred form of the work for

making modifications to it.  For a library, complete source code means

all the source code for all modules it contains, plus any associated

interface definition files, plus the scripts used to control compilation

and installation of the library.

  Activities other than copying, distribution and modification are not

covered by this License; they are outside its scope.  The act of

running a program using the Library is not restricted, and output from

such a program is covered only if its contents constitute a work based

on the Library (independent of the use of the Library in a tool for

writing it).  Whether that is true depends on what the Library does

and what the program that uses the Library does.

  1. You may copy and distribute verbatim copies of the Library's

complete source code as you receive it, in any medium, provided that

you conspicuously and appropriately publish on each copy an

appropriate copyright notice and disclaimer of warranty; keep intact

all the notices that refer to this License and to the absence of any

warranty; and distribute a copy of this License along with the

Library.

  You may charge a fee for the physical act of transferring a copy,

and you may at your option offer warranty protection in exchange for a

fee.

  2. You may modify your copy or copies of the Library or any portion

of it, thus forming a work based on the Library, and copy and

distribute such modifications or work under the terms of Section 1

above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices

    stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no

    charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a

    table of data to be supplied by an application program that uses

    the facility, other than as an argument passed when the facility

    is invoked, then you must make a good faith effort to ensure that,

    in the event an application does not supply such function or

    table, the facility still operates, and performs whatever part of

    its purpose remains meaningful.

    (For example, a function in a library to compute square roots has

    a purpose that is entirely well-defined independent of the

    application.  Therefore, Subsection 2d requires that any

    application-supplied function or table used by this function must

    be optional: if the application does not supply it, the square

    root function must still compute square roots.)

These requirements apply to the modified work as a whole.  If

identifiable sections of that work are not derived from the Library,

and can be reasonably considered independent and separate works in

themselves, then this License, and its terms, do not apply to those

sections when you distribute them as separate works.  But when you

distribute the same sections as part of a whole which is a work based

on the Library, the distribution of the whole must be on the terms of

this License, whose permissions for other licensees extend to the

entire whole, and thus to each and every part regardless of who wrote

it.

Thus, it is not the intent of this section to claim rights or contest

your rights to work written entirely by you; rather, the intent is to

exercise the right to control the distribution of derivative or

collective works based on the Library.

In addition, mere aggregation of another work not based on the Library

with the Library (or with a work based on the Library) on a volume of

a storage or distribution medium does not bring the other work under

the scope of this License.

  3. You may opt to apply the terms of the ordinary GNU General Public

License instead of this License to a given copy of the Library.  To do

this, you must alter all the notices that refer to this License, so

that they refer to the ordinary GNU General Public License, version 2,

instead of to this License.  (If a newer version than version 2 of the

ordinary GNU General Public License has appeared, then you can specify

that version instead if you wish.)  Do not make any other change in

these notices.

  Once this change is made in a given copy, it is irreversible for

that copy, so the ordinary GNU General Public License applies to all

subsequent copies and derivative works made from that copy.

  This option is useful when you wish to copy part of the code of

the Library into a program that is not a library.

  4. You may copy and distribute the Library (or a portion or

derivative of it, under Section 2) in object code or executable form

under the terms of Sections 1 and 2 above provided that you accompany

it with the complete corresponding machine-readable source code, which

must be distributed under the terms of Sections 1 and 2 above on a

medium customarily used for software interchange.

  If distribution of object code is made by offering access to copy

from a designated place, then offering equivalent access to copy the

source code from the same place satisfies the requirement to

distribute the source code, even though third parties are not

compelled to copy the source along with the object code.

  5. A program that contains no derivative of any portion of the

Library, but is designed to work with the Library by being compiled or

linked with it, is called a "work that uses the Library".  Such a

work, in isolation, is not a derivative work of the Library, and

therefore falls outside the scope of this License.

  However, linking a "work that uses the Library" with the Library

creates an executable that is a derivative of the Library (because it

contains portions of the Library), rather than a "work that uses the

library".  The executable is therefore covered by this License.

Section 6 states terms for distribution of such executables.

  When a "work that uses the Library" uses material from a header file

that is part of the Library, the object code for the work may be a

derivative work of the Library even though the source code is not.

Whether this is true is especially significant if the work can be

linked without the Library, or if the work is itself a library.  The

threshold for this to be true is not precisely defined by law.

  If such an object file uses only numerical parameters, data

structure layouts and accessors, and small macros and small inline

functions (ten lines or less in length), then the use of the object

file is unrestricted, regardless of whether it is legally a derivative

work.  (Executables containing this object code plus portions of the

Library will still fall under Section 6.)

  Otherwise, if the work is a derivative of the Library, you may

distribute the object code for the work under the terms of Section 6.

Any executables containing that work also fall under Section 6,

whether or not they are linked directly with the Library itself.

  6. As an exception to the Sections above, you may also combine or

link a "work that uses the Library" with the Library to produce a

work containing portions of the Library, and distribute that work

under terms of your choice, provided that the terms permit

modification of the work for the customer's own use and reverse

engineering for debugging such modifications.

  You must give prominent notice with each copy of the work that the

Library is used in it and that the Library and its use are covered by

this License.  You must supply a copy of this License.  If the work

during execution displays copyright notices, you must include the

copyright notice for the Library among them, as well as a reference

directing the user to the copy of this License.  Also, you must do one

of these things:

    a) Accompany the work with the complete corresponding

    machine-readable source code for the Library including whatever

    changes were used in the work (which must be distributed under

    Sections 1 and 2 above); and, if the work is an executable linked

    with the Library, with the complete machine-readable "work that

    uses the Library", as object code and/or source code, so that the

    user can modify the Library and then relink to produce a modified

    executable containing the modified Library.  (It is understood

    that the user who changes the contents of definitions files in the

    Library will not necessarily be able to recompile the application

    to use the modified definitions.)

    b) Use a suitable shared library mechanism for linking with the

    Library.  A suitable mechanism is one that (1) uses at run time a

    copy of the library already present on the user's computer system,

    rather than copying library functions into the executable, and (2)

    will operate properly with a modified version of the library, if

    the user installs one, as long as the modified version is

    interface-compatible with the version that the work was made with.

    c) Accompany the work with a written offer, valid for at

    least three years, to give the same user the materials

    specified in Subsection 6a, above, for a charge no more

    than the cost of performing this distribution.

    d) If distribution of the work is made by offering access to copy

    from a designated place, offer equivalent access to copy the above

    specified materials from the same place.

    e) Verify that the user has already received a copy of these

    materials or that you have already sent this user a copy.

  For an executable, the required form of the "work that uses the

Library" must include any data and utility programs needed for

reproducing the executable from it.  However, as a special exception,

the materials to be distributed need not include anything that is

normally distributed (in either source or binary form) with the major

components (compiler, kernel, and so on) of the operating system on

which the executable runs, unless that component itself accompanies

the executable.

  It may happen that this requirement contradicts the license

restrictions of other proprietary libraries that do not normally

accompany the operating system.  Such a contradiction means you cannot

use both them and the Library together in an executable that you

distribute.

  7. You may place library facilities that are a work based on the

Library side-by-side in a single library together with other library

facilities not covered by this License, and distribute such a combined

library, provided that the separate distribution of the work based on

the Library and of the other library facilities is otherwise

permitted, and provided that you do these two things:

    a) Accompany the combined library with a copy of the same work

    based on the Library, uncombined with any other library

    facilities.  This must be distributed under the terms of the

    Sections above.

    b) Give prominent notice with the combined library of the fact

    that part of it is a work based on the Library, and explaining

    where to find the accompanying uncombined form of the same work.

  8. You may not copy, modify, sublicense, link with, or distribute

the Library except as expressly provided under this License.  Any

attempt otherwise to copy, modify, sublicense, link with, or

distribute the Library is void, and will automatically terminate your

rights under this License.  However, parties who have received copies,

or rights, from you under this License will not have their licenses

terminated so long as such parties remain in full compliance.

  9. You are not required to accept this License, since you have not

signed it.  However, nothing else grants you permission to modify or

distribute the Library or its derivative works.  These actions are

prohibited by law if you do not accept this License.  Therefore, by

modifying or distributing the Library (or any work based on the

Library), you indicate your acceptance of this License to do so, and

all its terms and conditions for copying, distributing or modifying

the Library or works based on it.

  10. Each time you redistribute the Library (or any work based on the

Library), the recipient automatically receives a license from the

original licensor to copy, distribute, link with or modify the Library

subject to these terms and conditions.  You may not impose any further

restrictions on the recipients' exercise of the rights granted herein.

You are not responsible for enforcing compliance by third parties with

this License.

  11. If, as a consequence of a court judgment or allegation of patent

infringement or for any other reason (not limited to patent issues),

conditions are imposed on you (whether by court order, agreement or

otherwise) that contradict the conditions of this License, they do not

excuse you from the conditions of this License.  If you cannot

distribute so as to satisfy simultaneously your obligations under this

License and any other pertinent obligations, then as a consequence you

may not distribute the Library at all.  For example, if a patent

license would not permit royalty-free redistribution of the Library by

all those who receive copies directly or indirectly through you, then

the only way you could satisfy both it and this License would be to

refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any

particular circumstance, the balance of the section is intended to apply,

and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any

patents or other property right claims or to contest validity of any

such claims; this section has the sole purpose of protecting the

integrity of the free software distribution system which is

implemented by public license practices.  Many people have made

generous contributions to the wide range of software distributed

through that system in reliance on consistent application of that

system; it is up to the author/donor to decide if he or she is willing

to distribute software through any other system and a licensee cannot

impose that choice.

This section is intended to make thoroughly clear what is believed to

be a consequence of the rest of this License.

  12. If the distribution and/or use of the Library is restricted in

certain countries either by patents or by copyrighted interfaces, the

original copyright holder who places the Library under this License may add

an explicit geographical distribution limitation excluding those countries,

so that distribution is permitted only in or among countries not thus

excluded.  In such case, this License incorporates the limitation as if

written in the body of this License.

  13. The Free Software Foundation may publish revised and/or new

versions of the Lesser General Public License from time to time.

Such new versions will be similar in spirit to the present version,

but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number.  If the Library

specifies a version number of this License which applies to it and

"any later version", you have the option of following the terms and

conditions either of that version or of any later version published by

the Free Software Foundation.  If the Library does not specify a

license version number, you may choose any version ever published by

the Free Software Foundation.

  14. If you wish to incorporate parts of the Library into other free

programs whose distribution conditions are incompatible with these,

write to the author to ask for permission.  For software which is

copyrighted by the Free Software Foundation, write to the Free

Software Foundation; we sometimes make exceptions for this.  Our

decision will be guided by the two goals of preserving the free status

of all derivatives of our free software and of promoting the sharing

and reuse of software generally.

    NO WARRANTY

  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO

WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.

EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR

OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY

KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE

IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR

PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE

LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME

THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN

WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY

AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU

FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR

CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE

LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING

RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A

FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF

SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH

DAMAGES.

     END OF TERMS AND CONDITIONS


Changes v1.79

TZipMaster

New -

Only one dll

    The dll's Zipdll.dll and Unzdll.dll have been combined into one single DelZip179.dll

Installer

    Uses MustangpeakComponentInstaller by  Jim Kueneman

    and Inno Setup version 5.1.6  by Jordan Russell

    to install and compile the component

Multiple Message languages

    Can select a language from multiple language resources stored compressed in the programs resources

New compiler directive

    STATIC_LOAD_DELZIP_DLL - Needs to be defined for static binding of the DelZip179.dll to the component.

    KEEP_BACKWARD - define to keep the old dual dll related functions

    USE_COMPRESSED_STRINGS - define to store compressed ZipMsgUS.res instead of using (larger) ResourceStrings.

Removed compiler directive

    NO_SFX - undefine INTERNAL_SFX instead and don't link to an external TZipSFX

New properties

published property Language: String - Indicates the required language for all messages

published property LanguageInfo: String - returns informat about languages that are included in the resource, only during run time

property SFXLanguage: string -

property Build: integer - gives the version of the component as an integer value

property Version: string - gives the version as a string

published property DLL_Loaded: boolean - loads/unloads the dll, returns true if loaded

property DLL_Build: integer - dll version as an integer

property DLL_Version: string - dll version as a string

property DLL_Path: string - path the dll loaded from

New functions in ZMUtils (was ziputils)

GetVolumeLabel: returns the Label for the given drive

IsSameFile: tests if the two filenames refer to the same file

IsWinXP: tests if the used OS is WinXP or later

Changed -

Properties

property AddStoreSuffixes: AddStoreExts - The set has been extended.

Methods

AddFreshen: now allowed for multi-volume archives

AddUpdate: now allowed for multi-volume archives

Rename: now allowed for multi-volume archives

Delete: now allowed for multi-volume archives

Unit Names

The unit names of most 'internal' units now begin ZM... to stop conflicts with ZipBuilder.


Changes v1.78

TZipMaster

Changes

   Delphi versions only 4 and above supported

   Dialogs and message boxes now go via new event OnZipDialog and, if not      handled, a new DialogBox.

   New Property

    property NotMainThread: Boolean; set true when running on thread

   OnAfterCallback renamed to OnCheckTerminate


Changes v1.77

TZipMaster

 Major Changes

Delphi versions only 4 and above supported

Directory Structure

  VCL - ZipMaster and ZipSFX files

  Packages - design- and run-time page files

  Dll - dlls and Dlls stored in resource

  Grid - sort grid (used in demos)

Configuration

  In VCL/ZipConfig.inc  {shown for maximum compatablity to earlier versions}

//   { $DEFINE NO_SPAN}  // uncomment to remove support for multi-part zip files

//   { $DEFINE NO_SFX}   // define to remove support for self expanding zip files

{$DEFINE INTERNAL_SFX}  // define to include TZipSFX as part of ZipMaster

//{$DEFINE USE_ALLZIPSTRINGS}  // define to use 'ResourceString's as default for all strings.

  No need to link ZipMsg??.res language file (US only but can translate using tools)

//{$DEFINE ALLOW_2G}  // makes OnProgressEvent handle large files but not compatable with earlier versions.

Files

  VCL\

   VCL\UnzDLL.pas 	- definitions UnzDll

   VCL\ZCallBck.pas 	- definitions for Callback structure

   VCL\ZipBase.pas 	- primitive part of internal class ZMaster

   VCL\ZipDLL.pas 	- definitions for ZipDll

   VCL\ZipMsg.pas 	- Error message Ident constants

   VCL\ZipMstr.pas 	- Main TZipMaster class definitions

   VCL\ZipPassDlg.pas 	- Password dialog

   VCL\ZipShldStrs.pas	- controllable read-only StringList

   VCL\ZipStrs.pas 	- default strings as ResourceStrings

   VCL\ZipStructs.pas 	- definitions of internal zip file structures

   VCL\ZipUtils.pas 	- some handy functions for handling zip files

   VCL\ZipXcpt.pas 	- definitions of EZipMaster the exceptions raised by ZipMaster

   VCL\ZLibLoad.pas 	- low level loader for dlls

   VCL\ZMaster.pas 	- internal class that does the work

   vcl\zipvers.inc	- include file for Delphi version constants

   vcl\zipconfig.inc	- include file to set options ('includes' zipvers.inc)

   VCL\ZipMstrReg.pas	- register TZipMaster

// TZipSFX by markus stephany (DZUtils slightly modified by me to share exception translation)

   VCL\DZUtils.pas

   VCL\SFXInterface.pas

   VCL\SFXStructs.pas

   VCL\ZipSFX.pas

   vcl\delver.inc

   vcl\lang2.inc

   vcl\missing_types.inc

   vcl\sfxver.inc

   Packages\ZM176R.dpk	- Run-time package (compile first)

   Packages\ZM176D.dpk	- Design package (Install last)

   DLL\ZipDll.dll	- compression routines

   DLL\UnzDll.dll	- extraction routines

   dll\resdlls.res	- dlls compressed and saved as resources (automatically extracted)

  Installation

     Compile the run-time package then install the design package

  Events

    Changed

  // FileSize changed to int64 to support 4G zip files {only if ALLOW_2G defined}

  TProgressEvent = procedure(Sender: TObject; ProgrType: ProgressType;

       Filename: string; FileSize: int64{cardinal}) of object;

    //  easier to use progress events

  TItemProgressEvent = procedure(Sender: TObject; Item: string;

       TotalSize: cardinal; PerCent: integer) of object;

  TTotalProgressEvent = procedure(Sender: TObject; TotalSize: int64{cardinal};

       PerCent: integer) of object;

    New

  TProgressDetailsEvent = procedure(Sender: TObject; details: TProgressDetails) of object;

   // gives bytes written to file {zip only}   see ZipBase.pas for details

  // new routines to alter stored / extracted names (full filename specified)

    TSetAddNameEvent = procedure(Sender: TObject; var FileName: String;

      const ExtName: String; var IsChanged: Boolean) of object;

    TSetExtNameEvent = procedure(Sender: TObject; var FileName: String;

    var IsChanged: Boolean) of object;

Properties

  New

    property Busy: Boolean  - read-only true while busy

    published property Active: Boolean  default true to allow operating (false just sets properties - no side effects)

Functions

    CopyFile renamed (stops conflict)

      function Copy_File(const InFileName, OutFileName: String): Integer;

    // in contents find first matching filename after idx

    function Find(const fspec: String; var idx: Integer): pZipDirEntry;

    // in contents find matching filename

    function IndexOf(const fname: String): Integer;

    // empty all records, strings and settings (not event handlers)

    // must use to reset after re-entry attempted

    procedure Clear;

    // new overloaded versions returns user's response

    function GetAddPassword(var Response: ZipPassDlg.TPasswordButton): String; overload;

    function GetExtrPassword(var Response: ZipPassDlg.TPasswordButton): String; overload;

    // Remove the Re-entry value from the Error code

    function TheErrorCode(errCode: integer): integer;

Constants

    Reentry_Error = $4000000; // 'or'ed with ErrCode if Re-entry attempted while was busy

    // note - that mostly this will not interupt the running process


Changes v1.73

TZipMaster

New -

  Compiler Definitions

INTERNAL_SFX

forces inclusion of integrated SFX support

  Component

TZipSFX

handles SFX operations

  Events

TZipStrEvent = procedure(Sender: TObject; ID: integer; var Str: String) of object;

  	TItemProgressEvent

= procedure(Sender: TObject; Item: string;  TotalSize, PerCent: cardinal) of object;

  	TTotalProgressEvent

= procedure(Sender: TObject; TotalSize, PerCent: cardinal) of object;

  Properties

OnZipStr: TZipStrEvent;

OnTotalProgress: TTotalProgressEvent;

OnItemProgress: TItemProgressEvent;

  Resource

ResDlls.res : the dlls stored as a resource

ZipNew173.rc : new resource strings - already included in ZipMsgUS.rc

   Other

AddOptions : addForceDest  - forces destination directory to exist

ExtrOptions : extrForceDir - forces destination directory to exist

Changed -

SFXSlave: TCustomZipSFX ;

link to external SFX engine

DirEntry : now returns pZipDirEntry

  	SortGrid (for Delphi 6 + ) changed to reduce exceptions in IDE

  	Latest SFX support

Removed -

   properties

MinZipDllVers	allways 1.73

MinUnzDllVers   allways 1.73

     if INTERNAL_SFX is not defined

SFXCaption	moved to SFXSlave (TZipSFX)

SFXCommandLine	moved to SFXSlave (TZipSFX)

SFXDefaultDir	moved to SFXSlave (TZipSFX)

SFXIcon 	moved to SFXSlave (TZipSFX)

SFXMessage 	moved to SFXSlave (TZipSFX)

SFXOptions 	moved to SFXSlave (TZipSFX)

SFXOverWriteMode 	moved to SFXSlave (TZipSFX)

SFXPath	 	moved to SFXSlave (TZipSFX)

  Directories

  	VCL      	- TZipMaster

 	VCL\Grid	- SortGrid

  	VCL\SFX 	- TZipSFX

     Delphi will need to find these directories (add to source path)


Changes V1.72

TZipMaster

New -

  Compiler Definitions

OLDSTYLE

forces inclusion of integrated SFX support

  Component

TZipSFXSlave

handles SFX operations

  constants

 BUSY_ERROR -255

returned when trying to re-enter function

  Events

  	TAfterCallbackEvent = Procedure(Sender: TObject; Var abort: boolean) Of Object;

  	TTickEvent = Procedure(Sender: TObject) Of Object;

  Functions

  	Busy: Boolean

true if operation in progress (not fully implemented yet)

Protected

        	CallBack(ActionCode, ErrorCode: integer; NameOrMsg: pChar; FileSize: cardinal;

 ZRec: PZCallBackStruct): integer;

called from ZCallback to handle callbacks

will be called in VCL for some operations to handle ProcessMessages

  Properties

  	SpanOptions: SpanOpts

controls handling disk/file spanning

spNoVolumeName,

Stops setting Disk Volume Name, use numbered files instead

spCompatName,

use alternate naming

spWipeFiles,

wipe files from new removable media (was AddDiskSpanErase)

spTryFormat

if spWipeFiles then try to do low level format instead of deleting files

(was FormatErase)

  	KeepFreeOnAllDisks: Cardinal

free space on all disks (KeepFreeOnDisk1 is added to it)

  	OnAfterCallback: TAfterCallbackEvent

called at end of callback processing

- used to stop calling ProcessMessages in multithread apps

- allows abort checking

- debug callbacks

  	OnTick: TTickEvent

called during slow dll operations to show activity

       	SFXSlave: TZipSFXBase;

link to external SFX engine

Removed

FormatErase

use SpanOptions spWipeFiles instead

Changed -

  	TProgressEvent = Procedure(Sender: TObject; ProgrType: ProgressType;

Filename: String; FileSize: cardinal) Of Object;

FileSize now cardinal (correctly handles large zips)

      To functions (not procedures) - return BUSY_ERROR if busy else ErrCode when finished

  	List

  	Add

  	AddStreamToFile

  	Extract

  	Delete

  	SortGrid (for Delphi 6 + ) changed to reduce exceptions in IDE

  	Latest SFX support

  Directories

  	VCL 	- TZipMaster

 	VCL\Grid	- SortGrid

  	VCL\SFX 	- TZipSFXSlave

 NOW COVERED BY GNU LESSER GENERAL PUBLIC LICENSE


{}
Hierarchy

TObject

   |

TPersistent

   |

TComponent

   |

TZipMaster


Source files

The required Delphi source files (files marked with '+' are written by ZipResMaker.exe)

    <install dir>\

            ZipMstr.pas	 - main component source

            ZipMstr.res	 - components version resource

            ZipVers.inc	 - required defines for Delphi versions (only 4..9 supported)

            ZipConfig.inc	 - sets compile options (see Configuration Settings)

            ZMCore.pas	 - basic support functions and event triggering

            ZMDBind.pas	 - dynamically loads and binds the dll

            ZMMsgStr.pas	 - handles message string storage and language selection

            ZMSBind.pas	 - statically binds the dll

            ZMWrkr.pas	 - does the work

            ZMXcpt.pas	 - EZipMaster definitions

            ZMDlg.pas	 - dialog box support

            ZMCtx.pas	 - Dialog box help context values

            ZMDelZip.pas	 - dll interface definitions

            ZMExtrLZ77.pas	 - extractor for LZ77 compressed streams

            ZipStructs.pas	 - definition of internal zip structures

+          ZMDefMsgs.pas	 - default message strings and tables

+          ZipMsg.pas	 - message values

            ZMUtils.pas	 - some functions to make life easier

            ZipSFX.pas	 - component to handle SFX operations (modified version of TZipSFX)

            SFXInterface.pas	 - types used by component

            SFXStructs.pas	 - SFX and zip internal structures

            missing_types.inc	 - types missing from various Delphi versions

            DelVer.inc	 - required defines for Delphi versions

DZUtils.pas	-  (modified) utility functions for ZipSFX

            Lang2.inc	 - defines for linked language

            ZipFix.pas	 - (optional) component to repair damaged zip files

            ZipFix.res	 -

            ZipFix.hlp	 -

            SortGrid.pas	 - (optional) sort grid component (used in Demos)

            SortGrid.res	 -

            SortGrid.dcr	 -

            SortGridreg.pas	 -

            SortGridPreview.pas	 -

            SortGridPreview.dfm	 -

    <install dir>\RES\

+          ZMRes.rc	 - resource script for compressed languages and dll

+          ZMRes.res	 - compiled resource for applications using ZipMaster (link to application)

+          *.bin	 - resource files required by ZMRes.rc

            dzsfx_all.res	 - SFX stub resources for all languages

            dzsfx*.res	 - SFX stub resource for individual language (* is language)

    <install dir>\Delphi\

            ZipMaster179D?.bpk	 - design and run-time package (? is compiler version)

            SortGridD?D.bpk	 - grid design package

            SortGridD?.bpk	 - grid run-time package

    ...\Design\

            ZipMstrReg.pas	 - register function

            ZipMstr.dcr	 - decoration

            ZipSFXReg.pas	 - register function

            ZipSFX.dcr	 - decoration

            SortGridReg.pas	 - register function

            SortGrid.dcr	 - decoration

    <install dir>\DLL\

            DelZip179.dll	 - required dll

            DelZip179.lib	 - library file for static binding the dll

    <install dir>\DOCS\

            licence.txt	 - a copy of the licence

ReadMe.txt

Install.txt

Debug.txt

    <install dir>\DLL\SOURCE\	 - C source files for the dlls (BCB 6)

    <install dir>\TOOLS\	 - some tools for building/updating

    <install dir>\TOOLS\RCUPD\	 - language string updater by Xavier Mor-Mur - Now a separate download

    <install dir>\TOOLS\ZIPRESMAKER\	 - resource maker for ZipMaster

    <install dir>\LANGS\

            ZipMsg.h	 - master message identifier header file

            ZipMsgUS.rc	 - master message script

            ZipMsg??.rc	 - resource language script files

            ZipMsg??.res	 - compiled language resource file

            SFX??.txt	 - language files for sfx

    <install dir>\HELP\

            ZipMaster.hlp	 - compiled help file (Delphi 7)

            ZipMaster.chm	 - compile html file

            dzsfx.chm	 - SFX help file

    <install dir>\HELP\SOURCE\	 - source files for help

   <install dir>\DEMOS\SortGrid\	 - Sortable column grid component used by some demos

 - Does NOT need to be installed

    <install dir>\DEMOS\DEMO1\	 - zip adder/extractor

    <install dir>\DEMOS\DEMO2\	 - quick add/extract and dll test

    <install dir>\DEMOS\DEMO3\	 - another add/extract example

    <install dir>\DEMOS\DEMO4\	 - simple self installer

    <install dir>\DEMOS\DEMO5\	 - make exe file (sfx)

    <install dir>\DEMOS\DEMO6\	 - span multiple disks

    <install dir>\DEMOS\DEMO7\	 - extract from stream

    <install dir>\DEMOS\DEMO9\	 - use in thread

  Note

    <install dir> is the installation directory - will need to be added to the search path


Resources

TZipMaster	See also:

Description

  ZipMaster can use multiple languages for it's messages and can also have a copy of the dll stored in resources.

  ZipResMaker is used to select which languages are included (US English is the default).


Resources see also
Resource Format

ZipResMaker


Resource Format

TZipMaster

From release 1.79 the component can get its required Dll and/or message strings in different languages from a resource integrated in the application.

The easiest way to create this resource with the languages you need is to use the ZipResMaker tool.

The ZipResMaker has a graphic user interface that let you choose all the elements you want in your resource and with a simple mouse click the resource is build for you. The resource file created is called ZMRes.res

Content of the resource file

The resource file is created using BRCC32 and file ZMRes.rc

Essentially the content of DelZip.rc is

#define  RDLL_Ver  11612

#define  RDLL_Dll  11613

#define  ZMRES_Str 11610

ZBRES_Str RCDATA LOADONCALL MOVEABLE DISCARDABLE "langs.bin"

RDLL_Dll RCDATA LOADONCALL MOVEABLE DISCARDABLE "DZ_Dll.bin"

STRINGTABLE {

RDLL_Ver, "1790020"

}

The ID definitions of all parts of the resource have to be the same as above, TZipMaster will use these values to find its resources.

The langs.bin file is the part that holds all the messages in the different languages, its format is explained below.

The DZ_Dll.bin is the normal delzip179.dll but compressed.

For usage during debugging inside the IDE we recommend to compress the dll using LZ77 see the ZipCompLZ77 for compression and ZipExtrLZ77 for extraction. Using the UPX compression tool can cause loading problems in the IDE

For normal usage outside the IDE use compression with the  UPX compression tool

The loader code for the Dll can handle both formats simultaneously

The value in the string table is the version values of delzip179.dll. This values is obtained by loading the dll and execute its GetDllPrivVersion function.

The version in the above example is 1.79.00.20

Format of the language file (langs.bin)

Each language is in the file as a single block.

The format for each languages is

Language id	1 word	(not implemented yet)

Length of label	1 word

Label	variable length 1 byte per character

Size of data	1 word

Data	variable length

The data part is compressed with the LZ77 compress method.

Before compression its content has following format:

Total number of words	1 word

Words in block1            	1 word

Block of data	variable

End marker = 0	1 word

The ID number is the number defined in the ZipMsg.h file.

The content of the WideString is the string as it can be found when the ZipMsgxx.rc file is converted to a ZipMsgxx.res file. The string is kept in Unicode format.

NOTE

The SFX stubs can also be added to the application resource by adding one of more of the DZSFXxx.res files directly.

The SFX loader code can handle both formats simultaneously.


UPX

The Ultimate Packer for eXecutables

Copyright (c) 1996-2002 Markus Oberhumer & Laszlo Molnar

 http://upx.sourceforge.net/


Configuration Settings

ZipMaster can be built with compiler conditionals that allow you to leave functions out that you do not need.

A tool - ZMConfig - is now available to edit the compiler configuration settings.

When you want to work with static binding define the STATIC_LOAD_DELZIP_DLL directive.

Make sure that the component, and the Delphi IDE, can find DelZip179.dll either in the Windows System directory or in the same directory as your application executable. The IDE may require it to be either in the 'bpl' or the 'bin' directory - depending upon version.

When you want to build without disk spanning then define NO_SPAN.

When built with NO_SPAN defined following properties are not available :

-	ConfirmErase

-	KeepFreeOnDisk1

-	KeepFreeOnAllDisks

-	MaxVolumeSize

-	MinFreeVolumeSize

Following methods are not available

-	ReadSpan

-	WriteSpan

Following events are not available

-	OnGetNextDisk

-	OnStatusDisk

To reduce code size if you don't want (or need) to use SFX functionality you may want to build using an external TZipSFX component to handle SFX functions

When built without INTERNAL_SFX defined the external component's properties and functions are used so

      the following properties are not available

     -     SFXCaption

     -     SFXCommandLine

     -     SFXDefaultDir

     -     SFXIcon

     -     SFXMessage

     -     SFXOptions

     -     SFXOverWriteMode

     -     SFXPath

     There will be an additional property

     -     SFXSlave

 To make the transition to the new version easier KEEP_BACKWARD can be defined to include the functions

   for the separate dlls.

     -     Load_Unz_Dll

     -     Load_Zip_Dll

     -     Unload_Unz_Dll

     -     Unload_Zip_Dll

     -     UnzDllPath

     -     ZipDllPath

     -     UnzVers

     -     ZipVers

ALLOW_2G define to use file with sizes larger than 2GigaBytes

When set the FileSize in OnProgress event and TotalSize in OnTotalProgress event are changed to type Cardinal instead of type integer

The default settings are

// uncomment to remove support for multi-part zip files

//{$DEFINE NO_SPAN}

// define to include SFXSlave

{$DEFINE INTERNAL_SFX}

// define to allow 'old' OnProgress to work with files above 2G

//{$DEFINE ALLOW_2G}

// undefine to use ResourceStrings

{$Define USE_COMPRESSED_STRINGS}

// define to statically load dll at program startup

{.$DEFINE STATIC_LOAD_DELZIP_DLL}

// define to keep backward compatible dll and sfx interface

{.$DEFINE KEEP_BACKWARD}


Scope

Published

Accessibility

Read-only


Properties
TZipMaster Properties

TZipMaster	Legend

In TZipMaster

AddCompLevel

AddFrom

AddOptions

AddStoreSuffixes

Cancel

Build **New

CodePage

ConfirmErase

Count

DirEntry

DirOnlyCount

DLL_Build **New

DLL_Loaded **New

DLL_Path **New

DLL_Version **New

DLLDirectory

ErrCode

ExtrBaseDir

ExtrOptions

FormatErase *removed

FSpecArgs

FSpecArgsExcl

FullErrCode

Handle

HowToDelete

IsSpanned

KeepFreeOnDisk1

KeepFreeOnAllDisks

Language **New

LanguageInfo **New

Message

MaxVolumeSize

MinFreeVolumeSize

       NotMainThread

Password

PasswordReqCount

RootDir

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOffset

SFXOptions

SFXOverWriteMode

SFXPath

SFXSlave

SpanOptions

SuccessCnt

TempDir

TotalSizeToProcess

Trace

Unattended

UnzBusy

UnzVers **Removed

Verbose

Version **New

ZipBusy

ZipComment

ZipContents

ZipEOC

ZipFileName

ZipFileSize

ZipSOC

ZipStream

ZipVers **Removed

Derived from TComponent


SFXSlave
TZipMaster.SFXSlave

TZipMaster	See also:

links external SFX engine

property SFXSlave: TZipSFX;

Description

  Links to the SFX engine

Note

  Only when compiled for external SFX support


SFXSlave see also
Configuration


FormatErase
TZipMaster.FormatErase

TZipMaster

Specifies erase type for spanned disk.

property FormatErase: Boolean; REMOVED

Replaced by spTryFormat in SpanOptions

Description:

If you set this to True, it will format a disk if AddDiskSpanErase is specified in AddOptions, otherwise it will delete all files.


SpanOptions
TZipMaster.SpanOptions

TZipMaster

Specifies options for spanned disk operations

property SpanOptions: SpanOpts;

New 1.72

Description:

This property is used to modify the default action of the Disk spanning operations.

If you want an option to be True, you need to add it to the Set.

The options (spNoVolumeName, spCompatName) may need to be the same for writing and reading zips

Example: ZipMaster1.SpanOptions:=[spNoVolumeName,spWipFiles];

Value	Meaning
spNoVolumeName	If True then will use numbered files on removable drives
spCompatName	If True then uses names of the form name.zip + name.z01 ...
spWipeFiles	If True, removes the files from the removable drive before writing.     WARNING: Deletes all files and Directories
spTryFormat	If True and spWipeFiles, try to Format removable disk.    WARNING: Wipes all files - non-recoverable


DirEntry property
TZipMaster.DirEntry

TZipMaster	See also:

ZipContents entry at index

property DirEntry[idx: integer]: pZipDirEntry;

Description

returns a pointer to ZipDirEntry from the ZipContents list

Example

// read filenames

for i:=0 to ZipMaster1.Count-1 do

  Memo1.Lines.Add(ZipMaster1.DirEntry[i]^.Filename);

Run-time only

Read-only


DirEntry see also
ZipDirEntry

ZipContents


Methods
TZipMaster Methods

TZipMaster

In TZipMaster

Add

AddStreamToFile

AddStreamToStream

AppendSlash

Busy

ConvertSFX

ConvertZIP

CopyFile

CopyZippedFiles

Delete

EraseFile

Extract

ExtractFileToStream

ExtractStreamToStream

FullVersionString

GetAddPassword

GetExtrPassword

GetPassword

List

Load_Unz_Dll **Removed

Load_Zip_Dll **Removed

MakeTempFileName

PathConcat

ReadSpan

Rename

ShowZipMessage

Unload_Unz_Dll **Removed

Unload_Zip_Dll **Removed

WriteSpan


PathConcat

TZipMaster

Global Function to join sections of path

function PathConcat(first, second: string): string;

Description

  	appends second to first ensuring single backslash.

ie

first + second = first\second

first\ + \second = first\second


FullVersionString
TZipMaster.FullVersionString

TZipMaster

The FullVersionString method returns the version information for ZipMaster and the dll.

function FullVersionString: String;

Description:

Returns the full version information of the ZipMaster component and the dll if it is loaded.

This includes the version numbers.


Scope

Published


Events
TZipMaster Events

TZipMaster	Legend

In TZipMaster:

OnCopyZipOverwrite

OnCRC32Error

OnDirUpdate

OnExtractOverwrite

OnExtractSkipped

OnFileComment

OnGetNextDisk

OnMessage

OnNewName

OnPasswordError

OnProgress Depreciated

            OnProgressDetails

OnSetNewName

OnStatusDisk

OnTick

OnTotalProgress  *new

OnItemProgress  *new

                  OnZipDialog

Special event for Threads

OnCheckTerminate

Event for multiple languages

OnZipStr  *new


AddCompLevel
TZipMaster.AddCompLevel

TZipMaster

AddCompLevel can be used to set the compression level when using Zip.

property AddCompLevel: Integer;

Description:

Compression Level.  Range 0 - 9, where 9 is the tightest compression.  2 or 3 is a good trade-off if you need more speed. Level 0 will just store files without compression. I recommend leaving this at 9 in most cases.


AddFrom
TZipMaster.AddFrom

TZipMaster	See also:

AddFrom can be used to set the Date for filtering files to add to a Zip.

property AddFrom: TDate;

New in version 1.70

Description:

The date used when the AddOption - AddFromDate is set, files dated on or after this date can be selected.


AddFrom see also
AddOptions

FSpecArgs


AddOptions
TZipMaster.AddOptions

TZipMaster

AddOptions is a Set of options to modify the default action of the Add method.

property AddOptions: AddOpts;

Description:

This property is used to modify the default action of the Add method. If you want an option to be True, you need to add it to the Set.

Example: ZipMaster1.AddOptions:=[AddDirNames,AddRecurseDirs];

Value	Meaning
AddArchiveOnly	If True then only files with their archive bit set will be added to the zip file. NOTE: When combined with AddFreshen or AddUpdate both conditions must be met i.e. the files to add must be newer also.
AddResetArchive	Clears the archive bit after a successful Zip Add action. It's not necessary to set AddArchiveOnly too.
AddDirNames	If True, saves the pathname with each filename. Drive ID's are never stored in Zip file directories. Unless AddSeparateDirs is also true, empty directories are not stored. NOTE: the root directory name is never stored in a pathname; in other words, the first character of a pathname stored in the zip file's directory will never be a slash.
AddForceDOS	If True, force all filenames that go into the Zip file to meet the DOS 8.3 restriction. If False, long filenames are supported.
AddZipTime	If True, set Zip timestamp to that of the newest file in the archive.
AddRecurseDirs	If True, subdirectories below EACH given file specification will be included in the Zip archive. Defaults to False. NOTE: It is also possible to override this option by setting some special characters at the beginning of a file specification look for this at the FSpecArgs property. WARNING: This is potentially dangerous if the user does this from the root directory. The hard drive may fill up with a huge Zip file!
AddHiddenFiles	If True, files with their Hidden or System attributes set will be included in the Add operation.
AddEncrypt	If True, add the files with standard zip encryption.  You will be prompted for the password to use.
AddSeparateDirs	if True , add separate entries to the zip archive that will hold the name of each directory even if empty (No data is stored for these entries). NOTE: - To use this, you must also have AddDirNames set. Also see: UseDirOnlyEntries
AddFromDate	If True, only add files created on or after AddFrom
AddForceDest	If True; force existence of destination directory
AddDiskSpan	if True, add the files and than write them to one or more disks. NOTE: - This can not be combined with AddFreshen or AddUpdate.  - Diskettes will not be formatted or erased!  - If on disk is less space available than MinFreeVolumeSize you will be prompted for a new one.
AddDiskSpanErase	if True, add the files and than write them to one or more disks. NOTE: - This can not be combined with AddFreshen or AddUpdate.  - All used diskettes will be erased first! ( Depending on the value of ConfirmErase you will be asked first if it's ok to do so.) Sets spWipeFiles in SpanOptions
NOTE: You can not have more than one of the following three options set to 'True'.  If all three are False, then you get a standard 'Add': all files in the file specifications will be added to the archive regardless of their date/time stamp.  This is also the default.

AddMove	If True, after adding to archive, delete original file. Potentially dangerous.  Use with caution!
NOTE: Freshen and Update normally work on pre-existing archives. Freshen can't create a new archive.

AddFreshen	If True, add newer files to archive (only for files that are already in the archive).
AddUpdate	If True, add newer files to archive (but, any file in an file specification that isn't already in the archive will also be added).


AddStoreSuffixes
TZipMaster.AddStoreSuffixes

TZipMaster

AddStoreSuffixes is a Set of options to modify the default action of the Add method.

property AddStoreSuffixes: AddStoreExts;

Description:

AddStoreSuffixes can be used to set the file extensions for files that will be stored in the zip file in stead of the normal deflate.

In versions < 1.6 this is fixed to .ARC, .ARJ, .GIF, .LZH, .PNG, .TAZ, .TGZ, .Z, .ZIP and .ZOO files.

Value	Default value
assGIF	True
assPNG	True
assZ	True
assZIP	True
assZOO	True
assARC	True
assLZH	True
assARJ	True
assTAZ	True
assTGZ	True
assLHA	True
assRAR	True
assACE	True
assCAB	True
assGZ	True
assGZIP	True
assJAR	True
assEXE	False
assEXT	False


Build
TZipMaster.Build

TZipMaster	see also:

the component build number

property Build: integer;

Read only

Description:

  returns the build number

     := (1.79 * 100000) + (REVISION * 100) + PATCHLEVEL


Build see also
Version

DLL_Build

DLL_Version


Busy
TZipMaster.Busy

TZipMaster

check operation still in progress

function Busy: boolean;

Description

returns true if an operation is in progress.


Cancel
TZipMaster.Cancel

TZipMaster

Cancel is used to abort any ongoing Add or Extract action.

property Cancel: Boolean;

Description:

If you set this to True, it will abort any Add or Extract processing now in action.  There may be a slight delay before the abort will take place. Note that a Zip file can be corrupted if an Add operation is aborted.


CodePage
TZipMaster.CodePage

TZipMaster	General info about codepages:

CodePage can be set to influence the way accented characters (or more general characters with a ASCII code > 127)  are read from the zip archive, more in particular the filenames and filecomments.

property CodePage: CPOpts;

Description:

CodePage is used in ZipMaster to implement the translation between the OEM codepages originally used by MS-DOS and the ISO codepages used with a slight modification by Windows '95, '98 and NT.

This property is not ment for general translation between languages, only zip filenames and comments made in a DOS or DOS like environment for one language can be translated into the windows equivalent for the same language.

But since codepages are different there is still a possibility that some characters are not or not completely translated.

Some possible codepage values for	OEM and	ISO:

Western European	850	1252

Amerca	437	1252

Eastern European	852	1250

You can set CodePage to one of the following values:

Value	Meaning
cpAuto	If set, ZipMaster will try to find the right codepage automatically. This can be unreliable in some cases (where the zip file does not identify it's host id correctly.) If your filenames seems to be messed-up you have to use one of the other two options.
cpISO	If set, filenames and file comments will NOT be converted in any way. NOTE: Needed for Norton Zip version 1. Needed for ZipMaster Zipfiles version 1.45 and before created with the option AddForceDOS set.
cpOEM	If set, filenames and file comments will be converted to ISO.


About Codepages
General Info About Codepages

Codepages are basically just a character sets. A standard MS-DOS character set used codepage 850, which is called the "OEM" codepage. Windows 3.1 used this codepage also. Most Windows 95 and Windows NT systems use codepage 1252, which is for America and Western Europe. This one is called "ISO 8859-1, Latin 1", which I will call "ISO". There are other OEM and ISO codepages, but I want to limit this discussion to the 850 and 1252  codepages.

Both the ISO and OEM codepages support the common accented characters used in Western Europe. However, the exact codes used for specific characters are different. Each of these also has some unique characters in the range $80 - $FF. We would like to be able to convert the accented character codes in the filenames when we extract them from a zip file.

In these two codepages, ISO and OEM, the bottom 128 codes are the same. Only the upper 128 codes are different. These upper codes are used for accented characters. Most ZIP files use only the lower 128 codes in their filenames, so the codepage used is irrelevant. It is only important when the non-English accented characters (or other upper codes) are used in filenames.

Each zip file header includes an indicator of which Operating System (OS) was used when it was created. We assume that the current OS is Win 95/98/NT using codepage 1252. If the zip file layout is based on codepage 850 ( i.e. was made on MS-DOS or Win 3.1 or made by WinZip ), then we can translate it so the extracted filenames will appear correctly. Note that this conversion can not be 100% accurate because each of these character sets has some unique symbols.

This is not an ideal world, though, and many zip files do not correctly identify which OS was used to make them. And, even if we know the OS it was made on, they may not have used codepage 850, and we may not be using codepage 1252 right now! So, I allow 3 different settings of the CodePage property so you can have full control over conversions.

In this release, you do not have the ability to convert text files made with one codepage to another codepage. At this time only  filenames and zip file comments can be converted.

What about the other codepages: Korean, Japanese, Hebrew, etc? I don't know any way of translating those codes to codepage 1252, because most of their characters do not exist in codepage 1252. However, if you are using the Korean codepage, and the people you give your zip files to are also using the Korean codepage, then no translation is necessary! If you want to make a zip file for use by people in other countries, then you should make it using codepage 1252.


ConfirmErase
TZipMaster.ConfirmErase

TZipMaster

ConfirmErase set ZipMaster to ask for confirmation before each disk will be erased when the AddDiskSpanErase option is set.

property ConfirmErase: Boolean;

Description:

If you set this to False, you will not be asked for confirmation before a disk is erased. If True and the answer is No, the disk in question will be used as it is. If there is not enough space available you will be prompted for a new one.

Default value = True


Count
TZipMaster.Count

TZipMaster

Count is the number of files in the Zip archive.

property Count: Integer;

Description:

The number of files now in the Zip file.  Updated automatically or manually via the List method.


DirOnlyCount
TZipMaster.DirOnlyCount

TZipMaster

DirOnlyCount is the number of directory only entries in the Zip archive.

__property int DirOnlyCount;

Description:

The number of directory only entries now in the Zip file. Updated automatically or manually via the List method.


DLLDirectory
TZipMaster.DLLDirectory

TZipMaster	Note  about the DLL:

DLLDirectory allows manual specification of the directory where the DLL's are stored.

property DLLDirectory: String;

Description:

The directory used for DelZip179.DLL when dynamically bound. Can end in a slash.

 This is an optional property if used, it overrides the Windows search path for DLL's.  If you specify a directory here, but the DLL is not actually in that dir, then the standard Windows search path will be consulted, anyway.

When dynamically binding is used (the default) a compressed version of the can be stored in the application resources; it is possible to force the use of this dll by specifying '><' (without the quotes).


DLL_Build
TZipMaster.DLL_Build

TZipMaster	See also:

Build of the loaded DLL

property DLL_Build: Integer;

Description:

  Returns the build number of the loaded DLL.

     := ( (1.79 * 1000000) + (REVISION * 100) + PATCHLEVEL )


DLL_Build see also
DLLDirectory

DLL_Loaded

DLL loading and unloading

DLL_Path

DLL_Version

DLL binding methods


DLL_Loaded
TZipMaster.DLL_Loaded

TZipMaster	See also:

Controls the loading/unloading of dynamically bound DLL

property DLL_Loaded: Boolean;

Description:

     Set True to load the DLL or False to unload it.

     Read it to check if the DLL is actually loaded.

Notes:

    Clearing it while an operation is running will unload when finished.

    Ignored if compiled with STATIC_LOAD_DELZIP_DLL defined.


DLL_Loaded see also
DLLDirectory

DLL loading and unloading

DLL_Build

DLL_Path

DLL_Version

DLL binding methods


DLL_Version
TZipMaster.DLL_Version

TZipMaster	See also:

Version of the loaded DLL

property DLL_Version: String;

Description:

  Returns the version number of the loaded DLL int the format '1.79.rr.pp'

   rr = revision  (01..99)

   pp = patch level (01.99)


DLL_Version see also
DLLDirectory

DLL_Loaded

DLL loading and unloading

DLL_Path

DLL binding methods


DLL Loading and Unloading

This table shows you which methods require the DLL:

Add

AddFileToStream

AddStreamToStream

Delete

Extract

ExtractFileToStream

ExtractStreamToStream

All other methods do not need the DLL.

NOTE:  'Test' is a sub-option of Extract.

NOTE: If static binding of the DLL to the component is used then the DLL is always loaded or the application (or the IDE) will not load.

The following properties give you control over loading and unloading the DLL

       DLLDirectory	optionally specify where to look for the DLL.

       DLL_Loaded	Set true to load the DLL, false to unload - returns true if loaded

       DLL_Path	returns the path from which the dll was loaded

       DLL_Build	returns the DLL build

       DLL_Version	returns the DLL version

For compatibility with older programs the loading and unloading will be done automatically if your program does not do it.

This can, however, incur performance penalty because it will reload the DLL for each operation.


DLL_Path
TZipMaster.DLL_Path

TZipMaster	See also:

Returns the path of the loaded dll.

property DLL_Path: string;

Description:

    Returns the path of currently loaded dll.


DLL_Path see also
DLLDirectory

DLL_Loaded

DLL loading and unloading

DLL_Build

DLL_Version

DLL binding methods


DLL binding methods

 see also: Configuration Settings

Static

     Windows loads the DLL when the application loads.

Note:

     If the component is installed in the Delphi IDE then the DLL must load when the IDE loads.

Dynamic

     The component loads the DLL when it is needed (or when told to do so).


ErrCode
TZipMaster.ErrCode

TZipMaster	See also:

ErrCode is the last error number reported by the DLL's or a resource message ID number if it is from the component.

property ErrCode: Integer;

Description:

Holds a copy of the last error code sent to your program by one of the DLL's or the component.

0 = No Error.

See the OnMessage event.  Most messages from the DLL's will have an ErrCode of 0.


ErrCode see also
FullErrCode

Message

Dll Error numbers

Dll log file


ZipMaster DLL error numbers
Possible error numbers given by the DLL

-8	Callback exception

-7	Critical error

-6	Bad struct 'C'

-5	No memory for 'Globals'

-4	'User' abort (cancel)

-3	Re-entry not allowed

-2	Abort requested again( already requested)

-1	Abort requested

 2	Unexpected end of zip file

 3	Zip file structure invalid

 4	Out of memory

 5	Internal logic error

 9	Aborted by user

10	Temporary file failure

11	Error reading a file

12	Nothing to do!

13	Missing or empty zip file

14	Error writing to a file

15	Error creating file

16	Bad zip options specified

18	File not found or no read permission


ExtAddStoreSuffixes
TZipMaster.ExtAddStoreSuffixes

TZipMaster

allows excluding a list of file suffixes

Property ExtAddStoreSuffixes: String;

Description

   Allows excluding extra suffixes from being compressed.

   Sets assEXT in AddStoreSuffixes

  ie ExtAddStoreSuffixes := '.tar,.gz'


ExtrBaseDir
TZipMaster.ExtrBaseDir

TZipMaster	See also:

ExtraBaseDir is base directory used for extracting a Zip archive.

property ExtrBaseDir: String;

Description:

This base directory applies only to 'Extract' operations.  The Unzip DLL will make this directory the current directory before extracting any files. If you don't specify a value for this property, then the directory of the ZipFile itself will be the base directory for extractions.


ExtrBaseDir see also
Extract


ExtrOptions
TZipMaster.ExtrOptions

TZipMaster

ExtrOptions is a Set of Options used to modify the default actions of the Extract method.

property ExtrOptions: ExtrOpts;

Description:

This property is used to modify the default action of the Extract method. If you want an option to be True, you need to add it to the Set.

Value	Meaning
ExtrDirNames	If True, extracts and recreates the relative pathname that may have been stored with each file. Empty directories stored in the archive (if any) will also be recreated.
ExtrOverWrite	If True, overwrite pre-existing files during Extraction. NOTE: -ReadOnly files will be overwritten too.  -If a file will be overwritten also depends on the return value set in the OnExtractOverwrite event if present. IMPORTANT: Files opened by other applications (Windows a.o.) with exclusive rights are not overwritten. In this case an OnExtractSkipped event will follow.
ExtrFreshen	If True, extract newer files from archive (only for files that already exist).  Won't extract any file that isn't already present.
ExtrUpdate	If True, extract files that don't already exist and if ExtrOverWrite is also set to true, it will extract newer files from the archive.
ExtrTest	If True, only test the archive to see if the files could be successfully extracted. Testing is done by extracting the files, but NOT writing the extracted data to the disk. Only the CRC code of the files is used to determine if they are stored correctly. To use this option, you will also need to define an Event handler for OnMessage. IMPORTANT: In this release, All files are tested not just some of them.
ExtrForceDirs	If True, forces the existence of the destination directory


FSpecArgs
TZipMaster.FSpecArgs

TZipMaster

FSpecArgs is a list of files used in the Add, Delete or Extract methods.

property FSpecArgs: TStrings;

Description:

Stringlist containing all the file specifications used as arguments for Add, Delete, and Extract methods. Every entry can contain MS-DOS wildcards.

If you give filenames without pathnames, or if you use relative pathnames with filenames, then the base drive/directory is assumed to be that of the Zipfile.

You can specify either the MS-DOS backslash path symbol, or the one normally used by PKZip ( the Unix path separator: / ). They are treated exactly the same.

Add, Delete, and Extract are the only methods that use FSpecArgs. The List method doesn't - it just lists all files.

You can easily combine many different filespecs into one Add, Delete, or Extract operation. For example:

It is also possible to override the AddRecurseDirs option of the AddOptions property by adding special characters at the beginning of any entry:

>	will force recursion into subdirectories.

|	will stop recursion into subdirectories.

NOTE:	This is only possible while Adding to a zip archive, When using Extract, Delete or CopyZippedFiles never use this!!!

Further it is possible to override the default password by appending the file specification with a '<' and then the new password or leave it empty to cancel an existing password temporarily as set in the Password property.

NOTE:	This is only possible while Adding to a zip archive, When using Extract, Delete or CopyZippedFiles never use this!!!

Add entries directly to the FSpecArgs property:

ZipMaster1.FSpecArgs.Add( 'C:\AUTOEXEC.BAT' );

ZipMaster1.FSpecArgs.Add( '*.EXE' );

ZipMaster1.FSpecArgs.Add( 'C:\WINDOWS\*.INI' );

And some special cases which can be used when adding to zip archive:

ZipMaster1.FSpecArgs.Add( '>C:\Windows\System\*.Dll' );	// Force recusion

ZipMaster1.FSpecArgs.Add( '|C:\Windows\*.exe' );	// Stop recursion

ZipMaster1.FSpecArgs.Add( 'C:\Bat\Test.txt*MyNewPassword' );	// A new password

ZipMaster1.FSpecArgs.Add( 'C:\Bat\Test.txt*' );	// Cancel existing password

Take the filespecs from a StringList, just assign them all over to ZipMaster1.

ZipMaster1.FSpecArgs.Assign( StringList1 );

Take the filespecs from a ListBox, just assign them all over to ZipMaster1.

ZipMaster1.FSpecArgs.Assign( ListBox1.Items );


FSpecArgsExcl
TZipMaster.FSpecArgsExcl

TZipMaster

FSpecArgsExcl is a list of files to exclude while using the Add and Delete methods.

property FSpecArgsExcl: TStrings;

Description:

Stringlist containing all the file specifications used as arguments for Add, and Delete methods. Every entry can contain MS-DOS wildcards.

You can specify either the MS-DOS backslash path symbol, or the one normally used by PKZIP ( the Unix path separator: / ). They are treated exactly the same.

When using full path names in FSpecArgs you must also use full path names in FSpecArgsExcl or appropriate wildcards like '*.tmp', '*test.*', this is important when the Add option AddRecurseDirs is set.

Add and Delete are the only methods that use FSpecArgsExcl. The List method doesn't - it just lists all files.

You can easily combine many different filespecs into one Add or Delete operation. For example:

Add entries directly to the FSpecArgsExcl property:

ZipMaster1.FspecArgsExcl.Add( 'C:\Builder\BIN\Builder.EXE' );

ZipMaster1.FspecArgsExcl.Add( 'C:\WINDOWS\*.TMP' );

ZipMaster1.FspecArgsExcl.Add( '*.TMP' );

Take the filespecs from a StringList, just assign them all over to ZipMaster1.

ZipMaster1.FspecArgsExcl.Assign( StringList1 );

Take the filespecs from a ListBox, just assign them all over to ZipMaster1.

ZipMaster1.FspecArgsExcl.Assign( ListBox1.Items );


FullErrCode
TZipMaster.FullErrCode

TZipMaster	See also:

FullErrCode is the last error number found by the DLL's.

property FullErrCode: Integer;

Description:

Holds a copy of the last error code sent to your program by one of the DLL's.

The difference between ErrCode and FullErrCode is:

1) FullErrCode is only used by both Dll's while ErrCode is also used for errors originating from the component.

2) There is extra information available in FullErrCode which ErrCode does not have.

To interpret this extra information you will have to perform a logical AND as follows.

FullErrCode and $00FF gives the same value as ErrCode.

FullErrCode and $FF00 gives a sequence number and with this number the exact location in the DLL where the error occurred can be found.

If this property is 0 then there is no error.


FullErrorCode see also
ErrCode

Message

OnMessage

Dll log file


Handle
TZipMaster.Handle

TZipMaster

Handle is the application window handle the DLL's will use to connect to some dialog boxes.

property Handle: THandle;

Description:

Used for some DLL generated dialogs.

Default it is set to the form where TZipMaster is created.


HowToDelete
TZipMaster.HowToDelete

TZipMaster

HowToDelete specifies on how EraseFile is going to delete a file.

property HowToDelete: DeleteOpts;

Description:

HowToDelete can take one of the following values:

Value	Meaning

htdFinal	Perform a DeleteFile.

htdAllowUndo	Move the old file into the recycle bin (The default).


IsSpanned
TZipMaster.IsSpanned

TZipMaster	See also:

IsSpanned gives an indication if the opened zip archive is a spanned archive.

property IsSpanned: Boolean;

Description:

IsSpanned returns True if the opened archive is a spanned archive, even if the 'set' consists of only one disk.


IsSpanned see also
ReadSpan

WriteSpan


KeepFreeOnDisk1
TZipMaster.KeepFreeOnDisk1

TZipMaster	See also:

KeepFreeOnDisk1 is used to keep some space available on the first disk of a spanned set.

property KeepFreeOnDisk1: Integer;

Description:

Holds a value in bytes and will use this value to keep bytes free on the first disk of a set of disks. For example to leave space for a setup program.

By default this is set to zero.

*new  This is in Addition to KeepFreeOnAllDisks


KeepFreeDisk1 see also
KeepFreeOnAllDisks


KeepFreeOnAllDisks
TZipMaster.KeepFreeOnAllDisks

TZipMaster	See also:

KeepFreeOnAllDisks is used to keep some space available on the first disk of a spanned set.

property KeepFreeOnAllDisks: Integer;

Description:

Holds a value in bytes and will use this value to keep bytes free on all disks of a set. For example to leave slack space CDs.

By default this is set to zero.


KeepFreeOnAllDisks see also
KeepFreeOnDisk1


Language
TZipMaster.Language

TZipMaster	See also:

Controls the message language.

Published property Language: string;

Description

   Sets and returns the current language.

usage

   Language := 'FR';	// set to French

   Language := '$040C';   // set to French

   Language := '1036';     // set to French

   Language := '12';        // set to any language it can find that has French as 'primary' language

   Language := '*';          // set to current user language

   Language := '1024';    // set to current user language

Notes

   if a language cannot be found the default 'US: English' will be used.

   Languages other than the default US require the resources to be linked to the application


Language see also
LanguageInfo

Message

OnMessage

Resources


LanguageInfo
TZipMaster.LanguageInfo

TZipMaster	See Also:

returns information about a language

property LanguageInfo[index: integer; info: cardinal]: string; Read-Only

Description:

  Index values

      < 0	- default US

         0	- current language

      > 0	- Available language number (requesting beyond available number of languages returns '><')

  Info values

      $FFFFFFFF - returns language identifier of language

      0	- returns name of language (i.e. 'SP'  = Spanish)

      Windows LOCALE_ prefixed values returns that information from Windows.

Example to list all available languages

   for i := 0 to 50 do

   begin

      s := LanguageInfo[ i, LOCALE_SENGLANGUAGE ];

      if s = '><' then

         break;

      Memo1.Lines.Add( s );

   end;


LanguageInfo see also
Language

Message

OnMessage

Resources


Message
TZipMaster.Message

TZipMaster	See also:

Message is the last message sent by the DLL.'s or the resource message string if it is from the component.

property Message: String;

Description:

Holds a copy of the last message sent to your program by one of the DLL's or the component. See the OnMessage event.


Message see also
ErrCode

FullErrCode

LanguageInfo

Language


MaxVolumeSize
TZipMaster.MaxVolumeSize

TZipMaster

MaxVolumeSize is used to set the maximum size of any archive part of a spanned set.

property MaxVolumeSize: Integer;

Description:

This property holds a value in bytes to set the maximum size of the destination zipfile on a disk.

This will be most useful if the destination disk is a harddisk.

The default is 0 which means the maximum size of a disk will be used. It is possible to use different sized disks interchangeable (ie. 720Kb or 1,44Mb)  (As long as they fit in the same drive.)


MinFreeVolumeSize
TZipMaster.MinFreeVolumeSize

TZipMaster

MinFreeVolumeSize is the minimum size a disk MUST have before it can be used in diskspanning.

property MinFreeVolumeSize: Integer;

Description:

This contains a value in bytes of the minimum available size a disk must have before it will be used to write (a part of) the archive.

The default is 65536 bytes.

NOTE:	It is not very practical to set this to a smaller value because you will need a lot of disks or get many files.


NotMainThread
TZipMaster.NotMainThread

TZipMaster

property NotMainThread: Boolean

Description

   When true it does not do some things that should be done when running on separate thread


Password
TZipMaster.Password

TZipMaster	See also:	Note on passwords:

Password is the password used when encrypting or decrypting a Zip archive.

property Password: String;

Description:

The user's encryption/decryption password. Setting a password to this property is not needed if you want to let the DLL's prompt the user for a password. This is only used if you want to prompt the user yourself.

It is possible to override this default Password by appending the file specification with an asterix * and then the new Password or leave it empty to cancel an existing password. Look for this at the FSpecArgs property.

WARNING:	If you set the password in the Object Inspector, and you never change the password property at runtime, then your users will never be able to use any other password.  If you leave it blank, the DLL's will prompt users each time a password is needed.


Password see also
GetAddPassword

GetExtrPassword

GetPassword

OnZipDialog


PasswordReqCount
TZipMaster.PasswordReqCount

TZipMaster	Note on passwords:

PasswordReqCount sets the number of times a password is requested (per file) while decrypting.

property PasswordReqCount: LongWord;

Description:

Password Request Count is used for setting the total number of times a password is requested per file in the ziparchive (by calling OnPasswordError). The maximum is 15 and the minimum = 0.

Setting it to 0 will make sure that a password is never requested, effectively skipping all encrypted files.

NOTE:	Setting this property while extracting is in progress does not have any effect until the next call to Extract.


RootDir
TzipMaster.RootDir

TZipMaster	See also:How to Use and Store Relative Paths

RootDir sets the base directory for relative file specifications.

property RootDir: String;

Description:

The RootDir property determines where zipping will start for any filenames or wildcard entries in the FSpecArgs property.

Example:

ZipMaster1.RootDir := 'D:\Program Files\Start';

ZipMaster1.FSpecArgs.Add( 'Dir1\MyFile.html' );

ZipMaster1.FSpecArgs.Add( '*.h' );

ZipMaster1.Add;

This will add the file "D:\Program Files\Start\Dir1\MyFile.htm" as "Dir1\MyFile.html"

and all files "D:\Program Files\Start\*.h" as "*.h" to the ziparchive.


SFXCaption
TZipMaster.SFXCaption

TZipMaster

SFXCaption is the caption of the SFX dialog box when you start executing a .EXE archive.

property SFXCaption: String;

Description:

When you start a executable which was build by ConvertSFX then this will be the caption of the dialog box you will see.

If you don't set it yourself "Self-extracting Archive" will be used as default.


SFXCommandLine
TZipMaster.SFXCommandLine

TZipMaster

SFXCommandLine can contain a command line to execute after extracting the executable.

property SFXCommandLine: String;

Description:

This is the command line that will be executed immediately after extracting the files.  Typically used to view the readme file, but can do anything. There is a predefined symbol that can be used in the command line to tell you which target directory was actually used.

Special symbols:

|    (Vertical bar) is the command / argument separator.

>< Is the actual extraction directory selected by user.

Example: notepad.exe|><Readme.txt

This will run notepad to show "Readme.txt" in the actual extraction dir.

You can also install .inf scripts, even with support for different sections depending on the

operating system

"><setup.inf" will run the [DefaultInstall] section of "EXTRACTPATH\setup.inf".

"><setup.inf|.ntx86" will run the [DefaultInstall] section if the User's OS is Win95/98,

but [DefaultInstall.ntx86] section if it's Windows NT.


SFXDefaultDir
TZipMaster.SFXDefaultDir

TZipMaster

SFXDefaultDir is the directory that will be used by the executable when extracting.

property SFXDefaultDir: String;

Description:

The directory can be changed in the SFX dialog box before extracting.

If you don't specify this, the user's current directory will be the default.

If you specify the special symbol >< here, then the user's temporary directory will be the default extraction directory.  A Windows API call will be used at runtime to determine the name of this directory.

The path can also be read from the user's registry by typing a registry key.

Some examples:

HKEY_LOCAL_MACHINE\

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WallPaperDir

HKEY_CURRENT_USER\Software\Borland\C++Builder\3.0\

HKEY_CURRENT_USER\Software\Borland\Delphi\4.0\

HKCU\Software\

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\

Also creating subfolders in these registry-read paths is possible by entering a pipe ( ' | ' )

and then the name of the new sub directory after the registry key.


SFXIcon
TZipMaster.SFXIcon

TZipMaster

SFXIcon sets the icon used when converting from .Zip to .Exe.

property SFXICon: TIcon;

Description:

Used to set a custom icon for the Self Extracting Archive. This is the picture you see in the explorer and on your desktop.

Because the original size of the icon in ZipSFX.bin has a fixed size, the size and number of colors used must be exactly the same this means: 32 x 32 pixels and 16 colors.

If you supply an icon which is not exactly the same you will get error -12 when using the ConvertSFX method.

This property is automatically set when converting (back) from .Exe to .Zip.


SFXMessage
TZipMaster.SFXMessage

TZipMaster

SFXMessage is used to specify a message given before the main extraction dialog shows itself.

property SFXMessage: String;

Description:

You can specify a message that will be displayed before the main extraction dialog pops up.

You can also specify the type of the message box:

-	Standard:	The messagebox shows an 'OK' button. The User cannot cancel starting the SFX application.

-	Information:	The messagebox shows the buttons 'OK' and 'Cancel'. if the User presses 'Cancel', sfx will stop.

Set the first character of the string to:  #1.

-	Confirmation:	The messagebox shows the buttons 'Yes' and 'No'. if the User presses 'No', sfx will stop.

Set the first character of the string to:  #2.


SFXOffset
TZipMaster.SFXOffset

TZipMaster

SFXOffset is the size of the self-extracting code at the beginning of the zipfile.

property SFXOffset: Integer;

Description:

SFXOffset is valid after a zip file's contents have been read successfully (which happens when you assign something to ZipFileName). When using non SFX zip files or when using diskspanning this will be zero.


SFXOptions
TZipMaster.SFXOptions

TZipMaster

SFXOptions is a Set of options used to modify the default actions of the ConvertSFX method.

property SFXOptions: SfxOpts;

Description:

If you want an option to be True or False, you need to add or subtract it to/from the Set.

Value	Meaning
SFXAskCmdLine	If True, allows user (at runtime) to de-select the SFX program's command line checkbox. Once de-selected, the command line will not be executed. NOTE: The checkbox doesn't appear unless there is a command line specified.
SFXAskFiles	If True, lets user (at runtime) modify the SFX program's list of files to be extracted.
SFXAutoRun	If True, extraction of the SFX contents will be performed automatically, no user actions are required.  NOTE: This works only if the SFX's filename starts with an exclamation mark ( ! ) -for security reasons- For example: !AUTORUN.EXE  WARNING: Use this only in rare cases! We advise you NOT to use this because files will be extracted onto the user's disk without his knowledge.
SFXCheckSize	If True, then the size of the SFX executable will be checked before extracting. By default checking is set to True. If size checking is off (False) and the SFX file layout is wrong it is very likely you will get a system error.
SFXHideOverWriteBox	If True, does NOT show the user (at runtime) the SFX program's dialog box that lets him choose the overwrite action for files that already exist.
SFXNoSuccessMsg	if True, the message given at the end of the extraction process will not be given.


SFXOverWriteMode
TZipMaster.SFXOverWriteMode

TZipMaster

SFXOverWriteMode sets the the action for what the SFX program is supposed to do if it finds files that already exist.

property SFXOverWriteMode: OvrOpts;

Description:

If the option 'SFXHideOverWriteBox' is True, then this option will be used during extraction.

SFXOverWriteMode can take one of the following values:

Value	Meaning

OvrConfirm	Ask user when each file is found  (The default).

OvrAlways	Always overwrite existing files.

OvrNever	Never overwrite - skip those files.


SFXPath
TZipMaster.SFXPath

TZipMaster

SFXPath is the path where ZipSFX.bin is stored.

property SFXPath: String;

Description:

SFXPath can be set to where the ZipSFX.bin file is located on disk. Must include the whole pathname, filename, and extension.

This is only used by the ConvertSFX method. If you don't give the location yourself ZipMaster will try to locate the file as following:

1. Location given by the SFXPath property. (This could be another name too.)

2. The current directory.

3. The application directory. (location of current .EXE file.)

4. The Windows System directory. (where DLL's go.)

5. The Windows directory. (where DLL's go.)

6. Location given by the DLLDirectory property.

When searching, the default name 'ZipSFX'.bin is used, except when given an explicit name by means of  this property.

SFXPath will be set to where ZipSFX.bin was found.


SuccessCnt
TZipMaster.SuccessCnt

TZipMaster

SuccessCnt is the number of files the DLL's could successfully handle.

property SuccessCnt: Integer;

Description:

Number of files that were successfully operated on (within the current Zip file). You can read this after every Add, Delete, and Extract operation.


TempDir
TZipMaster.TempDir

TZipMaster

TempDir is the path and directory that will be used instead of the default temporary directory.

property TempDir: String;

Description:

If TempDir is set to a drive/directory then this full path will be used.

While using Diskspanning:

This can be useful when spanning large archives.

If this property is not set then the used path is the system default temporary directory. This is either the path set with the TEMPDIR or TMPDIR environment variable or if both are not available the current directory on the current drive.

While using the DLL's:

If this property is not set then the used path is the same directory as where the zipfile is located.


TotalSizeToProcess
TZipMaster.TotalSizeToProcess

TZipMaster

TotalSizeToProcess is the total uncompressed size of all files going to be processed.

property TotalSizeToProcess: Cardinal;

Description:

Total uncompressed file size of all files going to be processed while doing an Add,  Extract or Test operation. It is set in the OnProgress event with event type: TotalSize2Process.

Change in V1.72 may change during operation but valid after processing is complete


Trace
TZipMaster.Trace

TZipMaster	See also:

Trace is an option to get extended messages from the DLL's

property Trace Boolean;

Description:

Similar to Verbose, except that this one is aimed at developers. It lets you trace the execution of the code in the DLL's. Helps you locate possible bugs in the DLL's, and helps you understand why something is happening a certain way.

NOTE:	Text messages for the Trace come to you through the OnMessage event.


Trace see also
Verbose

Unattended


Unattended
TZipMaster.Unattended

TZipMaster	See also:

Unattended is an option to make sure you won't get ANY error and/or warning messages from the component or the DLL's.

property Unattended: Boolean;

Description:

Default is that error or warning messages are given by the component/DLL's which need user interaction. With this property set to True ALL messages are suppressed. This also implies that you will not be visually informed of problems while executing your code.

If you want to use this property to test for bad zipfiles look at the following code:

// Set Unattended to avoid technical errors from being displayed.

// You can still catch error messages in your OnMessage handler, if you want.

ZipMaster1.Unattended := True;

// The open occurs when you assign the filename

ZipMaster1.ZipFileName := a_File_Name;

// If the zipfile is bad, the open fails and the filename is set to an empty string.

If ZipMaster1.ZipFileName = '' then

begin

// Do something: (skip) (check the ErrCode property) (write to a log file)

ShowMessage( 'Error in Zipfile' + IntToStr( ZipMaster1.ErrCode) );

end else

begin

ZipMaster1.Unattended := False;	// Not needed, depends on the next action

// Continue processing.

end;

// Turn on Unattended again in case there's another problem that we are not looking for.

ZipMaster1.Unattended := False;

NOTE1:	All messages are still available in the OnMessage event and the ErrCode and Message properties.

NOTE2:	For this to work correctly you must use DLL versions 1.5 or later.


Unattended see also
Message

Verbose

Trace


UnzBusy
TZipMaster.UnzBusy

TZipMaster

UnzBusy gives the status from the UnZip process.

property UnzBusy: Boolean;

Description:

If True, an Unzip operation is processing - you must delay your next Extract operation until this is False. You won't need to be concerned about this in most applications. This can be used to synchronize UnZip operations in a multi-threaded program.


UnzVers
TZipMaster.UnzVers

TZipMaster

UnzVers gives the version number of the UnZip DLL.

property UnzVers: Integer;

Deleted

Description:

The version number of UNZDLL.DLL. For example, 160 = version 1.60.


UseDirOnlyEntries
TZipMaster.UseDirOnlyEntries

TZipMaster	See also:

UseDirOnlyEntries can be set to include directories in the ZipDirEntry records.

property UseDirOnlyEntries: Boolean;

Description:

UseDirOnlyEntries can be set to True to include directories in the ZipDirEntry structures, default is False because on a windows system directory only entries are not needed and normally not present in a ziparchive.


UseDirOnlyEntries see only
DirEntry

DirOnlyCount

Count


Verbose
TZipMaster.Verbose

TZipMaster	See also:

Verbose is an option to get more messages from the DLL's

property Verbose: Boolean;

Description:

If True, ask for the maximum amount of "possibly important" information from the DLL's.  The informational messages are delivered to your program via the OnMessage event, and the ErrCode and Message properties. This is primarily used to determine how much info you want to show your "end-users" - developers can use the Trace property to get additional information.


Verbose see also
Trace

Unattended

OnMessage


ZipBusy
TZipMaster.ZipBusy

TZipMaster

ZipBusy gives the status from the Zip process.

property ZipBusy: Boolean;

Description:

If True, a Zip operation is processing - you must delay your next Add/Delete operation until this is False.  You won't need to be concerned about this in most applications. This can be used to synchronize Zip operations in a multi-threaded program.


ZipComment
TZipMaster.ZipComment

TZipMaster

Use ZipComment to set and if present get, the comment appended to the zip file.

property ZipComment: String;

Description:

Setting this property during runtime will change the comment in the ziparchive.

Every ziparchive(file) can have a general comment appended to it. This comment is not zipped and may have a maximum size of 64K. It is however not desirable to have a comment of this size because it is not packed. A better solution would be to use and include an ASCII file (i.e. xxx.DIZ) in the zipped archive.

To build an archive with a comment, set ZipComment after setting the ZipFilename


ZipContents
TZipMaster.ZipContents

TZipMaster

ZipContents is a list of Zip archive information.

property ZipContents: TList;

Description:

TList that contains the directory of the archive specified in the ZipFileName property. Every entry in the list points to a ZipDirEntry record.  This is automatically filled with data whenever an assignment is made to ZipFileName, and can be manually filled by calling the List method. For your convenience, this VCL hides the TList memory allocation issues from you. Automatic updates to this list occur whenever this VCL changes the Zip file. The event OnDirUpdate is triggered for you each time this list is updated - that is your queue to refresh your directory display.

Each entry in the ZipContents TList is a pointer to ZipDirEntry record;

DEPRECIATED

Replaced by DirEntry.


ZipDirEntry
TZipMaster.DirEntry

TZipMaster

ZipDirEntry is a record of Zip archive file information.

record ZipDirEntry;

Description:

TList that contains the directory of the archive specified in the ZipFileName property. Every entry in the list points to a ZipDirEntry record.  This is automatically filled with data whenever an assignment is made to ZipFileName, and can be manually filled by calling the List method. For your convenience, this VCL hides the TList memory allocation issues from you. Automatic updates to this list occur whenever this VCL changes the Zip file. The event OnDirUpdate is triggered for you each time this list is updated - that is your queue to refresh your directory display.

Each entry in the ZipContents TList is a pointer to ZipDirEntry record:

ZipDirEntry = packed Record

MadeByVersion	: Byte;

HostVersionNo	: Byte;

Version	: Word;

Flag	: Word;

CompressionMethod	: Word;

DateTime	: LongInt;	{ Time: Word; Date: Word; }

CRC32	: LongInt;

CompressedSize	: LongInt;

UncompressedSize	: LongInt;

FileNameLength	: Word;

ExtraFieldLength	: Word;

FileCommentLen	: Word;

StartOnDisk	: Word;

IntFileAttrib	: Word;	{ Some zip programs set bit 0 to indicate a text file. }

ExtFileAttrib	: LongWord;	{ The low-order byte is the orig. directory attributes for this file. }

RelOffLocalHdr	: LongWord;

FileName	: String;

FileComment	: String;

Encrypted	: Boolean;

ExtraData	: pChar;	{ ExtraFieldLength bytes from the central header. }

end;


MadeByVersion
This indicates the version number of the software used to encode the file.  The value / 10 indicates the major version number and the value mod 10 is the minor version number.


Encrypted
This indicates if you need a password to extract the file.


Flag
Bit 0: If set, indicates that the file is encrypted.

If method 6 Imploding is used:

Bit 1:	If set, indicates an 8K sliding dictionary was used. if clear, then a 4K sliding dictionary was used.

Bit 2:	If set, indicates 3 Shannon-Fano trees were used to encode the sliding dictionary output.  If clear, then 2 Shannon-Fano trees were used.

If method 8 Deflating is used:

Bit 2  Bit 1

0	0	Normal compression option was used.

0	1	Maximum compression option was used.

1	0	Fast compression option was used.

1	1	Super Fast compression option was used.

NOTE1:	Bits 1 and 2 are undefined if the compression method is any other.

Bit 3:	If this bit is set, the fields CRC32, CompressedSize and UncompressedSize are set to zero.  The correct values are put in the data descriptor immediately following the compressed data.

NOTE2:	The upper three bits are reserved and used internally by some software when processing the zipfile. The remaining bits are unused.


Zip Operating systems
Type of operating system used to make archive:

0	- MS-DOS, OS/2 and Win32

1	- Amiga	2	- VAX / VMS

3	- Unix	4	- VM / CMS

5	- Atari ST	6	- OS/2 H.P.F.S.

7	- Macintosh	8	- Z-System

9	- CP/M	10	- TOPS20

11	- NTFS	12	- QDOS

13	- Acorn	14	- VFAT W'95 and NT

15	- MVS	16	- BeOS

17	- Tandem / NSK	18	thru 255 - unused


Version
TZipMaster.Version

TZipMaster	see also:

Version string

property Version: string;

Read only

Description:

  returns a formated string of the built ZipMaster version '1.79.01.01'


version see also
Build

DLL_Version

DLL_Build

FullVersionString


Zip Compression Methods
0	- The file is stored (no compression)

1	- The file is Shrunk

2	- The file is Reduced with compression factor 1

3	- The file is Reduced with compression factor 2

4	- The file is Reduced with compression factor 3

5	- The file is Reduced with compression factor 4

6	- The file is Imploded

7	- Reserved for Tokenizing compression algorithm

8	- The file is Deflated

9	- Reserved for enhanced Deflating

10	- PKWARE Date Compression Library Imploding


ZipEOC
TZipMaster.ZipEOC

TZipMaster	See also:

ZipEOC contains the location measured from the start of the zip file of the End-Of-Central-Dir.

property ZipEOC: Integer;

Description:

ZipEOC is valid after a zip file's contents have been read successfully (which happens when you assign something to ZipFileName).


ZipEOC see also
ZipSOC


ZipFileName
TZipMaster.ZipFileName

TZipMaster

ZipFileName contains the Zip archive filename.

property  ZipFileName: String;

Description:

Pathname of a Zip archive file.  If the file doesn't already exist, you will only be able to use the Add method.  It is recommended to use a fully qualified pathname in this property, unless your program can always ensure that a known directory will be the "current" directory.

NOTE:	Some filenames are illegal (operating system issue) like Con, Com1, Com2, LPT1-LPT9.

NOTE:	When you assign a value to this property, the contents of the zipfile will be read into ZipContents.


ZipFileSize
TZipMaster.ZipFileSize

TZipMaster

ZipFileSize contains the size of entire Zip file (if it's a spanned set, then size of the last chunk).

property ZipFileSize: Integer;

Description:

ZipFileSize is valid after a zip file's contents have been read successfully (which happens when you assign something to ZipFileName).


ZipSOC
TZipMaster.ZipSOC

TZipMaster	See also:

ZipSOC contains the location measured from the start of the zip file of the Start-Of-Central-Dir.

property ZipSOC: Integer;

Description:

ZipSOC is valid after a zip file's contents have been read successfully (which happens when you assign something to ZipFileName).


ZipSOC see also
ZipEOC


ZipStream
TZipMaster.ZipStream

TZipMaster	See also:

ZipStream is a TMemoryStream descendant used for all zip streaming activities.

property ZipStream: TZipStream;

Description:

TZipStream is a descendant of TMemoryStream that is automatically created and finally destroyed for you. You are not allowed to delete this stream but you can use all other stream methods a.o. Clear it after use to preserve memory.

It is used for all ZipMasters methods on data streams.

For convenience the SetPointer method of TCustomMemoryStream is made public in this descendant and as such ready to use.

NOTE:	Although ZipStream.Memory is read-only, the data it is pointing to can be read and written.


ZipStream see also
ExtractFileToStream

ExtractStreamToStream

AddStreamToFile

AddStreamToStream


ZipVers
TZipMaster.ZipVers

TZipMaster

ZipVers gives the version number of the Zip DLL.

property ZipVers: Integer;

Deleted

Description:

The version number of ZIPDLL.DLL. For example, 170 = version 1.70.


Add
TZipMaster.Add

TZipMaster	See also:

The Add method adds the specified files to the archive.

function Add: integer;

changed

Description:

Adds all files specified in the FSpecArgs property into the archive specified by the ZipFileName property.

Files specified by the AddStoreSuffixes set, that are already compressed, will not be compressed again, but will be stored "as is" in the archive. This applies normally to .ARC, .ARJ, .GIF, .LZH, .PNG, .TAZ, .TGZ, .Z, .ZIP and .ZOO files. Note that .JPG files WILL be compressed, since they can still be squeezed down in size by a notable margin.

It is also possible to use relative paths but your own program has to perform a few steps.

Now checks Busy.

Returns ErrCode or BUSY_ERROR


Add see also
AddOptions

AddStoreSuffixes

Relative_Paths_With_ZipMaster

Dll log file


AddStreamToFile
TZipMaster.AddStreamToFile

TZipMaster

The AddStreamToFile method adds the specified stream to the zip archive.

Procedure AddStreamToFile( Filename: String = ''; FileDate: DWord = 0; FileAttr: DWord = 0 );

Description:

Adds stream data, which should be in ZipStream, to the zip archiveZipFileName under the filename given in the parameter FileName. Also a FileDate (DOS filedate and time) and some FileAttributes can be set.

-	If NO FileName is passed as parameter then the first in the list of FSpecArgs will be taken as FileName. Wildcards are not allowed!

-	If NO FileDate is passed as parameter, the local system date and time will be used.

-	FileAttr can be one or a logical combination of the following types:

FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_SYSTEM.

If NO FileAttr is passed as parameter, it will be set to 0.

Example:	// Add something as data to the ZipStream...

ZipMaster1.ZipStream.LoadFromFile( 'L:\SomeFile.dat' );

// *** Other possibilities ***

// ZipMaster1.ZipStream.LoadFromStream( aStream );	// Or use data from another stream.

// ZipMaster1.ZipStream.Write( aTextbuffer, NumberOfBytes );	// Or data from a character buffer.

ZipMaster1.AddStreamToFile( 'MyFilenameToAdd.dat' );

// *** Another possibility ***

// ZipMaster1.FSpecArgs.Clear;

// ZipMaster1.FSpecArgs.Append( 'MyFilenameToAdd.dat' );

// ZipMaster1.AddStreamToFile;

// *** Another possibility ***

// ZipMaster1.AddStreamToFile( 'MyFilenameToAdd.dat', 0, FILE_ATTRIBUTE_ARCHIVE );

// *** Another possibility ***

// ZipMaster1.AddStreamToFile( 'MyFilenameToAdd.dat', TDateTime( '6-4-00 14:32' ).FileDate );


AddStreamToStream
TZipMaster.AddStreamToStream

TZipMaster

The AddStreamToStream method adds memory stream data to the ZipStream as packed data.

Function  AddStreamToStream( InStream: TMemoryStream ): TZipStream;

Description:

Adds the data from a memory stream to the ZipStream, so no files are involved in this action.

The size of the output stream is set to 6 bytes more than the actual output size because:

-	The first two bytes are used as a flag, STORED = 0 or DEFLATED = 8.

Type

pFlag = ^Smallint;

pCRC = ^Cardinal;

Var

Flag: SmallInt;

CRC: Cardinal;

Flag := (pFlag ( ZipMaster1.ZipStream.Memory ))^;

-	The next four bytes are set to the calculated CRC value.

CRC := (pCRC( pChar( ZipMaster1.ZipStream.Memory ) + 2))^;

The start of the stream (Position) is set to the actual data start, i.e. 6 bytes from the start of the stream.

Example:

Var

MyData: TMemoryStream;

MyData.Create;

// Add some text as data...

MyData.LoadFromFile( 'L:\SomeFile.dat' );

// MyData.LoadFromStream( aStream );	// Or use data from another stream.

// MyData.Write( aTextbuffer, NumberOfBytes );	// Or data from a character buffer.

ZipMaster1.AddStreamToStream( MyData );

// *** Another possibility ***

// Var MyOutData: TZipStream;

// MyOutData := ZipMaster1.AddStreamToStream( MyData );

MyData.Free;

// The Output can be found in the ZipMaster1.ZipStream property.


Using relative paths with ZipMaster
How to Use and Store Relative Paths

1)	Set the AddOptions to AddRecurseDirs and AddDirNames:

with ZipMaster1 do

AddOptions := AddOptions + [AddRecurseDirs, AddDirNames];

2)	Add a file specification like *.* or *.pas or something like this:

ZipMaster1.FSpecArgs.Append( '*.*' );

3)	Set the RootDir property to the desired base directory, Drive and Directory where the relative path should start.

ZipMaster1.RootDir :='C:\aBaseDir\AnotherBaseDir';

4)	Now do an Add, and you should have the desired result. The Drive ID and Dirname of your base directory will not be stored in the archive.

ZipMaster1.Add;

NOTE:	The reason that demo1 saves whole pathnames is because it's GUI design intentionally stores complete pathnames in the FSpecArgs.


AppendSlash
TZipMaster.AppendSlash

TZipMaster

The AppendSlash method adds, if not already present, a slash '\' to the specified path.

Function AppendSlash( DirPath: String ): String;

Description:

Adds a backward slash to a path and returns the changed path.


ConvertSFX
TZipMaster.ConvertSFX

TZipMaster	See also:	Note on passwords:

ConvertSFX  converts the Zip archive to a self-extracting executable.

Function ConvertSFX: Integer;

Description:

Convert Zip archive to self-extracting .EXE. The resulting .EXE is a Win32 program. Uses the same base name and path already used by the Zipfile - only the file extension is changed to "EXE". This is accomplished by pre-pending the SFX code in  front of the Zip file, and then changing its extension.

This function returns:

0	On success.

-1	Error in creation of destination.

-2	Read or write error during copy. (Could be: Not enough space on disk)

-3	Error in open of source.

-9	general failure during copy.

-10	Icon not found in ZipSFX.bin.

-11	Memory or general error while setting icon.

-12	Error in size of the supplied icon.

IMPORTANT:	Before using ConvertSFX, you may want to first set the SFXPath property to the full pathname of the SFX code: ZIPSFX.BIN. If you don't set this property, ZipMaster will automatically look for this file in the Current directory, the application directory, the Windows System and Windows directories and if present the directory specified by the DLLDirectory property.


ConvertSFX see also
ConvertZIP

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverWriteMode

TZipSFX


ConvertZIP
TZipMaster.ConvertZIP

TZipMaster	See also:	Note on passwords:

ConvertZIP converts the specified executable into a Zip archive.

Function ConvertZIP: Integer;

Description:

Converts a self-extracting .exe file into a Zip archive.  This is accomplished by removing the SFX code from the beginning of a file and then changing its extension.

This function returns:

0	On success.

-1	Error in creation of destination.

-2	Read or write error during copy. (Could be: Not enough space on disk)

-3	Error in open of source.

-9	General failure during copy.

-10	Memory error.

WARNING:	The use of ConvertZIP can NOT be guaranteed to work with all self-extracting archive formats.  It will work on MS-DOS self-extracting zip archives, and on those made by WinZip (product of Nikko Mak Computing), but some self-extracting formats are not even based on Zip compression.

For example, the freeware "ASetup" program uses the .LZH  compression format.  In fact, most setup programs use compression formats that aren't Zip compatible. If you try to use ConvertZIP on an archive that doesn't conform to the Zip standard, you will get errors. If fact, you can't even list the contents of an .EXE archive if it's not a standard Zip format.


ConvertZip see also
ConvertSFX

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverWriteMode

TZipSFX


CopyFile
TZipMaster.CopyFile

TZipMaster

With CopyFile you can copy a file.

Renamed to Copy_File!

Function CopyFile( Const InFileName, OutFileName: String ): Integer;

Description:

This copies any file to any other file. Useful in many application programs, so it was included here as a method.  This returns 0 on success, or else one of these errors:

-1	Error in creation of destination.

-2	Read or write error during copy.

-3	Error in open of source.

-4	Error setting date/time of destination.

-9	General failure during copy.

NOTE:	a '-4' error is non-fatal.  The copied file will still be correct, except that the datetime stamp will be wrong.

Can be used to make a backup copy of the ZipFile before an Add operation.

Example:

ret := CopyFile( ZipFileName, 'C:\TMPZIP.TMP' );

if  ret < 0  then

   ShowMessage( 'Error no. ' + IntToStr( ret ) + ' in making backup' );

IMPORTANT:	The destination must include a filename ( You can't copy a file to C:\ ).  Also, wildcards are not allowed in either source or destination.


Copy_File
TZipMaster.Copy_File

TZipMaster

With Copy_File you can copy a file.

Function Copy_File( Const InFileName, OutFileName: String ): Integer;

Description:

This copies any file to any other file. Useful in many application programs, so it was included here as a method.  This returns 0 on success, or else one of these errors:

-1	Error in creation of destination.

-2	Read or write error during copy.

-3	Error in open of source.

-4	Error setting date/time of destination.

-9	General failure during copy.

NOTE:	a '-4' error is non-fatal.  The copied file will still be correct, except that the datetime stamp will be wrong.

Can be used to make a backup copy of the ZipFile before an Add operation.

Example:

ret := Copy_File( ZipFileName, 'C:\TMPZIP.TMP' );

if  ret < 0  then

   ShowMessage( 'Error no. ' + IntToStr( ret ) + ' in making backup' );

IMPORTANT:	The destination must include a filename ( You can't copy a file to C:\ ).  Also, wildcards are not allowed in either source or destination.


CopyZippedFiles
TZipMaster.CopyZippedFiles

TZipMaster	See also:

With CopyZippedFiles you can copy one or more zipped files from one zip archive to another.

Function CopyZippedFiles( DestZipMaster: TZipMaster; DeleteFromSource: boolean; OverwriteDest: OvrOpts ): Integer;

Description:

CopyZippedFiles copies zipped entries from the source zip archive to a destination zip archive without, the possibly time consuming need, of extracting and re-zipping again. The file(s) to be copied must be specified in FSpecArgs from the source archive before calling this function.

DestZipMaster is the ZipMaster component you are going to use as the destination zip archive.

(The source zip archive is the one you are calling this function from.)

With DeleteFromSource you specify if the source file(s) must be deleted after a successful copy.

OverWriteDest can take one of the following values:

Value	Meaning

OvrConfirm	Ask the user if the destination may be overwritten when a source file is found inside the destination or perform the OnCopyZipOverwrite event when assigned.

OvrAlways	Always overwrite existing files in the destination

OvrNever	Never overwrite - skip those files, afterwards these files can be found in FSpecArgs from the source.

The function returns 0 on success, or else one of these errors:

-6	Still busy with a previous method call.

-7	CopyZippedFiles errors.  See also: Error and warning messages from 1000 and up

-8	Memory allocation error.

-9	General unknown CopyZippedFiles error.

Short example of how this function could be called without the use of the OnCopyOverwrite event:

with ZipMaster1 do

begin

ZipFileName := 'SourceZip.zip';

FSpecArgs.Clear;

FSpecArgs.Add( 'C:\AutoExec.bat' );

FSpecArgs.Add( 'C:\Config.sys' );

Add;

FSpecArgs.Add( 'AutoExec.bat' );

FSpecArgs.Add( 'Config.sys' );

with ZipMaster2 do

begin

ZipFileName := 'DestinationZip.zip';

FSpecArgs.Clear;

FSpecArgs.Add( 'C:\AutoExec.bat' );

Add;

HowToDelete := htdAllowUndo;

Result := ZipMaster1.CopyZippedFiles( ZipMaster2, True, OvrConfirm );

end;

end;

When the Result is 0 (Ok) then the two files are removed from SourceZip.zip and were copied into DestinationZip.zip. The Original destination archive (DestinationZip.zip) is placed into the recycle bin. File(s) that are not copied because you answered NO on the overwrite question, or in case OvrNever was specified, can be found in the FSpecArgs list from the source (ZipMaster1) afterwards.

NOTE 1:	Source and destination zip archive need to be different!

NOTE 2:	This function uses the TempDir property to make a temporary destination file. When your destination archive is not on the same drive as where TempDir is pointing to, there will be extra copying involved which could take a lot of time!


CopyZippedFiles see also
OnCopyZipOverwrite


Delete
TZipMaster.Delete

TZipMaster

With the Delete method you can delete specified files from the Zip archive.

Procedure Delete;

Description:

Deletes all files specified in the FSpecArgs property from the archive specified by the ZipFileName property.


EraseFile
TZipMaster.EraseFile

TZipMaster

With the EraseFile function you can choose how to erase the specified file from disk.

Function EraseFile( Const FileToErase: String; How: DeleteOpts ): Integer;

Description:

EraseFile is like DeleteFile, but depending on the value of 'How' the specified file will be deleted completely or will be put into the recycle bin. When just a filename is specified the drive and directory will be taken from the current drive and directory.

How can take one of the following values:

Value	Meaning

htdFinal	Perform a DeleteFile. (The default)

htdAllowUndo	Move the old file into the recycle bin.

EraseFile is also used internally by the component functions ConvertZip, ConvertSFX, CopyFile, CopyZippedFiles and ReadSpan but then uses the property HowToDelete as How value.

The return value will be the return value of SHFileOperation ( 0 if Ok else not zero ) or -1 in case of memory error.


Extract
TZipMaster.Extract

TZipMaster

With the Extract method you can extract specified files from a Zip archive.

function Extract: integer;

changed

Description:

Extracts all files specified in the FSpecArgs property from the archive specified by the ZipFileName property. If you don't specify any FSpecArgs, then all files will be extracted.

The Extract method can also test the integrity of files in an archive.

If you set the ExtrTest option of ExtrOptions, then ALL files in the archive will be tested. This will cause them to be extracted, but not saved to the hard disk. Their CRC will be verified, and results will go to the SuccessCnt property, and the OnMessage event handler.

Now checks that is not Busy - returns ErrCode or BUSY_ERROR


ExtractFileToStream
TZipMaster.ExtractFileToStream

TZipMaster	See also:

With the ExtractFileToStream method you can extract a specified file from a Zip archive into a stream.

Function ExtractFileToStream( Filename: String ): TZipStream;

Description:

Extracts if specified file 'Filename' or else the first file specified in the FSpecArgs property from the archive specified by the ZipFileName property

After this method returns the stream position is at the begin of the stream.


ExtractFileToStream see also
ExtractFileToStream

AddStreamToFile

AddStreamToStream

ZipStream


ExtractStreamToStream
TZipMaster.ExtractStreamToStream

TZipMaster	See also:

With the ExtractStreamToStream method you can extract a specified stream from another stream.

Function  ExtractStreamToStream( InStream: TMemoryStream; OutSize: LongWord = 32768 ):

Description:

Extracts the specified InStream into an output stream (ZipStream).

Since the uncompressed size is not stored it is possible to specify the output size yourself in OutSize.

If OutSize is not given a start size of 32768 bytes is used and increased when needed in steps of 32768 bytes this will take extra time because with each increment the memory already in use need to be copied to a new location.

The first 6 bytes of the input stream are reserved:

-	The first two bytes are used as a flag, STORED = 0 or DEFLATED = 8.

Type

pFlag = ^Smallint;

pCRC = ^Cardinal;

Var

Flag: SmallInt;

CRC: Cardinal;

Flag := 8;

(pFlag( ZipMaster1.ZipStream.Memory ))^ := Flag;

-	The next four bytes should be set to the calculated CRC value, if this value is wrong an OnCRC32Error event will follow.

CRC := xxx;

(pCRC( pChar( ZipMaster1.ZipStream.Memory ) + 2))^ := CRC;

After this method returns the stream position is at the begin of the stream.

Example:

Var

MyData: TMemoryStream;

Begin

MyData.Create;

// Add some text as data...

// MyData.LoadFromFile( 'SomeTextFile.txt' );

MyData.LoadFromStream( ZipMaster1.ZipStream );

// MyData.Write( aTextbuffer, NumberOfBytes );

ZipMaster1.ExtractStreamToStream( MyData );

// *** Another possibility ***

// Var MyOutData: TZipStream;

// MyOutData := ZipMaster1.ExtractStreamToStream( MyData );

MyData.Free;

// The Output can be found in the ZipMaster1.ZipStream property.

MsgForm.RichEdit1.Lines.LoadFromStream( ZipMaster1.ZipStream );

MsgForm.Show;


ExtractStreamToStream see also
ExtractFileToStream

AddStreamToFile

AddStreamToStream

ZipStream


GetAddPassword
TZipMaster.GetAddPassword

TZipMaster	See also:	Note on passwords:

The GetAddPassword method will ask the user for a password used while adding files.

Function GetAddPassword: String;

Function GetAddPassword(var Response: TPasswordButton): String;

Description:

Prompt user for a password. The password will be asked twice - the second time to verify it.  If both of them match, it will be saved in the Password property and it will also be returned as result, or else the Password property will not change and the result is an empty string.

The use of this method is not required. If you want to make your own password prompt dialog box, you can just put the password into the password property yourself. Also, you can take the easiest route by leaving the password property blank, and letting the component prompt the user for the password.

The new overloaded version also gives the user's response.


GetAddPassword see also
GetExtrPassword

GetPassword


GetExtrPassword
TZipMaster.GetExtrPassword

TZipMaster	See also: 	Note on passwords:

The GetExtrPassword method will ask the user for a password used while extracting files.

Function GetExtrPassword: String;

Function GetExtrPassword(var Response: TPasswordButton): String;

Description:

Prompt user for a password.  The password will only be asked once. It will be saved in the Password property and it will also be returned as result.

The use of this method is not required. If you want to make your own password prompt dialog box, you can just put the password into the password property yourself. Also, you can take the easiest route by leaving the password property blank, and letting the component prompt the user for the password.

The new overloaded version also gives the user's response.


GetExtrPassword see also
GetAddPassword

GetPassword


GetPassword
TZipMaster.GetPassword

TZipMaster	See also: 	Note on passwords:

The GetPassword method will ask the user for a password.

Function GetPassword( DialogCaption, MsgTxt ; pwb: TPasswordButtons: String, var ResultStr: String ) : TPasswordButton;

Description:

Prompt the user for a password. The password will only be asked once. It will not automatically be saved in the Password property.

You can set the caption and message text of this password dialog yourself or get the language dependend text from the resource file like:

ZipMaster1.GetPassword( LoadStr( PW_Caption ), LoadStr( PW_MessageEnter ) + ': for file ' + ForFile, NewPassword );

or

ZipMaster1.GetPassword( LoadStr( PW_Caption ), LoadStr( PW_MessageVerify ), NewPassword );

pwButtons is a set of buttons indicating the buttons that will be shown in the password dialog.

Possible values are: pwbOk, pwbCancel, pwbCancelAll and pwbAbort. Default and always present is: pwbOk.

The return value of this method is set to the button pressed and ResultStr is set to the password the user entered.

The button text on this dialog is taken from the chosen resource file and as such language dependent.

You can use this method in the OnPasswordError event to get a new or different password from the user.


GetPassword see also
GetExtrPassword

GetAddPassword


TPasswordButton

TZipMaster

Type

  TPasswordButton = ( pwbOk , pwbCancel , pwbCancelAll , pwbAbort ) ;

Related Unit

  ZipPassDlg

Description


TPasswordButtons

TZipMaster

Related Unit

  ZipPassDlg

Type

  TPasswordButtons = set of TPasswordButton;

Description

  buttons used for Password dialog


Password Notes
TZipMaster Password Notes

The "GetAddPassword " and " GetExtrPassword " methods are optional. You have 4 different ways of getting a user's password:

1.	Call the "GetAddPassword" and/or the "GetExtrPassword" methods, just before add or extract.

2.	Use your own code to set the "Password" property.  It's your choice how you obtain the password.

-	This is useful if the password comes from a file or table.

-	It's also good for letting you enforce constrains on the password - you can require it to be over 6 chars, require it to have at least one special char, etc.  Of course, you'd only want to enforce constraints on "Add" operations.  A word of caution: many users don't like password constraints, so give them the option to turn them off.

3.	Don't set one at all, and let the component prompt the user. It's easy, and it works.

4.	Set the password in the OnPasswordError event. This is also the most flexible way of doing it.

Passwords can not be longer than 80 characters. A zero-length password is the same as no password at all.

To "zero out" the password, set it's property to an empty string. If it is zeroed out, but the AddEncrypt option is set, then the user will be prompted for a new password by the component. So, if you don't want a password used, make sure you turn off "AddEncrypt", and you zero-out the password.

If you set a password for an Extract, but it is incorrect, then the OnPasswordError event will be triggered PasswordReqCount times if you still do not supply a correct password Extraction will not take place.

To Force the DLL to AVOID decrypting an encrypted file, you must set the password property to an empty string and set to PasswordReqCount to zero.  If Adding, make sure AddEncrypt is NOT set.


List
TZipMaster.List

TZipMaster

The List method will read the Zip archive and refresh the contents list.

Function List : Integer;

Changed v1.72

Description:

Refreshes the contents of the archive into the ZipContents TList property.  This is a manual "refresh" of the "Table of Contents".  This occurs automatically whenever a filename is assigned to ZipFileName.

Now if called while on operation is in progress it returns BUSY_ERROR


Load_Unz_Dll
TZipMaster.Load_Unz_Dll

TZipMaster	Note  about the DLL's:

The Load_Unz_Dll method loads the UNZDLL.DLL into memory, if it is not already loaded.

Function Load_Unz_Dll: Integer;

Deleted see DLL_Loaded

Description:

 returns the UNZDLL version

For compatibility with older programs, and because I'm a nice guy, I'll handle the loads and unloads automatically if your program doesn't do it.  This can, however, incur a performance penalty because it will reload the needed DLL for each operation.

Advanced developers will want to carefully consider their load and unload strategy so they minimize the number of loads, and keep the DLL's out of memory when they're not needed. There is a traditional speed vs. memory trade-off.


Load_Zip_Dll
TZipMaster.Load_Zip_Dll

TZipMaster	Note  about the DLL's:

The Load_Zip_Dll method loads the ZIPDLL.DLL into memory, if it is not already loaded.

Function Load_Zip_Dll: Integer;

Deleted see DLL_Loaded

Description:

 returns ZIPDLL version

For compatibility with older programs, and because I'm a nice guy, I'll handle the loads and unloads automatically if your program doesn't do it.  This can, however, incur a performance penalty because it will reload the needed DLL for each operation.

Advanced developers will want to carefully consider their load and unload strategy so they minimize the number of loads, and keep the DLL's out of memory when they're not needed. There is a traditional speed vs. memory trade-off.


MakeTempFileName
TZipMaster.MakeTempFileName

TZipMaster

The MakeTempFileName method constructs a filename of the form 'C:\....\zipxxxx.zip' where xxxx is a unique number.

Function MakeTempFileName( Prefix, Extension: String ): String;

Description:

Prefix is per default: 'zip' = and Extension is '.zip'.

MakeTempFileName constructs a temporarily filename, that on the moment of construction does not have an equivalent on disk. The actual file created on disk will be removed before returning the filename.

If the TempDir is defined then this path will be used to construct the filename else the TMP or TEMP environment variable will be used, if both TMP or TEMP are not defined then the current drive and directory will used as path.


ReadSpan
TZipMaster.ReadSpan

TZipMaster	See also:

The ReadSpan method reads a spanned zip archive file and writes it back as one zip file.

Function ReadSpan( Const InFileName: String, var OutFilePath: String ): Integer;

Description:

With ReadSpan it is possible to read a spanned archive from disk and reassemble it as one zip file.

The 'InFileName' parameter can be either:

- The name of the zipfile on (floppy) disk.

- A file part on harddisk and should look like InFileNameXXX.zip where XXX is a number.

if 'OutFilePath' does not contain a filename there will be one created for you in the form: Zipxxxx.zip. The exact name will be

returned to you in the same parameter.

The return value will be one the following:

0	All Ok.

-7	All known ReadSpan errors. See also: Error and warning messages from 1000 and up

-8	Memory allocation error. ( GE_NoMem )

-9	General unknown ReadSpan error. ( DS_ErrorUnknown )


ReadSpan see also
WriteSpan


Rename
TZipMaster.Rename

TZipMaster

With the Rename method you can rename a filename and/or path to a different one.

Function Rename( RenameList: TList; DateTime: Integer ): Integer;

Description:

With Rename it is possible to change the filename(s) and/or path('s) to other name(s) and/or path('s).

-The 'RenameList' parameter is a TList filled with ZipRename records:

Type ZipRenameRec = record

Source:	String;	// The Source filename/path as present in the ziparchive.

Dest:	String;	// The Destination filename/path, this will be the new name.

DateTime:	Integer;	// A new Date/Time for this specific destination or 0.

End;

pZipRenameRec = ^ZipRenameRec;

Example:

Var

ZipRenameList:	TList;

RenRec:	pZipRenameRec;

Begin

ZipRenameList	:= TList.Create( );

New( RenRec );

RenRec^.Source	:= SourceName;

RenRec^.Dest	:= DestName;

RenRec^.DateTime	:= DateTimeToFileDate( StrToDateTime( '12-21-1998 21:06:12' ) );

ZipRenameList.Add( RenRec );

ZipMaster1.Rename( ZipRenameList, 0 );

Dispose( RenRec );

ZipRenameList.Free( );

End;

When you specify a new DateTime then this has precedence over the global DateTime parameter.

Source and Dest can be a partial filename or path, and as such multiple entries in the archive could be renamed with a single entry in the RenameList.

WARNING:	There is virtual no check on the destination specified.

This means that if you are not careful you can get multiple names or even wrong names that can't be extracted anymore.

-The DateTime parameter can be used to change the Date and Time of every entry in the zip archive.

If you do not want to change the Date/Time field set this parameter to 0.

Example:

DateTime := DateTimeToFileDate( StrToDateTime( '12-21-1998 21:05:10' ) );

The return value will be one the following:

0	All Ok.

-7	All known Rename errors. See also: Error and warning messages from 1000 and up

-8	Memory allocation error. ( GE_NoMem )

-9	General unknown Rename error. ( DS_ErrorUnknown )

-10	Destination should also be a filename when the source is a filename.


ShowZipMessage
TZipMaster.ShowZipMessage

TZipMaster	See also:

The ShowZipMessage method reads a message identified by Ident from the program resource table and displays it.

Procedure ShowZipMessage( Const Ident: Integer, Const UserStr: String );

Description:

All component messages, errors and warnings are as of version 1.5 contained in a resource message table. To make it easier to also use them in your own program this function is included.

It reads the message with identifier 'Ident' from the resource table, appends the optional 'UserStr' to it and displays the message.

If the identifier is not present, for example because you did not include the resource file in your project, the message displayed will be: "ZipMsg.res probably not linked to the executable. Missing String ID is: xxxx"

To resolve this you must put the statement {$R YourPath\ZipMsgxx.res}; in your main unit file. Where xx is your language ID. (Available at the moment: US English, NL Dutch.)


ShowZipMessage see also
Message

OnMessage


Unload_Unz_Dll
TZipMaster.Unload_Unz_Dll

TZipMaster	Note  about the DLL's:

The UnLoad_Unz_Dll() method unloads the UNZDLL.DLL from memory.

Procedure Unload_Unz_Dll;

Deleted see DLL_Loaded

Description:

For compatibility with older programs, and because I'm a nice guy, I'll handle the loads and unloads automatically if your program doesn't do it.  This can, however, incur a performance penalty because it will reload the needed DLL for each operation.

Advanced developers will want to carefully consider their load and unload strategy so they minimize the number of loads, and keep the DLL's out of memory when they're not needed. There is a traditional speed vs. memory trade-off.


Unload_Zip_Dll
TZipMaster.Unload_Zip_Dll

TZipMaster	Note  about the DLL's:

The UnLoad_Zip_Dll() method unloads the ZIPDLL.DLL from memory.

Procedure Unload_Zip_Dll;

Deleted see DLL_Loaded

Description:

For compatibility with older programs, and because I'm a nice guy, I'll handle the loads and unloads automatically if your program doesn't do it.  This can, however, incur a performance penalty because it will reload the needed DLL for each operation.

Advanced developers will want to carefully consider their load and unload strategy so they minimize the number of loads, and keep the DLL's out of memory when they're not needed. There is a traditional speed vs. memory trade-off.


WriteSpan
TZipMaster.WriteSpan

TZipMaster	See also:

The WriteSpan method can be used to copy an existing zip archive file to one or more disks as a spanned archive.

Function WriteSpan( Const InFileName, OutFileName: String ): Integer;

Description:

With WriteSpan it is possible to make a spanned archive on (floppy) disk from a standard zip file.

InFileName is the name of the zipfile that must be converted.

OutFileName is the drive, path(optional) and file name of the destination file.

NOTE:	If 'OutFileName' is on a fixed disk the input file will be split into parts with size MaxVolumeSize A file part on harddisk will look like: OutFileNameXXX.zip where XXX is a number.

It is possible to copy the files to diskette when the filesize is <= diskette size.

or to reassemble them without diskettes after sending them over the internet for use with pkzip or winzip.

The return value will be one the following:

0	All Ok.

 -7	All known WriteSpan errors. See also: Error and warning messages from 1000 and up

-8	Memory allocation error. ( GE_NoMem )

-9	General unknown WriteSpan error. ( DS_ErrorUnknown )


WriteSpan see also
ReadSpan

MaxVolumeSize

KeepFreeOnDisk1

MinFreeVolumeSize

Handling of Multi Volume Zip parts


Handling of Multi Volume Zip parts
A)	How to copy each part to diskette afterwards:

1)	Make the MV archive on harddisk. Your filenames will be, for example:

'Test001.zip', 'Test002.zip', 'Test003.zip'

2)	Copy each of them to it's own diskette.

3)	Rename each file on diskette to 'Test.zip'

4)	Set the label of the diskettes to 'PKBACK# 001', 'PKBACK# 002' and 'PKBACK# 003'

( Note the space between # and the first digit! )

5)	Start reading from the last diskette.

B)	How to reassemble the pieces at the client side after sending the files over the internet, without using diskettes.

1)	Start a DOS window and "CD" to the directory with Test???.zip

2)	Concatenate them with:

"Copy /B Test001.zip+Test002.zip+Test003.zip Test.zip" or shorter:  "Copy /B Test???.zip Test.zip"

(Do not enter the quotes.)

3)	Fix the internal directory structure with: PKZipFix Test.zip

Note: PKZipFix.EXE comes with pkzip v2.04g.

4)	Rename the resulting file 'PKfixed.zip' to 'Test.zip' (This is now a normal zip file and should be 4 bytes smaller than the sum of the parts.

NOTE1:	There is no time penalty making the archive directly on diskettes because the ZipMaster and ZipBuilder components internally use a temporary file on harddisk.

NOTE2:	Harddisk spanning is not supported by PKZip and WinZip, so if you want to use files created this way with these programs you will have to use one of the above mentioned methods.


OnCopyZipOverwrite
TZipMaster.OnCopyZipOverwrite

TZipMaster	See also:

The OnCopyZipOverwrite event occurs when the function CopyZippedFiles needs to know if a file may be overwritten.

Type  TCopyZipOverwriteEvent = Procedure( Sender: TObject; ForFile: String; var DoOverwrite: Boolean ) of object;

property OnCopyZipOverwrite: TCopyZipOverwriteEvent;

Description:

Occurs when during the execution of the function CopyZippedFiles it is necessary to know if a file in the destination archive may be overwritten. It is possible that the event does NOT occur because you have let the function CopyZippedFiles know that it is always or never Ok to overwrite.

You can choose to overwrite the file 'ForFile' by setting DoOverwrite to True. The default for DoOverwrite is False.


OnCopyZipOverwrite see also
CopyZippedFiles


OnCRC32Error
TZipMaster.OnCRC32Error

TZipMaster

OnCRC32Error event occurs when a CRC error is found while extracting.

Type TCRC32ErrorEvent = Procedure( Sender: TObject; ForFile: String; FoundCRC, ExpectedCRC: LongWord; var DoExtract: Boolean ) of object;

property OnCRC32Error: TCRC32ErrorEvent;

Description:

Occurs when during an Extract a CRC error is found in the file ForFile.

FoundCRC is the calculated CRC and ExpectedCRC is the CRC as stored in the zip archive these two values are for your information only.

You can choose to skip the extraction of the file by setting DoExtract to False. The default for DoExtract is True because that was the case in previous versions of ZipMaster where you could not choose.


OnDirUpdate
TZipMaster.OnDirUpdate

TZipMaster

OnDirUpdate event occurs when ZipMaster has refreshed the contents list.

property OnDirUpdate: TNotifyEvent;

Description:

Occurs immediately after ZipMaster refreshes it's ZipContents TList. This is your queue to update the screen with the new contents.


OnExtractOverwrite
TZipMaster.OnExtractOverwrite

TZipMaster

OnExtractOverwrite event occurs when during an Extract a file could be overwritten.

Type TExtractOverwriteEvent = procedure( Sender: TObject; ForFile: String; IsOlder: Boolean; var DoOverwrite: Boolean; DirIndex Integer ) of object;

property OnExtractOverwrite: TExtractOverwriteEvent;

Description:

ForFile the name of the file that will be overwritten.

IsOlder indicates if the existing file, on disk, is older.

DoOverwrite can be set to True when you want the file to be overwritten.

DirIndex is the index of ForFile inside the ZipContents list. With this you have full access to all available archive file information for this file.

Example:

Var

q:	String;

res:	Integer;

DefBtn:	Cardinal;

Begin

If NOT IsOlder Then   // Only when existing file is newer(or equal) we will ask what to do.

Begin

q := 'Do you want to overwrite the file:'#13#10 + ForFile;

If DoOverwrite = True Then

DefBtn := MB_DEFBUTTON1

Else

DefBtn := MB_DEFBUTTON2;

res := MessageBox( Self.Handle, pChar( q ), 'Confirm', MB_YESNO or MB_ICONQUESTION or DefBtn );

If res = ID_YES Then

DoOverwrite := True

Else

DoOverwrite := False;

End

End;


OnExtractSkipped
TZipMaster.OnExtractSkipped

TZipMaster

OnExtractSkipped event occurs when a file is skipped during the Extract process.

Type TExtractSkippedEvent   = procedure( Sender: TObject; ForFile: String; SkipType: UnZipSkipTypes; ExtError: Integer ) of object;

property OnExtractSkipped: TExtractSkippedEvent;

Description:

UnZipSkipTypes = ( stOnFreshen, stNoOverwrite, stFileExists, stBadPassword, stNoEncryptionDLL,

            stCompressionUnknown, stUnknownZipHost, stZipFileFormatWrong, stGeneralExtractError );


OnFileComment
TZipMaster.OnFileComment

TZipMaster

OnFileComment event occurs when writing the central directory of the zip archive for every file in the archive.

Type TFileCommentEvent = procedure( Sender: TObject; ForFile: String, var FileComment: String, var IsChanged: Boolean ) of object;

property OnFileComment: TFileCommentEvent;

Description:

ForFile is the filename for which the filecomment could be set.

FileComment is set to the first 255 characters of the old filecomment when present and can be set to a new comment, with a maximum of 511 characters, for the file, remember filecomments are not zipped and are stored as given.

IsChanged must be set to True when you want the filecomment to be really set, default it is False.

Example:

Begin

IsChanged := InputQuery( 'Give new file comment', 'FileName: ' + ForFile, FileComment );

End;


OnGetNextDisk
TZipMaster.OnGetNextDisk

TZipMaster

OnGetNextDisk event occurs when a disk is needed during disk spanning.

Type TGetNextDiskEvent = procedure( Sender: TObject; DiskSeqNo, DiskTotal: Integer; Drive: String, var Cancel: Boolean ) of object;

property OnGetNextDisk: TGetNextDiskEvent;

Description:

DiskSeqNo the sequence number of the disk needed or is zero when it concerns a diskspan read action.

DiskTotal the total number of needed disks. This is an estimate based on some known values or it is zero when the number could not be calculated.

Drive the drive name, e.g. 'A:'.

Cancel, can be set to True to cancel the spanning operation, default False.

Example:

Var

MsgStr:	String;

Res:	Integer;

Begin

// Only while reading

If DiskSeqNo = 0 Then

MsgStr := LoadStr( DS_InsertDisk );

If DiskTotal = 0 Then	// Total disks is not known

MsgStr := Format( LoadStr( DS_InsertAVolume ), [ DiskSeqNo ] )

Else

MsgStr := Format( LoadStr( DS_InsertVolume ), [ DiskSeqNo, DiskTotal ] );

MsgStr := MsgStr + Format( LoadStr( DS_InDrive ), [ Drive ] );

Res := MessageBox( ZipMaster1.Handle, pChar( MsgStr ), 'Confirm', MB_YESNOCANCEL or MB_DEFBUTTON2 or MB_ICONWARNING );

If Res <> IDYES Then Cancel := True;

End;


OnMessage
TZipMaster.OnMessage

TZipMaster	See also:

OnMessage event occurs when a DLL or the component sends a message to your program.

Type TMessageEvent = procedure( Sender: TObject; ErrCode: Integer; Message: String ) of object;

property OnMessage: TMsgEvent;

Description:

The Message property passed by this event will contain the message. If an error code accompanies the message, it will be in the ErrCode property. The Verbose and Trace properties have a direct influence on how many OnMessage events you will get.


OnMessage see also
Message

ErrCode


OnNewName
TZipMaster.OnNewName

TZipMaster	See also:

OnNewName event occurs when reading the Zip's archive directory for every file entry.

Type TNewNameEvent = Procedure( Sender: TObject; SeqNo: Integer; ZipEntry: ZipDirEntry ) of object;

property OnNewName: TNewNameEvent;

Description:

The event OnNewName occurs when reading the Zip's archive directory and gives you the opportunity to fill in for example a TListView. In previous versions you had to wait for the OnDirUpdate event.

SeqNo is a number from 1 to the number of entries in the zipfile and can be used to reset a ListView when the value is 1 and as sequence number in a TStringGrid.


OnNewName see also
DirEntry

ZipDirEntry


OnPasswordError
TZipMaster.OnPasswordError

TZipMaster	See also: 	Note on passwords:

OnPasswordError event occurs when a DLL needs a password for encryping or decrypting.

Type TPasswordErrorEvent = Procedure( Sender: TObject; IsZipAction: Boolean; var NewPassword: String; ForFile: String; var RepeatCount: LongWord ; var Action: TPasswordButton ) of object;

Type TPasswordButton  = ( pwbOk, pwbCancel, pwbCancelAll, pwbAbort );

property OnPasswordError: TPasswordError;

Description:

Occurs when adding or extracting and a password is needed but not set by the Password property and also when extracting and the given password is incorrect.

IsZipAction is set to true when the error is originating from the Zip DLL i.e. an Add action else it is from the UnZip DLL. (an Extract action)

The ForFile parameter will give the path+file for which the password is needed.

RepeatCount is at first set to the PasswordReqCount number and decremented on each event call.

When needed you can modify RepeatCount and set it to value from 0 to 15 this will not influence PasswordReqCount.

Action is the action to take when returning from this event, possible actions are: pwbOk, pwbCancel, pwbCancelAll or pwbAbort. Default is pwbOk.

NOTE:	This event will be called at most 15 times per file even when you try to increase RepeatCount multiple times.


OnPasswordError see also
GetExtrPassword

GetAddPassword


OnProgress
TZipMaster.OnProgress

TZipMaster	Example:

OnProgress event occurs during compression and decompression of a Zip archive and while disk (un)spanning.

Type TProgressEvent = Procedure( Sender: TObject; ProgrType: ProgressType; Filename: String; FileSize: cardinal ) of object;

property OnProgress: TProgressEvent;

Description:

Intended for "status bar" or "progress bar" updates.  Criteria for this event:

ProgressType is defined as one of the types below:

TotalSize2Process	At the start of processing a (batch of) file(s) with the Add, Extract or Test method this gives the total uncompressed file size which will be processed by the given method. This can be used to show a progress bar for the entire job. This size is also available in the TotalSizeToProcess property. Changed 1.72 - If Filename is not empty it contains the operation name (Clearing Archive Bit etc)

TotalFiles2Process	At the start of processing a (batch of) file(s) with the Add, Extract or Test method you will get the total number of files which will be processed by the given method.

NewFile	Starting to process a new file. (gives you  the filename and total uncompressed filesize for the given file.)

ProgressUpdate	Every xxxK bytes while processing a file. The actual progress 'xxx' is given in FileSize.

For Zip compression this will be 64K, n times 32K, and the remaining file bytes.

For Unzip uncompression this will be: n times 32K and the remaining file bytes.

For Zip (un)spanning actions it will be 8K.

EndOfBatch	Completed processing on a (batch of) file(s).

(See Demo1 to learn how to use this event.)


To see the code in action look at demo 1.


OnProgressDetails
TZipMaster.OnProgressDetails

TZipMaster

Type

  TProgressDetailsEvent = procedure(Sender: TObject; details: TProgressDetails) of object;

property OnProgressDetails: TProgressDetailsEvent;

Description

   Provides access to full progress details


ProgressDetails
TProgressDetails

type

  TProgressDetails = class(TObject)

  public

    destructor Destroy; override;

    property ItemPerCent: Integer;

    property TotalPerCent: Integer;

    property Order: ProgressType ;

    property TotalCount: Integer;

    property BytesWritten: Int64;

    property TotalSize: Int64;

    property TotalPosition: Int64;

    property ItemSize: Cardinal;

    property ItemPosition: Cardinal;

    property ItemName: String;

    property ItemNumber: Integer;

  end;

Description

   Encapsulates all progress details for the OnProgressDetails event

   ItemPosition, TotalPosition and ItemPerCent, TotalPerCent calculations are handled internally

   BytesWritten is only available during 'Add' or 'Delete' operations


ProgressType

type

  ProgressType = (NewFile, ProgressUpdate, EndOfBatch, TotalFiles2Process,

    TotalSize2Process, NewExtra, ExtraUpdate);

Defined in ZipProg.pas

Desciption

   enumerates the types of 'progress'

    NewFile, 	starting on new file

    ProgressUpdate, 	reports progress in file

    EndOfBatch, 	finished all operations

    TotalFiles2Process,	reports Total files to process

    TotalSize2Process, 	reports Total uncompressed size of files

    NewExtra, 	starting new 'extra' item

    ExtraUpdate	advancing through 'extra' item

   'extra' items are operations that may take some time eg. reading central directory or resetting archive bits


OnSetNewName
TZipMaster.OnSetNewName

TZipMaster

OnSetNewName event occurs when adding files to an archive and gives you a chance to change the path and or file name.

Type TSetNewNameEvent = Procedure( Sender: TObject; var OldFileName: String; var IsChanged: Boolean ) of object;

property OnSetNewName: TSetNewName;

Description:

Occurs when adding files to the archive, the file to be added is OldFileName and can be changed to any path filename combination of your own choice. when you change 'OldFileName' you must also set IsChanged to True.

WARNING:	There is virtually no check on the path\filename you specify.

This means that if you are not careful you can get multiple names or even wrong names that can't be extracted anymore.


OnSetAddName
TZipMaster.OnSetAddName

TZipMaster

OnSetAddName event occurs when adding files to an archive and gives you a chance to change the path and/or file name.

Type TSetAddNameEvent = Procedure( Sender: TObject; var FileName: String; const ExtName: string; var IsChanged: Boolean ) of object;

property OnSetAddName: TSetAddNameEvent;

This replaces the OnSetNewName event.

Description:

Occurs only when adding files to the archive, the file to be added is FileName and can be changed to any path filename combination of your own choice. when you change 'FileName' you must also set IsChanged to True.

ExtName is the full path and name of file being added.

WARNING:	There is virtually no check on the path\filename you specify.

This means that if you are not careful you can get multiple names or even wrong names that can't be extracted anymore.


OnSetExtName
TZipMaster.OnSetExtName

TZipMaster

OnSetAddName event occurs when adding files to an archive and gives you a chance to change the path and/or file name.

Type TSetAddNameEvent = Procedure( Sender: TObject; var FileName: String; var IsChanged: Boolean ) of object;

property OnSetExtName: TSetExtNameEvent;

This replaces the OnSetNewName event.

Description:

Occurs only when extracting files from the archive, the file to be extracted is FileName and can be changed to any path filename combination of your own choice. When you change 'FileName' you must also set IsChanged to True.

WARNING:	There is virtually no check on the path\filename you specify.

This means that if you are not careful you can get multiple names or even invalid names that can't be extracted anymore.


OnTick
TZipMaster.OnTick

TZipMaster

 activity indicator

Type TTickEvent = Procedure(Sender: TObject) Of Object;

Property OnTick: TTickEvent

Description

   	Use OnTick + OnSetNewName to indicate activity before compression starts during Add


OnZipStr
TZipMaster.OnZipStr

TZipMaster

 return string for ID

Type

    TZipStrEvent = procedure(ID: integer; var Str: String) of object;

Defined in ZipStrs.pas

Property OnZipStr: TOnZipStr;

Description

    Use it to supply the required string for a ID.

 An (inefficient) Example

procedure TForm1.ZipMaster1ZipStr(Sender: TObject; ID: Integer;  var Str: String);

Var

Buff : String ;

L : Integer ;

hDll : integer;

begin

hDll := LoadLibrary(pChar('eng_zm.dll'));

if hDll<>0 then

begin

buff:='';

L := 255;

SetLength(Buff, L+1) ;

LoadString(hDll, ID, PChar(Buff), L);

Str := String( PChar( Buff ) ) ;

FreeLibrary(hDll);

end;

end;


OnZipDialog
TZipMaster.OnZipDialog

TZipMaster

    called before displaying message dialogs to allow custom handling of messages

Type

  TZipDialogEvent = procedure(Sender: TObject; const title: String;

         var msg: String; var Result: Integer; btns: TMsgDlgButtons) of object;

Property OnZipDialog: TOnZipDialogEvent;

Arguments

   Sender: TObject;

    const title: String; -  Desired Caption

    var msg: String;

 - IN message text,

   OUT (zmtPassword only) password

    var Result: Integer;

- IN HighWord=message dialog type (see below)

      LowWord=Help context

 	- OUT ModalResult (unchanged if not handled)

    btns: TMsgDlgButtons - required buttons

  Defined in ZipDlg.pas

// High word = $10 or TMsgDlgType, low word = context

const

  zmtWarning  = $100000;

  zmtError    = $110000;

  zmtInformation = $120000;

  zmtConfirmation = $130000;

  zmtPassword = $140000;

Description

  used to show messages or request passwords

   If Verbose is true the context number will be show in the title.


DialogContext

 Defined in ZipCtx.pas

const

  DHCBase = 10000;

  DHC_ZipMessage = DHCBase;

     Show (error?) message

  DHC_ExMessage = DHCBase + 1;

     Show Exception message

  DHC_Password = DHCBase + 2; // just GetPassword default password

     Request password

  DHC_ExtrPwrd = DHCBase + 3;

     Request Extract password

  DHC_AddPwrd1 = DHCBase + 4;

     Request first Add password

  DHC_AddPwrd2 = DHCBase + 5;

     Confirm Add password

  DHC_WrtSpnDel = DHCBase + 6;

     Confirm delete

  DHC_ExSFX2EXE = DHCBase + 7;

     ?

  DHC_ExSFX2Zip = DHCBase + 8;

     ?

  DHC_SpanNxtW = DHCBase + 9;

     Request next disk for writing

  DHC_SpanNxtR = DHCBase + 10;

     Request next disk for reading

  DHC_SpanOvr = DHCBase + 11;

     Confirm before overwriting old part

  DHC_SpanNoOut = DHCBase + 12;

     Complain no output file

  DHC_SpanSpace = DHCBase + 13;

     Complain not enough space

  DHC_CpyZipOvr = DHCBase + 14;

     Confirm overwrite in CopyZippedFile

  DHC_FormErase = DHCBase + 15;

     Confirm format floppy


OnTotalProgress
TZipMaster.OnTotalProgress

TZipMaster	See also:

 to show progress of operations such as Add or Extract

Type

    TTotalProgressEvent = procedure(Sender: TObject; TotalSize, PerCent: integer) of object;

Property

OnTotalProgress: TTotalProgressEvent;

Description

    Use it to show progress on a ProgressBar or similar indicator.

      The 'End of Batch' condition is marked by PerCent = -1

Example

procedure TForm1.ZipMaster1TotalProgress(Sender: TObject; TotalSize,  PerCent: integer);

begin

//    if PerCent>=0 then	// leave at 100%

ProgressBar2.Position := PerCent;

end;


OnTotalProgress see only
OnProgressDetails

OnItemProgress


OnItemProgress
TZipMaster.OnItemProgress

TZipMaster	See also:

 return string for ID

Type

    TOnItemProgressEvent = procedure(Sender: TObject; Item: string;

TotalSize:cardinal; PerCent: integer) of object;

Property OnItemProgress: TOnItemProgressEvent ;

Description

    Use it to show progress for each item on a ProgressBar or similar indicator.

      The 'End of Batch' condition is marked by PerCent = -1

Example

procedure TForm1.ZipMaster1ItemProgress(Sender: TObject; Item: string;

TotalSize:cardinal; PerCent: integer);

begin

if PerCent = 0 then	// reduces flashing

Label1.Caption := Item;

ProgressBar1.Position := PerCent;

end;


OnItemProgress see also
OnProgressDetails

OnTotalProgress


OnStatusDisk
TZipMaster.OnStatusDisk

TZipMaster

OnStatusDisk event occurs when spanning disks and trying to overwrite an existing file.

Type TStatusDiskEvent = Procedure( Sender: TObject; PreviousDisk: Integer; PreviousFile: String; Status: TZipDiskStatus; var Action: TZipDiskAction ) of object;

property OnStatusDisk: TStatusDiskEvent;

Description:

PreviousDisk is when applicable the disknumber of the previous disk which could be overwritten.

PreviousFile contains the filename of the zip archive.

TZipDiskStatus is a set and can take one or more of the following values:

Value	Meaning

zdsEmpty	The disk is empty and ready to use.

zdsHasFiles	The disk is not empty and contains one or more file(s).

zdsPreviousDisk	It's possibly a previous disk from the backup set.

zdsSameFileName	The disk contains a file with the same filename as the zip archive.

zdsNotEnoughSpace	There is not enough space on the disk taken into account KeepFreeOnDisk1, MaxVolumeSize and MinFreeVolumeSize.

TZipDiskAction should be set to one of the following values:

Value	Meaning

zdaOkl	Continue diskspanning (the default).

zdaErase	Erase the disk first.

zdaReject	Try again.

zdaCancel	Cancel the diskspanning operation.


rd The file specification is the technical description of files to include in the Zip archive. DOS wild cards may be used in the file specification. The FSpecArgs property stores the file specification for the TZipMaster component.


rd The file specification is the technical description of files to exclude from the Zip or Delete action. DOS wild cards may be used in this file specification. The FSpecArgsExcl property stores the file specification for the TZipMaster component.


TZipMaster error and warning messages
TZipMaster error, warning and general messages

TZipMaster

General messages

10101  GE_FatalZip  	Fatal Error in ZipDLL.DLL: abort exception

Internal error while executing code in ZipDll.dll, this should not happen.

10102  GE_NoZipSpecified  	Error - no zip file specified!

ZipFileName is not specified or the specified file does not exist.

10103  GE_NoMem  	Requested memory not available

10104  GE_WrongPassword  	Error - passwords do NOT match\nPassword ignored

10105  GE_CopyFile  	Copying:

10106  GE_Except 	Exception in Event handler

10107  GE_Reentered	Was busy, Instructions may have been lost!

10108  GE_Busy	Busy, Please wait

10109  GE_Inactive	not Active

10110  GE_RangeError	Index (%d) outside range 1..%d

10111  GE_TempZip	Temporary zipfile: %s

10112  GE_WasBusy	Busy

10113  GE_EventEx	Exception in Event

10118  GE_DLLAbort	DLL Error - Aborting

10119  GE_DLLBusy	DLL Error - Busy

10120  GE_DLLCancel	DLL Error - User Cancelled

10121  GE_DLLMem 	DLL Error - Not enough memory

10122  GE_DLLStruct	DLL Error - Invalid structure ;

10123  GE_DLLEvent	DLL Error - Exception in handler

10124  GE_DLLCritical	critical DLL Error %d

10125  GE_Unknown	Unknown error %d

Rename messages

10140  RN_ZipSFXData  	Error while copying the SFX header

10141  RN_NoRenOnSpan  	Rename is not implemented for a spanned zip file

10142  RN_ProcessFile	Processing:

10143  RN_RenameTo	renamed to:

10144  RN_InvalidDateTime 	Invalid date/time argument for file:

Password messages

10150  PW_UnatAddPWMiss	Error - no add password given

You tried to use the function GetAddPassword while the property Unattended was set to True.

10151  PW_UnatExtPWMiss	Error - no extract password given

You tried to use the function GetExtrPassword while the property Unattended was set to True.

10152  PW_Ok	Ok

10153  PW_Cancel	Cancel

10154  PW_Caption	Password

10155  PW_MessageEnter	Enter password

10156  PW_MessageConfirm	Confirm password

10157  PW_CancelAll	Cancel all

10158  PW_Abort	Abort

10159  PW_ForFile	 	For file:

Change file details

10180  CF_SourceIsDest	Source archive is the same as the destination archive!

10181  CF_OverwriteYN	Overwrite file '%s' in '%s' ?

10182  CF_CopyFailed	Copying a file from '%s' to '%s' failed

10183  CF_SourceNotFound	File '%s' is not present in '%s'!

10184  CF_SFXCopyError	Error while copying the SFX data

10185  CF_DestFileNoOpen	Destination zip archive could not be opened!

10186  CF_NoCopyOnSpan	Copy Zipped Files is not implemented for a spanned zip file

List problems

10201  LI_ReadZipError	Seek error reading Zip archive!

10202  LI_ErrorUnknown	Unknown error in List() function\n

Internal error while executing code in List function of TZipMaster, this should not occur.

10203  LI_WrongZipStruct	Warning - Error in zip structure!

The start of the central directory in the zip file is not where it should be!

If this archive should be read by other zip programs it is advisable to re-zip the contents.

It has probably to do with a conversion problem (bug) in earlier ZipMaster versions.

10204  LI_GarbageAtEOF	Warning - Garbage at the end of the zipfile!

general errors

10301  AD_NothingToZip	Error - no files to zip!

10302  AD_UnattPassword	Unattended action not posible without a password

You tried to perform an unattended Add without giving a password first.

10303  AD_NoFreshenUpdate	AddFreshen or AddUpdate not posible on a spanned archive

The property AddOptions contains AddFreshen or AddUpdate which is not an allowed action on a spanned archive, not even if this archive is on only one disk.

10304  AD_AutoSFXWrong	Error %.1d occurred during Auto SFX creation

This error number is one of the errors as returned by the ConvertSFX method.

10306  AD_InIsOutStream	Input stream may not be set to the output stream

The input stream is the same as the output stream which is not permitted.

10307  AD_InvalidName	Wildcards are not allowed in Filename or file specification

You tried to specify a filename with '*' and/or '?' characters in it.

10308  AD_NoDestDir	Destination directory ''%s'' must exist!

Delete messages

10401  DL_NothingToDel	Error - no files selected for deletion

10402  DL_NoDelOnSpan	Delete Files from an archive not implemented for a spanned zip file

Extract messages

10501  EX_FatalUnZip	Fatal Error in UnzDLL.DLL: abort exception

Internal error while executing code in UnzDll.dll, this should not happen.

10502  EX_UnAttPassword	Warning - Unattended Extract: possible not all files extracted

You were trying to perform an unattended Extract without giving a password first.

  If there are encrypted files in the archive they will not be extracted.

10504  EX_NoExtrDir	Extract directory ''%s'' must exist

Loading DLLs

10650 LD_NoDll	Failed to load %s

Windows could not load the named DLL - most likely could not find it or it is already in use

10651 LD_BadDll	Unable to load %s - It is old or corrupt

The named DLL could not be loaded because it either too old or invalid

See also: DLLDirectory

10652  LD_DllLoaded	Loaded

The named DLL was found and loaded into memory

10653  LD_DllUnloaded 	Unloaded

The named DLL was unloaded

SFX messages

10801  SF_StringTooLong	Error - On or more of the 4 property strings mentioned below exceeds 255 characters!

The text length of one or more of the properties SFXCaption, SFXDefaultDir, SFXCommandLine and SFXMessage exceeds 255 characters.

10802  SF_NoZipSFXBin	Error - DZSFX.BIN not found!

The file 'DZSFX.bin' was not found on the search path and thus can not be used to make a self extracting zip archive.

See also: SFXPath

10803  SF_InputIsNoZip	Error: input file is not a zip file

It is only allowed to convert zip archive (with the extension .zip) to an executable.

10804  SF_NoSFXSupport	Error: Not built with SFX support

10805  SF_MsgTooLong 	SFX Message string exceeds 255 characters!

10806  SF_DefPathTooLong 	SFX Default path exceeds 255 characters!

10807  SF_DlgTitleTooLong 	SFX Dialog title exceeds 255 characters!

10808  SF_CmdLineTooLong  	SFX Command line exceeds 255 characters!

10809  SF_FBkPathTooLong  	SFX Fallback path exceeds 255 characters!

10901  CZ_NoExeSpecified	Error - no .EXE file specified

ZipFileName is not specified. You have to set this property to an existing filename with .EXE extension.

10902  CZ_InputNotExe	Error: input file is not an .EXE file

ZipFileName does not specify a self extracting archive (with .EXE extension).

10903  CZ_SFXTypeUnknown	Error determining the type of SFX archive

The size of the self extracting part of this SFX archive could not be determined.

general messages

11001  DS_NoInFile	Input file does not exist

11002  DS_FileOpen	Zip file could not be opened

11003  DS_NotaDrive	Not a valid drive: %s

The drive letter of the input or output file must be in the range from A to Z.

11004  DS_DriveNoMount	Drive %s is NOT defined

The drive is not available or drive information could not be obtained.

11005  DS_NoVolume	Volume label could not be set

11006  DS_NoMem	Not enough memory to display MsgBox

11007  DS_Canceled	User canceled operation

11008  DS_FailedSeek	Seek error in input file

11009  DS_NoOutFile	Creation of output file failed

Your drive could be write protected.

11010  DS_NoWrite	Write error in output file

11011  DS_EOCBadRead	Error while reading the End Of Central Directory

11012  DS_LOHBadRead	Error while reading a local header

11013  DS_CEHBadRead	Error while reading a central header

11014  DS_LOHWrongSig	A local header signature is wrong

11015  DS_CEHWrongSig	A central header signature is wrong

11016  DS_LONameLen	Error while reading a local file name

11017  DS_CENameLen	Error while reading a central file name

11018  DS_LOExtraLen	Error while reading a local extra field

11019  DS_CEExtraLen	Error while reading a central extra field

11020  DS_DataDesc	Error while reading/writing a data descriptor area

11021  DS_ZipData	Error while reading zipped data

11022  DS_CECommentLen	Error while reading a file comment

11023  DS_EOArchComLen	Error while reading the archive comment

11024  DS_ErrorUnknown	Unknown error in function ReadSpan(), WriteSpan(), Rename() or CopyZippedFiles()

Please report this as a bug preferable with the circumstances under which this occurred.

11025  DS_NoUnattSpan	Unattended disk spanning not implemented

if you want disk spanning (i.e. the AddDiskSpan or AddDiskSpanErase option is set) the program must ask you for the next disk and continue when it's put into the drive. Asking questions is not allowed when you also have set the 'Unattended' property to true.

11026  DS_EntryLost	A local header not found in internal structure

11027  DS_NoTempFile	Temporary file could not be created

11028  DS_LOHBadWrite	Error while writing a local header

11029  DS_CEHBadWrite	Error while writing a central header

11030  DS_EOCBadWrite	Error while writing the End Of Central Directory

11031  DS_ExtWrongSig	Error while reading a Extended Local signature

11032  DS_NoDiskSpace	This disk has not enough free space available

11033  DS_InsertDisk	Please insert last disk

11034  DS_InsertVolume	Please insert disk volume %.1d of %.1d

11035  DS_InDrive	in drive: %s

11036  DS_NoValidZip 	This archive is not a valid Zip archive

11037  DS_FirstInSet 	This is the first disk in a backup set,\n please insert the last disk of this set

11038  DS_NotLastInSet	 	This is the %dth disk in a backup set,\n please insert the last disk of this set

11039  DS_AskDeleteFile	There is already a file %s\n Do you want to overwrite this file

11040  DS_AskPrevFile	ATTENTION: This is previous disk no %d!!!\n Are you sure you want to overwrite the contents

11041  DS_NoSFXSpan	Error - Self extracting archives(.exe) can not be spanned

11042  DS_CEHBadCopy	Error while copying a filename of a CEH structure

11043  DS_EOCBadSeek	Seek error while skipping a EOC structure

11044  DS_EOCBadCopy	Error while copying the zip archive comment

11045  DS_FirstFileOnHD	This is the first file in a backup set,\n please choose the last file of this set

11046  DS_InsertAVolume	Please insert disk volume %.1d

11047  DS_CopyCentral	Central directory

11048  DS_NoDiskSpan	DiskSpanning not supported

11049  DS_UnknownError	Unknown Error

11050  DS_NoRenamePart	Last part left as : %s

11051  DS_FileTooBig	File larger than 4GB

11052  DS_MethodUnknown	Unknown Compression Method

11101  FM_Erase 	Erase %s

11102  FM_Confirm	Confirm

Extra data

11201  ED_SizeTooLarge 	Size of FileExtraData is larger than available array

Change details messages

11301  CD_NoCDOnSpan 	ChangeFileDetails is not implemented for a spanned zip file

11302  CD_NoEventHndlr 	No Event Handler found to Change File Details

11303  CD_LOExtraLen 	Error while writing a local extra field

11304  CD_CEExtraLen 	Error while writing a central extra field

11305  CD_CEComLen 	Error while writing a file comment

11306  CD_FileName 	No FileName in changed file details

11307  CD_CEHDataSize 	The combined length of CEH + FileName + FileComment + ExtraData exceeds 65535

11308  CD_Changing 	Changing details of:

11309  CD_DuplFileName 	Duplicate Filename: %s

11310  CD_NoProtected 	Cannot change details of Excrypted file

11311  CD_InvalidFileName	Invalid Filename: ''%s'

11312  CD_NoChangeDir 	Cannot change path

11313  CD_FileSpecSkip 	Filespec ''%s'' skipped

Additional 'progress' messages

11401 PR_Archive 	*Resetting Archive bit

11402 PR_CopyZipFile 	*Copying Zip File

11403 PR_SFX    	*SFX

11405 PR_Finish  	*Finalising

11406 PR_Copying 	*Copying

11407 PR_CentrlDir 	*Central Directory

11408 PR_Checking	*Checking

11409 PR_Loading	*Loading Directory

Write zip messages

11500 WZ_DropDirOnly 	Dropping %d empty directory entries

11501 WZ_NothingToWrite	Nothing to write

Trace messages

11600 TM_Erasing 	EraseFloppy - Removing %s

11601 TM_Deleting 	EraseFloppy - Deleting %s

11602 TM_GetNewDisk 	Trace : GetNewDisk Opening: %s

NOTE:	Normally you will not see the error/warning numbers, this will only happen when you forget to link with ZipMsgxx.RES.


Dll log file

TZipMaster

To locate where some dll problems are happening it is possible to set the DelZip179.dll to write a log file.

You need to create the file DelZip179.ini in the same folder as DelZip179.dll.

[ZIPDLL]

Level=2

Path="c:\temp\"

Name="DelZip*"

Level

   0 _ off

   1 _ verbose messages

   2 _ trace messages

   3 _ trace messages with log file closed after each write operation (safest but slowest)

Path  (optional)

  some convenient destination

Name (optional)

  Name for the log file

  the ending * means it create a suffix from the time so each 'run' will be unique

Warnings

  1. Writing a log file will reduce the speed - the higher the level the slower it will be

  2. Delete the DelZip179.ini file when finished debugging your problem


Report
TZipMaster.Report

TZipMaster

this PROTECTED function supples feedback from the dlls and vcl routines.

Function CallBack(ActionCode, ErrorCode: integer; NameOrMsg: pChar; FileSize: cardinal; ZRec: PZCallBackStruct): integer;

Description

Sends Action information to Events.

After the event it calls OnCheckTerminate or ProcessMessages.

It returns the Cancel flag;


OnCheckTerminate
TZipMaster.OnCheckTerminate

TZipMaster

 used for Multi-threaded applications

Type

    TCheckTerminateEvent = Procedure(Sender: TObject; Var abort: boolean) Of Object;

property OnCheckTerminate: TCheckTerminateEvent;

Description

Stops Report from calling ProcessMessages (not allowed outside main thread).

Allows checking for Terminate

eg.

procedure ZipThread.CheckTerminate( Sender: TObject; Var abort: boolean);

begin

    if Terminate then

        abort := true;

end;


TZipSFX

the TZipSFX component is used to create and convert self extracting zip archives.

(C)2003 markus stephany, delphizip@mirkes.de, all rights reserved.

For help please refer to the ZipSFX help file dzsfx.chm


PathConcat

function PathConcat(const path, extra: String): String;

Defined in ZMUtils.pas


FileNameMatch

function FileNameMatch(const pat: String; const str: String): Boolean;

Defined in ZMUtils.pas


ForceDirectory

function ForceDirectory(const Dir: String): Boolean;

Defined in ZMUtils.pas


SetSlash

type

  TPathSlashDirection = (psdExternal, psdInternal);

function SetSlash(const path: String; dir: TPathSlashDirection): String;

Defined in ZMUtils.pas

Description

  psdExternal is standard Windows backslash '\'

  psdInternal is Unix slash '/' which is required in stored filenames.


DelimitPath

function DelimitPath(const path: String; sep: Boolean): String;

Defined in ZMUtils.pas


DirExists

function DirExists(const Fname: String): Boolean;

Defined in ZMUtils.pas


IsWild

function IsWild(const fspec: String): Boolean;

Defined in ZMUtils.pas


EraseFile

function EraseFile(const Fname: String; Final: Boolean): Integer;

Defined in ZMUtils.pas


QueryZip

function QueryZip(const Fname: String): Integer;

Defined in ZMUtils.pas


GetVolumeLabel

TZipMaster

Non-member function that returns the name of volume of the drive.

function GetVolumeLabel(const drive: string);

defined in ZMUtils.pas

Description:

This function works only for local drives, if the drive letter is not allowed or is not installed then an empty string will be returned,

Returns the volume name as it could be retrieved via the OS.


IsWinXP

TZipMaster

Non-member function that checks if the current OS is WinXP.

function IsWinXP: boolean;

defined in ZMUtils.pas

Description:

 Returns true if the currently used operating system is WinXP or later.

Uses OSVERSIONINFO and GetVersionInfoEx from the WindowsAPI to get this information.


IsSameFile

TZipMaster

Non-member function that checks if the two filenames in the parameter refer to the same file.

function IsSameFile(const Fname1, Fname2: string): boolean;

Description:

Returns true if both Fname1 and Fname2 are equal after expanding to full path.

If only their filenames are different then we try to find both files, if they are found the file attributes are compared, if these are equal they are assumed to be the same file.


Tools

TZipMaster


ZipResMaker

TZipMaster	See also: Resources

Description

  Used to prepare the resources for binding to executable

<install dir>\TOOLS\ZipResMaker\ZipResMaker.exe


ZMConfig

TZipMaster	See Also: Configuration Settings

Description

     Used to edit the compiler configuration options

<install dir>\TOOLS\Config\ZMConfig.exe

Note

    Recompile and install the component again after changing the settings!