TZipMaster component

Properties Methods Events

Unit

ZipMstr19

Description

The main component to load or edit a zip file


TZipMaster component - See also

See also

<<< See also of TZipMaster component >>>


TZipMaster - Types

PZMRenameRec

PZMSStats

TZMSFXOpt

TZMSFXOpts

TZMZipChangeFunction

TZMForEachFunctionType

TZMRenameRec

TZMAddOpts

TZMAddOptsEnum

TZMAddStoreExts

TZMAddStoreSuffixEnum

TZMCheckTerminateEvent

TZMCopyZippedOverwriteEvent

TZMCRC32ErrorEvent

TZMDeleteOpts

TZMDialogEvent

TZMDiskAction

TZMEncodingOpts

TZMExtractOverwriteEvent

TZMExtraOpts

TZMExtrOptsEnum

TZMFileCommentEvent

TZMFileExtraEvent

TZMGetNextDiskEvent

TZMLoadStrEvent

TZMMergeOpts

TZMMessageEvent

TZMNewNameEvent

TZMOvrOpts

TZMPasswordErrorEvent

TZMProgressDetailsEvent

TZMProgressType

TZMRenameOpts

TZMCompLevel

TZMReplaceOpts

TZMSetExtNameEvent

TZMSkippedEvent

TZMSkipTypes

TZMSkipAborts

TZMSpanOpts

TZMSpanOptsEnum

TZMStateChange

TZMStates

TZMStatusDiskEvent

TZMStreamEvent

TZMString

TZMWideString

TZMWriteOpts

TZMWriteOptsEnum

TZMZipDiskStatus

TZMZipDiskStatusEnum

TZMSStats

TZMStreamOp

TZMProgressDetails

TZMDirEntry

TZMDirRec

TZipMasterEnumerator

TZMPipe

TZMPipeList


TZipMaster - Properties

Properties

Published [image] Read-Only

Active

AddCompLevel

AddFrom

AddOptions

AddStoreSuffixes

Build

Busy

Cancel

ConfirmErase

Count

DirEntry

DirOnlyCnt

DLL_Build

DLL_Load

DLL_Path

DLL_Version

DLLDirectory

EncodeAs

Encoding

Encoding_CP

ErrCode

ErrMessage

ExtAddStoreSuffixes

ExtrBaseDir

ExtrOptions

FSpecArgs

FSpecArgsExcl

FullErrCode

Handle

HowToDelete

IsSpanned

KeepFreeOnAllDisks

KeepFreeOnDisk1

Language

LanguageInfo

MaxVolumeSize

MaxVolumeSizeKb

MinFreeVolumeSize

NoSkipping

NotMainThread

Password

PasswordReqCount

Pipes

RootDir

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOffset

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SpanOptions

SuccessCnt

TempDir

TotalSizeToProcess

Trace

Unattended

UseDirOnlyEntries

UseUTF8

Verbose

Version

WriteOptions

ZipComment

ZipEOC

ZipFileName

ZipFileSize

ZipSOC

ZipStream


TZipMaster - Methods

Methods

Add

AddStreamToFile

AddStreamToStream

AddZippedFiles

AppendSlash

ChangeFileDetails

ConvertToSFX

ConvertToSpanSFX

ConvertToZIP

Copy_File

CopyZippedFiles

Deflate

Delete

EraseFile

Extract

ExtractFileToStream

ExtractStreamToStream

Find

ForEach

FullVersionString

GetAddPassword

GetEnumerator

GetExtrPassword

GetPassword

IndexOf

IsZipSFX

List

MakeTempFileName

QueryZip

ReadSpan

Rename

TheErrorCode

Undeflate

WriteSpan

ZipLoadStr

AbortDLL

Clear

ShowExceptionError

ShowZipFmtMessage

ShowZipMessage


TZipMaster - Events

Events

OnCheckTerminate

OnCopyZippedOverwrite

OnCRC32Error

OnDirUpdate

OnExtractOverwrite

OnFileComment

OnFileExtra

OnGetNextDisk

OnMessage

OnNewName

OnLoadStr

OnPasswordError

OnProgress

OnSetAddName

OnSetCompLevel

OnSetExtName

OnSkipped

OnStateChange

OnStatusDisk

OnStream

OnTick

OnZipDialog


About the TZipMaster component

TZipMaster reference

Purpose

<<< purpose of the TZipMaster component >>>

Tasks

<<< how to use the TZipMaster component >>>


Active Property

Applies to

TZipMaster component

Declaration

property Active: Boolean; default True;

Description

If not True it prevents processing any changes to property changes


AddCompLevel property

Applies to

TZipMaster component

Declaration

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 property

See also Example

Applies to

TZipMaster component

Declaration

property AddFrom: TDateTime;

Description

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

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


AddFrom property - See also

See also

AddOptions

FSpecArgs


AddFrom property - Example


AddOptions property

See also Example

Applies to

TZipMaster component

Declaration

property AddOptions: TZMAddOpts ;

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];

AddDirNames

If True, saves the pathname with each filename. Drive ID's are never stored in Zip file directories.

If AddNoSeparateDirs 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.

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!

AddMove

If True, after adding to archive, delete original file.

WARNING: This is potentially dangerous. Use with caution!

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).

NOTE: Freshen and Update normally work on pre-existing archives. Freshen can only freshen files in an existing archive

AddHiddenFiles

If True, files with their Hidden or System attributes set will be included in the Add operation.

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.

AddEncrypt

If True, files will encrypted (standard zip encryption)

AddNoSeparateDirs

If FALSE , 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: - These directory entries are required to be able restore NTFS time details see AddNTFS .

NOTE: - To use this, you must also have AddDirNames set. Also see: UseDirOnlyEntries

AddVolume

If True, prefix the volume name

AddFromDate

If True, only add files modified on or after AddFrom

AddSafe

If True, forces using a temporary file before replacing the original.

AddVersion

If True, renames the existing file instead of deleting it

AddNTFS

If True, saves the NTFS time stamps


AddOptions property - See also

See also

<<< See also of AddOptions property >>>


AddOptions property - Example


AddStoreSuffixes property

See also Example

Applies to

TZipMaster component

Declaration

property AddStoreSuffixes: TZMAddStoreExts ;

Description

AddStoreSuffixes is a Set of options to modify the default action of the Add method, files with these extensions will stored without compression.

This is because these types of files normally will not compress enough to warrant the time it takes to compress them.

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

assJPG True

assJPEG True

ass7Zp True

assMP3 True

assWMV True

assWMA True

assDVR True

assAVI True

// default file extensions that are best 'stored'

const

ZMDefAddStoreSuffixes = [assGIF..assJAR, assJPG..ass7Zp, assMP3..assAVI];

Note when any type of encryption is used it is best to compress all files!


AddStoreSuffixes property - See also

See also

<<< See also of AddStoreSuffixes property >>>


AddStoreSuffixes property - Example


Build property

See also

Applies to

TZipMaster component

Declaration

property Build: Integer;

Description

returns the build number

:= (1.9 * 1000000) + (REVISION * 10000) + (PATCHLEVEL mod 1000);

Run-time only

Read-only


Build property - See also

See also

Version

DLL_Build

DLL_Version


Busy property

See also

Applies to

TZipMaster component

Declaration

property Busy: Boolean;

Description

Used to check if an operation is still in progress.

Run-time only

Read-only


Busy property - See also

See also

OnStateChange


Cancel property

Applies to

TZipMaster component

Declaration

property Cancel: Boolean;

Description

Set True to abort the current operation.

There may be a delay before the abort will happen and aborting an operation may result in a corrupt zip file.

Run-time only


ConfirmErase property

See also

Applies to

TZipMaster component

Declaration

property ConfirmErase: Boolean;

Description

ConfirmErase can set ZipMaster to ask for confirmation before each disk will be erased when the SpanOption spTryFormat is set.

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


ConfirmErase property - See also

See also

<<< See also of ConfirmErase property >>>


Count property

See also Example

Applies to

TZipMaster component

Declaration

property Count: Integer;

Description

Returns the number of TZMDirEntries in the currently loaded zip file.

Run-time only

Read-only


Count property - See also

See also

DirOnlyCnt

UseDirOnlyEntries


Count property - Example


DirEntry property

See also Example

Applies to

TZipMaster component

Declaration

property DirEntry[idx: Integer]: TZMDirEntry ;

Description

Returns a read-only copy of the central directory entry

Run-time only

Read-only


DirEntry property - See also

See also

<<< See also of DirEntry property >>>


DirEntry property - Example

// read filenames

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

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


DirOnlyCnt property

See also

Applies to

TZipMaster component

Declaration

property DirOnlyCnt: Integer;

Description

Returns the number of hidden directory only entries in the current zip file.

Directory only entries are only hidden if UseDirOnlyEntries is False.

Run-time only

Read-only


DirOnlyCnt property - See also

See also

UseDirOnlyEntries

List


DLL_Build property

See also

Applies to

TZipMaster component

Declaration

property DLL_Build: Integer;

Description

Returns the build number of the loaded DLL.

:= ( (1.90 * 100000) + (REVISION * 1000) + PATCHLEVEL )

Note: if the dll is not already loaded the result will be 0.

Run-time only

Read-only


DLL_Build property - See also

See also

DLLDirectory

DLL loading and unloading

DLL_Load

DLL_Path

DLL_Version

DLL binding methods


DLL_Load property

See also Example

Applies to

TZipMaster component

Declaration

property DLL_Load: Boolean;

Description

Controls the loading/unloading of dynamically bound DLL

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_Load property - See also

See also

DLLDirectory

DLL loading and unloading

DLL_Build

DLL_Path

DLL_Version

DLL binding methods


DLL_Load property - Example


DLL_Path property

See also Example

Applies to

TZipMaster component

Declaration

property DLL_Path: String;

Description

Returns the path of currently loaded dll.

Run-time only

Read-only


DLL_Path property - See also

See also

DLLDirectory

DLL loading and unloading

DLL_Build

DLL_Load

DLL_Version

DLL binding methods


DLL_Path property - Example


DLL_Version property

See also Example

Applies to

TZipMaster component

Declaration

property DLL_Version: String;

Description

Returns the version number of the loaded DLL int the format '1.9.r.bbbb'

r = revision (1..9)

bbbb = build (0.9999)

Run-time only

Read-only


DLL_Version property - See also

See also

DLLDirectory

DLL loading and unloading

DLL_Build

DLL_Load

DLL_Path

DLL binding methods


DLL_Version property - Example


DLLDirectory property

See also Example

Applies to

TZipMaster component

Declaration

property DLLDirectory: String;

Description

The directory used for DelZip200.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).


DLLDirectory property - See also

See also

DLL_Load

DLL loading and unloading

DLL_Build

DLL_Path

DLL_Version

DLL binding methods


DLLDirectory property - Example


EncodeAs property

See also Example

Applies to

TZipMaster component

Declaration

property EncodeAs: TZMEncodingOpts ;

Description

Filename and comment character encoding

zeoUPATH - convert to Ansi but have UTF8 proper name in data

zeoUTF - convert to UTF8

zeoOEM - convert to OEM

zeoNone - store 'as is' (Ansi on Windows)

'default' (zeoAuto) - [in order of preference]

is OEM - use zeoOEM

is Ansi - use zeoNone

can be converted to Ansi - use zeoUPath (unless comment also extended)

use zeoUTF8


EncodeAs property - See also

See also

Encoded

Encoding


EncodeAs property - Example


Encoding property

See also Example

Applies to

TZipMaster component

Declaration

property Encoding: TZMEncodingOpts ;

Description

the Encoding values (writing) -

zeoUPATH

- convert to Ansi but have UTF8 proper name in data

zeoUTF

- convert to UTF8

zeoOEM

- convert to OEM

zeoNone

- store 'as is' (Ansi on Windows)

zeoAuto 'default'

- [in order of preference]

is Ansi - use zeoNone

can be converted to Ansi - use zeoUPath (unless comment also extended)

use zeoUTF8


Encoding property - See also

See also

Encoded

EncodeAs


Encoding property - Example


Encoding_CP property

See also Example

Applies to

TZipMaster component

Declaration

property Encoding_CP: Cardinal;

Description

The Windows Ansi codepage to use for zeoNone encoding or decoding.

Default 0 = Current Windows default.


Encoding_CP property - See also

See also

Encoded

EncodeAs

Encoding


Encoding_CP property - Example


ErrCode property

See also Example

Applies to

TZipMaster component

Declaration

property ErrCode: Integer;

Description

ErrCode is the last error and resource message ID number if it is from the component.

0 = No Error.

See the OnMessage event.

Run-time only


ErrCode property - See also

See also

FullErrCode

ErrMessage


ErrCode property - Example


ErrMessage property

See also Example

Applies to

TZipMaster component

Declaration

property ErrMessage: TZMString ;

Description

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

Run-time only


ErrMessage property - See also

See also

ErrCode

FullErrCode

LanguageInfo

Language


ErrMessage property - Example


ExtAddStoreSuffixes property

See also Example

Applies to

TZipMaster component

Declaration

property ExtAddStoreSuffixes: String;

Description

Allows excluding extra suffixes from being compressed.

Sets assEXT in AddStoreSuffixes

ie ExtAddStoreSuffixes := '.tar,.gz'


ExtAddStoreSuffixes property - See also

See also

AddStoreSuffixes


ExtAddStoreSuffixes property - Example


ExtrBaseDir property

See also Example

Applies to

TZipMaster component

Declaration

property ExtrBaseDir: String;

Description

ExtraBaseDir is base directory used for extracting a Zip archive.

This base directory applies only to 'Extract' operations.

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 property - See also

See also

Extract


ExtrBaseDir property - Example


ExtrOptions property

See also Example

Applies to

TZipMaster component

Declaration

property ExtrOptions: TZMExtrOpts ;

Description

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 OnSkipped 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 .

ExtrForceDirs

If True, forces the existence of the destination directory.

ExtrNTFS

If True, restores file NTFS time stamps.


ExtrOptions property - See also

See also

Extract

NoSkipping


ExtrOptions property - Example


FSpecArgs property

See also Example

Applies to

TZipMaster component

Declaration

property FSpecArgs: TStrings;

Description

Stringlist containing all the file specifications used as arguments for the following methods

Add

AddZippedFiles

ChangeFileDetails

CopyZippedFiles

Delete

Extract

ForEach

Every entry can contain MS-DOS wildcards in the name.ext only.

If you give filenames without pathnames, or if you use with relative pathnames , 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 and Extract can also specify special switches to override some default options.

Note: Before D2009, if UseUTF8 is True the strings must be UTF8.


FSpecArgs property - See also

See also

Switches

FSpecArgsExcl


Filespec Switches

optional arguments between []

MUST BE in specified order

Add

[| OR >] filespec [ /switch [ /switch ...]] [<password]

| stops recursing folders *add only

> forces recursion *add only

filespec the required filename

/switch optional switch of form /char=value (note / must follow space)

c set compression (0..9) *add only

e excludes _ override exclude specs *add only

if value begins with | they are additional to global excludes

if value is empty (|x=) no excludes are used

f: folder _ use new add root or extract base

s force recursion *add only

s- stops recursion *add only

<password encrypt with password [between < and end of line]

Excludes have the form filespec [| filespec [| filepec] ...]

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 or Extracting from a zip archive, When using Delete or CopyZippedFiles never use this!!!


FSpecArgs property - Example

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\System\*.Dll /R' ); // Force recusion

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

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

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

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

ZipMaster1.FSpecArgs.Add( 'C:\Bat\Test.txt /c:2' ); // Set compression level to 2

ZipMaster1.FSpecArgs.Add( 'C:\Bat\Test.txt /C:0'); // Set compression level to 0 (store)

ZipMaster1.FSpecArgs.Add( 'C:\*.* /E:*\.dll\*' ); // only exclude *\.dll\*

ZipMaster1.FSpecArgs.Add( 'C:\*.* /E:|*\asc*' ); // also exclude *\asc*

ZipMaster1.FSpecArgs.Add( '>*.* /E:|*.dll|*.dcu /f:D:/Sources' );

// recursive all files from new root except *.dll or *.dcu or anything in FSpecArgsExcl

ZipMaster1.FSpecArgs.Add( '* /E:*.dll|*.dcu /f:D:\Sources /s- >MyNewPassword' );

// nonrecursive files from new root except *.dll or *.dcu, encrypted with new 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 property

See also Example

Applies to

TZipMaster component

Declaration

property FSpecArgsExcl: TStrings;

Description

Stringlist containing all the file specifications to be excluded for the following methods

Add

AddZippedFiles

Delete

ChangeFileDetails

CopyZippedFiles

Delete

ForEach

Every entry can contain MS-DOS wildcards.

You can specify either the MS-DOS backslash path symbol, or 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.

Multiple filespecs can be specified by delimiting with |

Note: Before D2009, if UseUTF8 is True the strings must be UTF8.


FSpecArgsExcl property - See also

See also

FSpecArgs

Add

AddZippedFiles

Delete

ChangeFileDetails

CopyZippedFiles

Delete

ForEach


FSpecArgsExcl property - 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 property

See also

Applies to

TZipMaster component

Declaration

property FullErrCode: Integer;

Description

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

The difference between ErrCode and FullErrCode is:

1) FullErrCode is only used by the Dll 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.

Dll error code format

0FFF FFFF LLLL LLLL LLLL MTTT EEEE EEEE {31 .. 0}

F = file number (7 bits)

L = line number (12 bits)

M = message instead of error string

T = type (3 bits)

E = error/string code (8 bits)

If this property is 0 then there is no error.

Run-time only


FullErrCode property - See also

See also

ErrCode

ErrMessage

Errors and Mssages


Handle property

Applies to

TZipMaster component

Declaration

property Handle: HWND;

Description

Used for some DLL generated dialogs.

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

Run-time only


HowToDelete property

Applies to

TZipMaster component

Declaration

property HowToDelete: TZMDeleteOpts ;

Description

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

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 property

See also Example

Applies to

TZipMaster component

Declaration

property IsSpanned: Boolean;

Description

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

Run-time only

Read-only


IsSpanned property - See also

See also

ReadSpan

WriteSpan


IsSpanned property - Example


KeepFreeOnAllDisks property

See also Example

Applies to

TZipMaster component

Declaration

property KeepFreeOnAllDisks: Cardinal;

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.


KeepFreeOnAllDisks property - See also

See also

KeepFreeOnDisk1


KeepFreeOnAllDisks property - Example


KeepFreeOnDisk1 property

See also Example

Applies to

TZipMaster component

Declaration

property KeepFreeOnDisk1: Cardinal;

Description

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

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.


KeepFreeOnDisk1 property - See also

See also

KeepFreeOnAllDisks


KeepFreeOnDisk1 property - Example


Language property

See also Example

Applies to

TZipMaster component

Declaration

property Language: string;

Description

Controls the language strings used for ErrMessage.

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 property - See also

See also

LanguageInfo

ErrMessage

OnMessage

Resources

ZipLoadStr

OnLoadStr


Language property - Example


LanguageInfo property

See also Example

Applies to

TZipMaster component

Declaration

property LanguageInfo[Idx: Integer;info: Cardinal]: String;

Description

returns information about a language

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.

Run-time only

Read-only


LanguageInfo property - See also

See also

Language

ErrMessage

OnMessage

Resources

ZipLoadStr

OnLoadStr


LanguageInfo property - Example

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;


MaxVolumeSize property

See also Example

Applies to

TZipMaster component

Declaration

property MaxVolumeSize: Integer;

Description

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

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.)


MaxVolumeSize property - See also

See also

<<< See also of MaxVolumeSize property >>>


MaxVolumeSize property - Example


MaxVolumeSizeKb property

See also Example

Applies to

TZipMaster component

Declaration

property MaxVolumeSizeKb: Integer;

Description

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

This property holds a value in KBytes 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.)


MaxVolumeSizeKb property - See also

See also

<<< See also of MaxVolumeSizeKb property >>>


MaxVolumeSizeKb property - Example


MinFreeVolumeSize property

See also Example

Applies to

TZipMaster component

Declaration

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.


MinFreeVolumeSize property - See also

See also

<<< See also of MinFreeVolumeSize property >>>


MinFreeVolumeSize property - Example


NoSkipping property

See also Example

Applies to

TZipMaster component

Declaration

property NoSkipping: TZMSkipAborts ;

Description

Sets the default action for various failures to process the requested file.

If True, that skip type will fail unless OnSkipped handler sets Err >= 0.


NoSkipping property - See also

See also

TZMSkipAborts

TZMSkippedEvents.

OnSkipped


NoSkipping property - Example


NotMainThread property

See also Example

Applies to

TZipMaster component

Declaration

property NotMainThread: Boolean;

Description

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


NotMainThread property - See also

See also

<<< See also of NotMainThread property >>>


NotMainThread property - Example


ItemPosition property - See also

See also

OnProgress


StartOnDisk property

See also

Applies to

TZMDirEntry class

Declaration

property StartOnDisk: Word;

Description

The first disk of the local header.

Run-time only

Read-only


StartOnDisk property - See also

See also

<<< See also of StartOnDisk property >>>


Password property

See also Example

Applies to

TZipMaster component

Declaration

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 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 '<' 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 property - See also

See also

Password Notes

GetAddPassword

GetExtrPassword

GetPassword

OnZipDialog


Password property - Example


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.


PasswordReqCount property

See also Example

Applies to

TZipMaster component

Declaration

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.


PasswordReqCount property - See also

See also

<<< See also of PasswordReqCount property >>>


PasswordReqCount property - Example


Pipes property

See also Example

Applies to

TZipMaster component

Declaration

property Pipes: TZMPipeList ;

Description

A list that allows Add or Extract to use streams instead of files.


RootDir property

See also Example

Applies to

TZipMaster component

Declaration

property RootDir: String;

Description

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

except those excluded by the FSpecArgExcl property.


RootDir property - See also

See also

Add

FSpecArgs

FSpecArgsExcl

AddOptions

Using Relative Paths


RootDir property - Example

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 property

See also Working with SFX

Applies to

TZipMaster component

Declaration

property SFXCaption: TZMString ;

Description

When you start a executable which was built by ConvertToSFX 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.


SFXCaption property - See also

See also

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXCommandLine property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXCommandLine: TZMString ;

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.


SFXCommandLine property - See also

See also

SFXCaption

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXCommandLine property - Example


SFXDefaultDir property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXDefaultDir: String;

Description

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

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.


SFXDefaultDir property - See also

See also

SFXCaption

SFXCommandLine

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXDefaultDir property - Example


SFXIcon property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

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 SFX stub 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 CZ_NoCopyIcon when using the ConvertToSFX method.

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


SFXIcon property - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXIcon property - Example


SFXMessage property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXMessage: TZMString ;

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 two characters 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 two characters of the string to: 2|.

NOTE: When the first character of the string = '|' then all following chars will be included in the message.


SFXMessage property - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXMessage property - Example


SFXOffset property

See also Example

Applies to

TZipMaster component

Declaration

property SFXOffset: Integer;

Description

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

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.

Run-time only

Read-only


SFXOffset property - See also

See also

<<< See also of SFXOffset property >>>


SFXOffset property - Example


SFXOptions property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXOptions: TSFXOpts ;

Description

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

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

soAskCmdLine allow user to prevent execution of the command line

soAskFiles allow user to prevent certain files from extraction

soHideOverWriteBox do not allow user to choose the overwrite mode

soAutoRun start extraction + evtl. command line automatically

only if sfx filename starts with "!" or is "setup.exe"

soNoSuccessMsg don't show success message after extraction

soExpandVariables expand environment variables in path/cmd line...

soInitiallyHideFiles dont show file listview on startup

soForceHideFiles do not allow user to show files list

(no effect if shfInitiallyShowFiles is set)

soCheckAutoRunFileName can only autorun if !... or setup.exe

soCanBeCancelled extraction can be cancelled

soCreateEmptyDirs recreate empty directories

soSuccessAlways always give success message even if soAutoRun or soNoSuccessMsg


SFXOptions property - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXOptions property - Example


SFXOverwriteMode property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXOverwriteMode: TZMOvrOpts ;

Description

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

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.


SFXOverwriteMode property - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


SFXOverwriteMode property - Example


SFXPath property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXPath: String;

Description

SFXPath is the path where the binary stub file is stored.

Must include the whole pathname, filename, and extension.

This is used by the ConvertToSFX method or writing/rewriting an SFX file.

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.

7. In the application's resources.

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

Set SFXPath to '><' specify that the stub in the resources must be used.


SFXPath property - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXRegFailPath

SFXStub

ConvertToSFX


SFXPath property - Example

zip.SFXPath := 'c:\myapp\zmsfu19.bin'; // must use the specified file

zip.SFXPath := 'zmsfu19.bin'; // search for the specified stub in default folders

zip.SFXPath := '.\bin\zmsfu19.bin'; // search for specified stub in the subfolder 'bin\'

zip.SFXPath := '.\bin\'; // search for default stub in the subfolder 'bin\'

zip.SFXPath := '><'; // use the stub in the attached resources


SFX Stub

The SFX stub is the executable self extractor that does the actual extraction of the zip files.

The source code for the raw stub is distributed in the SFX\ folder.

Depending upon which compiler version is used the stub will either be -

D2009 or later - ZMSFXU19.exe, Unicode that will only run on Windows XP or later.

D2007 or earlier - ZMSFX19.exe, Ansi that will run on most versions of Windows but may have trouble with file names with non-US characters.

These raw stubs have to be prepared using the tool ZipResMaker.exe which appends compressed tables of the required strings and messages in various languages.

ZipResMaker.exe also prepares the stubs as resources that can be attached to the application so that external files are not required.

Prepared stubs are distributed in the \Res folder as -

ZMSFXU19.bin (Unicode).

ZMSFX19.bin (Ansi).

ZMRes19_sfxu.res (Unicode) **.

ZMRes19_sfx.res (Ansi) **.

** either ZMRes19_sfxu.res or ZMRes19_sfx.res may be linked but not both at the same time!


SFX Stub - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

ConvertToSFX


SFXRegFailPath property

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

property SFXRegFailPath: String;

Description

contains the default extraction path, if reading path from registry failed.

Will be expanded if it contains % signs and soExpandEnvStrings is set.

If set to "><", then use temp-dir


SFXRegFailPath property - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXStub

ConvertToSFX


SFXRegFailPath property - Example


SpanOptions property

See also Example

Applies to

TZipMaster component

Declaration

property SpanOptions: TZMSpanOpts ;

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

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

spAnyTime If True, it ignores time stamps when locating last part of set

(normally time stamps must match)

spExactName If True, open the specified file instead of the last part


SpanOptions property - See also

See also

<<< See also of SpanOptions property >>>


SpanOptions property - Example


SuccessCnt property

See also Example

Applies to

TZipMaster component

Declaration

property SuccessCnt: Integer;

Description

Number of files that were successfully operated on (within the current Zip file).

You can read this after every active operation.

Run-time only

Read-only


SuccessCnt property - See also

See also

Add

AddZippedFiles

ChangeFileDetails

CopyZippedFiles

Delete

Extract

ForEach


SuccessCnt property - Example


TempDir property

See also Example

Applies to

TZipMaster component

Declaration

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:

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


TempDir property - See also

See also

<<< See also of TempDir property >>>


TempDir property - Example


TotalSizeToProcess property

See also Example

Applies to

TZipMaster component

Declaration

property TotalSizeToProcess: Int64;

Description

Total uncompressed file size of all files going to be processed while doing an active operation.

It is set in the OnProgress event with event type: TotalSize2Process.

Run-time only

Read-only


TotalSizeToProcess property - See also

See also

<<< See also of TotalSizeToProcess property >>>


TotalSizeToProcess property - Example


Trace property

See also Example

Applies to

TZipMaster component

Declaration

property Trace: Boolean;

Description

Trace is an option to get extended messages during active operations.

Similar to Verbose , except that this one is aimed at developers.

It lets you trace the execution of the code. Helps you locate possible bugs, 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 property - See also

See also

Verbose

Unattended

OnMessage


Trace property - Example


Unattended property

See also Example

Applies to

TZipMaster component

Declaration

property Unattended: Boolean;

Description

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

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.

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


Unattended property - See also

See also

ErrMessage

Verbose

Trace


Unattended property - Example

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;

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


UseDirOnlyEntries property

See also Example

Applies to

TZipMaster component

Declaration

property UseDirOnlyEntries: Boolean;

Description

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

UseDirOnlyEntries can be set to True to include directories in the ZipDirEntry array, default is False.


UseDirOnlyEntries property - See also

See also

<<< See also of UseDirOnlyEntries property >>>


UseDirOnlyEntries property - Example


UseUTF8 property

See also Example

Applies to

TZipMaster component

Declaration

property UseUTF8: Boolean;

Description

Delphi versions before D2009 only.

Early Delphi versions do not natively support Unicode so to support international zip entry strings UseUTF8 can be set.

This means that TZMString will be assumed to be UTF8.


UseUTF8 property - See also

See also

TZMString


UseUTF8 property - Example


Verbose property

See also Example

Applies to

TZipMaster component

Declaration

property Verbose: Boolean;

Description

Verbose is an option to get more messages from operations.

If True, ask for the maximum amount of "possibly important" information from the operation.

The informational messages are delivered to your program via the OnMessage event, and the ErrCode and ErrMessage 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 property - See also

See also

Trace

Unattended

OnMessage


Verbose property - Example


Version property

See also Example

Applies to

TZipMaster component

Declaration

property Version: String;

Description

returns a formated string of the built ZipMaster version '1.9.r.bbbb'

r = revision (1..9)

bbbb = build (0.9999)

Run-time only


Version property - See also

See also

<<< See also of Version property >>>


Version property - Example


WriteOptions property

See also Example

Applies to

TZipMaster component

Declaration

property WriteOptions: TZMWriteOpts ;

Description

Controls how a zip file will be written.

zwoDiskSpan Write as multi-part zip (using SpanOptions )

zwoZipTime Set the zip time stamp to the latest contained file

zwoForceDest Try to force that the destination folder exists


WriteOptions property - See also

See also

SpanOptions

AddOptions

Add

AddZippedFiles

ChangeFileDetails

CopyZippedFiles

Delete

ConvertToSFX

ConvertToSpanSFX

ConvertToZip


WriteOptions property - Example


ZipComment property

See also Example

Applies to

TZipMaster component

Declaration

property ZipComment: String;

Description

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

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


ZipComment property - See also

See also

ZipFilename


ZipComment property - Example


ZipEOC property

See also Example

Applies to

TZipMaster component

Declaration

property ZipEOC: Int64;

Description

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

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

Run-time only

Read-only


ZipEOC property - See also

See also

ZipSOC


ZipEOC property - Example


ZipFileName property

See also Example

Applies to

TZipMaster component

Declaration

property ZipFileName: String;

Description

ZipFileName contains the Zip archive filename.

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.


ZipFileName property - See also

See also

<<< See also of ZipFileName property >>>


ZipFileName property - Example


ZipFileSize property

See also Example

Applies to

TZipMaster component

Declaration

property ZipFileSize: Int64;

Description

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

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

Run-time only

Read-only


ZipFileSize property - See also

See also

<<< See also of ZipFileSize property >>>


ZipFileSize property - Example


ZipSOC property

See also Example

Applies to

TZipMaster component

Declaration

property ZipSOC: Int64;

Description

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

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

Run-time only

Read-only


ZipSOC property - See also

See also

<<< See also of ZipSOC property >>>


ZipSOC property - Example


ZipStream property

See also Example

Applies to

TZipMaster component

Declaration

property ZipStream: TMemoryStream;

Description

Contains the result of ExtractFileToStream , AddStreamToStream and ExtractStreamToStream .

It is the stream to added using AddStreamToFile

Run-time only


ZipStream property - See also

See also

AddStreamToFile

AddStreamToStream

ExtractFileToStream

ExtractStreamToStream.


ZipStream property - Example


Add method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function Add: Integer;

Description

The Add method adds the specified files to the archive.

Adds all files specified in the FSpecArgs property and not excluded in the FSpecArgExcl 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.

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

If an operation is already in progress it returns ErrCode or BUSY_ERROR.

Normally returns ErrCode and sets SuccessCnt to the number of files added.

Returns 0 on success otherwise an Error Code .


Add method - See also

See also

AddOptions

AddStoreSuffixes

Relative paths


Add method - Example


AddStreamToFile method

See also Example

Applies to

TZipMaster component

Declaration

function AddStreamToFile(const FileName: String; FileDate, FileAttr: Dword): Integer;

Description

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

Adds stream data, which should be in ZipStream , to the zip archive ZipFileName 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.


AddStreamToFile method - See also

See also

ZipStream.

AddStreamToStream

ExtractFileToStream

ExtractStreamToStream.


AddStreamToFile method - Example

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 method

See also Example

Applies to

TZipMaster component

Declaration

function AddStreamToStream(InStream: TMemoryStream): TMemoryStream;

Description

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

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.


AddStreamToStream method - See also

See also

AddStreamToFile

ZipStream.

ExtractFileToStream

ExtractStreamToStream.


AddStreamToStream method - Example

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.


AddZippedFiles method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function AddZippedFiles(SrcZipMaster: TCustomZipMaster; merge: TZMMergeOpts ): Integer;

Description

Adds selected zipped files from another ZipMaster.

merge controls how duplicates will be handled - if zmoConfirm is set OnCopyZippedOverwrite will be fired for each conflict.

Returns 0 on success otherwise an Error Code .


AddZippedFiles method - See also

See also

CopyZippedFiles


AddZippedFiles method - Example

// copy AutoExec.bat and Config.sys to another zip

Zip1.ZipFileName = 'SourceZip.zip'; // Open the source

if Zip1.ErrCode <> 0 then // check no error

handle_the_error!

Zip1.FSpecArgs.Clear;

Zip1.FSpecArgs.Add( 'AutoExec.bat' ); // select required files

Zip1.FSpecArgs.Add( 'Config.sys' );

Zip2:= TZipMaster19.Create(self); // create ZipMaster 2

Zip2.ZipFileName := 'DestinationZip.zip'; // set the destination

if Zip2.ErrCode <> 0 then

handle_the_error!

Zip2.HowToDelete := htdAllowUndo; // 'safely' replace the destination

Result := Zip2.CopyZippedFiles( Zip1, true, OvrConfirm ); // copy files to destination, remove from source

if Result <> 0 then

handle_the_error!

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 afterwards.


AppendSlash method

See also Example

Applies to

TZipMaster component

Declaration

function AppendSlash(const sDir: String): String;

Description

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


AppendSlash method - See also

See also

<<< See also of AppendSlash method >>>


AppendSlash method - Example


ChangeFileDetails method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function ChangeFileDetails(func: TZMChangeFunction ; var Data): Integer;

Description

Allows changing the details of each selected entry.

If NoSkipping is True all selected files must be successfully processed otherwise the operation will fail.

If any errors occur then no changes will be written.

Data is passed to each call of func to allow access to any needed data.

Returns 0 on success otherwise an Error Code .

On exit

FSpecArgs contains processed file names.

FSpecArgsExcl contains skipped files


ChangeFileDetails method - See also

See also

ForEach


ChangeFileDetails method - Example

// if 'data' = 1 renames with '6' replaced by '_6'

function CFDfunc1(theRec: TZMDirRec; var Data): Integer;

var

iData: integer Absolute Data;

begin

if iData = 1 then

Result := theRec.ChangeName(StringReplace(theRec.FileName, '6', '_6', [rfReplaceAll]))

else

Result := 1; // nothing done

end;

function TForm1.ChangeName: Integer;

var

data: Integer;

begin

data := 1;

ZipMaster191.FSpecArgs.Add('*6.txt');

Result := ZipMaster191.ChangeFileDetails(CFDfunc1, data);

end;

// Change the file date

function CFDfunc2(theRec: TZMDirRec; var Data): Integer;

var

iData: Cardinal Absolute Data;

begin

Result := theRec.ChangeDate(iData);

end;

function TForm1.ChangeDate: Integer;

var

data: Cardinal;

testDate: TDateTime;

begin

testDate := StrToDateTime('10/04/2003 3:14');

data := DateTimeToFileDate(testDate);

ZipMaster191.FSpecArgsExcl.Clear;

ZipMaster191.FSpecArgs.Clear;

ZipMaster191.FSpecArgs.Add('*d*.txt');

Result := ZipMaster191.ChangeFileDetails(CFDfunc2, data);

end;

// Change the file comment

function CFDfunc3(theRec: TZMDirRec; var Data): Integer;

var

iData: String Absolute Data;

begin

Result := theRec.ChangeComment(iData);

end;

function TForm1.ChangeComment: Integer;

var

Comment: String;

begin

Comment := 'some comment';

ZipMaster191.FSpecArgsExcl.Clear;

ZipMaster191.FSpecArgs.Clear;

ZipMaster191.FSpecArgs.Add('*a*.txt');

Result := ZipMaster191.ChangeFileDetails(CFDfunc3, Comment);

end;

// Change the file attribute

function CFDfunc4(theRec: TZMDirRec; var Data): Integer;

var

iData: DWORD Absolute Data;

begin

Result := theRec.ChangeAttrs(iData);

end;

function TForm1.ChangeAttributes: Integer;

var

newAttr: DWORD;

begin

newAttr := FILE_ATTRIBUTE_READONLY;

ZipMaster191.FSpecArgsExcl.Clear;

ZipMaster191.FSpecArgs.Clear;

ZipMaster191.FSpecArgs.Add('*l*.txt');

Result := ZipMaster191.ChangeFileDetails(CFDfunc4, newAttr);

end;

procedure TForm1.Button1Click(Sender: TObject);

var

err: Integer;

begin

ZipMaster191.Clear;

ZipMaster191.ZipFileName := 'zTest.zip';

if ZipMaster191.Count > 1 then

begin

err := ChangeName;

Memo1.Lines.Add(Format(' ChangeName returns %d [ %d files ]', [err, ZipMaster191.SuccessCnt]));

if err <> 0 then

Memo1.Lines.Add(' failed ' + ZipMaster191.ErrMessage)

else

begin

Memo1.Lines.Add('Changed files ----');

Memo1.Lines.AddStrings(ZipMaster191.FSpecArgs);

Memo1.Lines.Add('Skipped files ----');

Memo1.Lines.AddStrings(ZipMaster191.FSpecArgsExcl);

end;

err := ChangeDate;

Memo1.Lines.Add(Format(' ChangeDate returns %d [ %d files ]', [err, ZipMaster191.SuccessCnt]));

if err <> 0 then

Memo1.Lines.Add(' failed ' + ZipMaster191.ErrMessage);

err := ChangeComment;

Memo1.Lines.Add(Format(' ChangeComment returns %d [ %d files ]', [err, ZipMaster191.SuccessCnt]));

if err <> 0 then

Memo1.Lines.Add(' failed ' + ZipMaster191.ErrMessage);

err := ChangeAttributes;

Memo1.Lines.Add(Format(' ChangeAttributes returns %d [ %d files ]', [err, ZipMaster191.SuccessCnt]));

if err <> 0 then

Memo1.Lines.Add(' failed ' + ZipMaster191.ErrMessage);

end;

end;


Selecting files

Most operations will be done on selected file entries only.

File entries are selected by specs in FSpecArgs if not excluded by specs in FSpecArgsExcl .


ConvertToSFX method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function ConvertToSFX: 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 or a negative error value on failure Error Code .

IMPORTANT:

Before using ConvertSFX, you may want to first set

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXRegFailPath

SFXPath property to the full pathname of the SFX stub . If you don't set this property, ZipBuilder 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.


ConvertToSFX method - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSpanSFX

ConvertToZIP


ConvertToSFX method - Example


ConvertToSpanSFX method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function ConvertToSpanSFX(const OutFile: String): Integer;

Description

Convert Zip archive to self-extracting .EXE with a detached header (loader) and convert the zip file to a spanned zip.

OutFile is the name of the resulting .EXE file and the base name for the spanned volumes.

This function returns 0 on success or a negative error value on failure Error Code .

IMPORTANT:

Before using ConvertSFX, you may want to first set

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXRegFailPath

SFXPath property to the full pathname of the SFX stub . If you don't set this property, ZipBuilder 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.


ConvertToSpanSFX method - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX


ConvertToSpanSFX method - Example


ConvertToZIP method

See also Example

Applies to

TZipMaster component

Declaration

function ConvertToZIP: 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 rewriting the file with new offsets after changing its extension.

This function returns 0 on success or a negative error value on failure Error Code .

WARNING: The use of ConvertToZIP 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 ConvertToZIP 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.


ConvertToZIP method - See also

See also

SFXCaption

SFXCommandLine

SFXDefaultDir

SFXIcon

SFXMessage

SFXOptions

SFXOverwriteMode

SFXPath

SFXRegFailPath

SFXStub

ConvertToSFX

ConvertToSpanSFX


ConvertToZIP method - Example


Copy_File method

See also Example

Applies to

TZipMaster component

Declaration

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 function returns 0 on success or a negative error value on failure Error Code .

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 method - See also

See also

<<< See also of Copy_File method >>>


Copy_File method - Example

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' );


CopyZippedFiles method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function CopyZippedFiles(DestZipMaster: TCustomZipMaster; DeleteFromSource: Boolean; OverwriteDest: TZMMergeOpts ): 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 selected in 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

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

zmoAlways Always overwrite existing files in the destination

zmoNewer Overwrite only when the source file is younger than the destination file

zmoOlder Overwrite only when the source file is older than the destination file

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

This function returns 0 on success or a negative error value on failure Error Code .


CopyZippedFiles method - See also

See also

AddZippedFiles

OnCopyZipOverwrite

TZMMergeOpts


CopyZippedFiles method - Example

// copy AutoExec.bat and Config.sys to another zip

Zip1.ZipFileName = 'SourceZip.zip'; // Open the source

if Zip1.ErrCode <> 0 then // check no error

handle_the_error!

Zip1.FSpecArgs.Clear;

Zip1.FSpecArgs.Add( 'AutoExec.bat' ); // select required files

Zip1.FSpecArgs.Add( 'Config.sys' );

Zip1:= TZipMaster19.Create(self); // create ZipMaster 2

Zip2.ZipFileName := 'DestinationZip.zip'; // set the destination

if Zip2.ErrCode <> 0 then

handle_the_error!

Zip2.HowToDelete := htdAllowUndo; // 'safely' replace the destination

Result := Zip1.CopyZippedFiles( Zip2, true, zmoConfirm ); // copy files to destination, remove from source

if Result <> 0 then

handle_the_error!

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 afterwards.


Deflate method

See also Example

Applies to

TZipMaster component

Declaration

function Deflate(OutStream, InStream: TStream; Length: Int64; var Method: TZMDeflates ; var CRC: Cardinal): Integer;

Description

Compress InStream to OutStream, set method and CRC on success.

Length = the size of the data on InStream to be deflated (-1 = full length).

Method = the requested compression method, on exit it will be the method used.

This function returns 0 on success or a negative error value on failure Error Code .


Deflate method - See also

See also

Undeflate


Deflate method - Example

instream := TFileStream.Create(fn, fmOpenRead);

try

instream.Position := 0;

Orig := instream.Size;

outstream := TFileStream.Create('deflated.bin', fmCreate);

try

method := zmDeflate;

crc := 0;

Result := zip.Deflate(outstream, instream, -1, method, crc);

Display('orig = ' + IntToStr(Orig) + ' size = ' + IntToStr(outstream.Size)

+ ' posn = ' + IntToStr(outstream.Position) + ' method = ' +

' crc = ' + IntToHex(crc, 4));

if z.SuccessCnt = 1 then

begin

Display('Deflate success');

end;

finally

outstream.Free;

end;

finally

instream.Free;

end;

if Result <> 0 then

handle_error!


Delete method

See also Example Working with SFX

Applies to

TZipMaster component

Declaration

function Delete: Integer;

Description

Deletes selected files from the archive specified by the ZipFileName property.


Delete method - See also

See also

<<< See also of Delete method >>>


Delete method - Example


EraseFile method

See also Example

Applies to

TZipMaster component

Declaration

function EraseFile(const FName: String; How: TZMDeleteOpts ): 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.


EraseFile method - See also

See also

<<< See also of EraseFile method >>>


EraseFile method - Example


Extract method

See also Example

Applies to

TZipMaster component

Declaration

function Extract: Integer;

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 to ExtrBaseDir

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.

Returns 0 on success otherwise an ErrCode


Extract method - See also

See also

FSpecArgs

ZipFileName

ExtrBaseDir

ExtrOptions

SuccessCnt

OnMessage

ErrCode


Extract method - Example


ExtractFileToStream method

See also Example

Applies to

TZipMaster component

Declaration

function ExtractFileToStream(const FileName: String): TMemoryStream;

Description

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

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 method - See also

See also

AddStreamToFile

AddStreamToStream

ZipStream.

ExtractStreamToStream.


ExtractFileToStream method - Example


ExtractStreamToStream method

See also Example

Applies to

TZipMaster component

Declaration

function ExtractStreamToStream(InStream: TMemoryStream; OutSize: Longword): TMemoryStream;

Description

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

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.


ExtractStreamToStream method - See also

See also

AddStreamToFile

AddStreamToStream

ExtractFileToStream

ZipStream.


ExtractStreamToStream method - Example

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: TMemoryStream;

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

MyData.Free;

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

MsgForm.RichEdit1.Lines.LoadFromStream( ZipMaster1.ZipStream );

MsgForm.Show;


Find method

See also Example

Applies to

TZipMaster component

Declaration

function Find(const fspec: TZMString ; var idx: Integer): TZMDirEntry ;

Description

Finds the first occurance of fspec after idx.

If found sets idx to the found index and returns a read-only copy of the entry.


Find method - See also

See also

<<< See also of Find method >>>


Find method - Example


ForEach method

See also Example

Applies to

TZipMaster component

Declaration

function ForEach(func: TZMForEachFunction ; var Data): Integer;

Description

Applies func to each selected entry.

func can not modify any entry.

If NoSkipping is True all selected files must be successfully processed otherwise the operation will fail.

Data is passed to each call of func to allow access to any needed data.

Returns 0 on success otherwise an ErrCode .

On exit

FSpecArgs contains processed file names.

FSpecArgsExcl contains skipped files


ForEach method - See also

See also

ChangeFileDetails


ForEach method - Example

// sum the compressed sizes in DATA

function FEfunc1(theRec: TZMDirEntry; var Data): Integer;

var

iData: Int64 Absolute Data;

begin

Result := 0; // success

iData := iData + theRec.CompressedSize;

end;

function TForm1.SumCompressed: Int64;

var

total: Int64;

begin

total := 0;

if ZipMaster.ForEach(FEfunc1, total) <> 0 then

raise Exception.Create('ForEach failed');

Result := total;

end;

procedure TForm1.Button2Click(Sender: TObject);

var

total: Int64;

begin

ZipMaster.Clear;

ZipMaster.ZipFileName := 'zTest.zip';

if ZipMaster.Count > 1 then

begin

ZipMaster.FSpecArgs.Add('*k*.txt'); // select some files

total := SumCompressed;

Memo1.Lines.Add(Format(' Total compressed size %d [ %d files ]', [total, ZipMaster.SuccessCnt]));

end;

end;


FullVersionString method

Applies to

TZipMaster component

Declaration

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.


GetAddPassword method

See also Example Note on passwords:

Applies to

TZipMaster component

Declaration

function GetAddPassword: String;

function GetAddPassword(var Response: TmsgDlgBtn): String;

Description

The GetAddPassword method will ask the user for a password used while adding files.

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 overloaded version also gives the user's response.


GetAddPassword method - See also

See also

GetExtrPassword

GetPassword


GetAddPassword method - Example


GetEnumerator method

Applies to

TZipMaster component

Declaration

function GetEnumerator: TZipMasterEnumerator ;

Description

D2007 and up only

Returns a copy of the enumerator


GetExtrPassword method

See also Example Note on passwords:

Applies to

TZipMaster component

Declaration

function GetExtrPassword: String;

function GetExtrPassword(var Response: TmsgDlgBtn): String;

Description

The GetExtrPassword method will ask the user for a password used while extracting files.

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 overloaded version also gives the user's response.


GetExtrPassword method - See also

See also

GetAddPassword

GetPassword


GetExtrPassword method - Example


GetPassword method

See also Example Note on passwords:

Applies to

TZipMaster component

Declaration

function GetPassword(const DialogCaption, MsgTxt: String; pwb: TmsgDlgButtons; var ResultStr: String): TmsgDlgBtn;

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( ZipLoadStr( PW_Caption ), ZipLoadStr( PW_MessageEnter ) + ': for file ' + ForFile, NewPassword );

or

ZipMaster1.GetPassword( ZipLoadStr( PW_Caption ), ZipLoadStr( 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 method - See also

See also

GetExtrPassword

GetAddPassword


GetPassword method - Example


IndexOf method

See also Example

Applies to

TZipMaster component

Declaration

function IndexOf(const FName: TZMString ): Integer;

Description

returns the index of the first entry with FName.


IndexOf method - See also

See also

Find


IndexOf method - Example


IsZipSFX method

See also Example

Applies to

TZipMaster component

Declaration

function IsZipSFX(const SFXExeName: String): Integer;

Description

Checks if a file is likely to be an SFX archive.

Return value:

0 = The specified file is not a SFX

1 = might be stub of unknown type

17 = found 1.7 SFX headers

19 = found 1.9 SFX headers

>0 on errors

-7 = Open, read or seek error

-8 = memory error

-9 = exception error

-10 = all other exceptions


IsZipSFX method - See also

See also

QueryZip

CheckSFXType


IsZipSFX method - Example


List method

See also Example

Applies to

TZipMaster component

Declaration

function List: Integer;

Description

The List method will read the Zip archive and refresh the contents list.

This is a manual "refresh" of the "Table of Contents". This occurs automatically whenever a filename is assigned to ZipFileName .

Returns 0 on success otherwise an ErrCode .


List method - See also

See also

<<< See also of List method >>>


List method - Example


MakeTempFileName method

Applies to

TZipMaster component

Declaration

function MakeTempFileName(const Prefix, Extension: String): String;

Description

The MakeTempFileName method constructs a filename of the form 'C:\....\zipxxxx.zip' where xxxx is a unique number.

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.


QueryZip method

See also Example

Applies to

TZipMaster component

Declaration

function QueryZip(const FName: String): Integer;

Description

Tests for the existence of various parts of a zip file returning a positive bit mapped integer of values.

const // QueryZip return bit values and errors

zqbStartEXE = 1; // is EXE file may be SFX

zqbStartLocal = 2; // normal zip file start

zqbStartSpan = 4; // first part of span

zqbStartCentral = 8; // continuing Central Header

zqbHasComment = 16; // comment length good (no junk at end)

zqbHasLocal = 32; // first Central entry points to local header

zqbHasCentral = 64; // Central entry where it should be

zqbHasEOC = 128; // End of Central entry

zqbHasLoc64 = 256; // EOC64 locator entry

zqbHasEOC64 = 512; // Zip64 EOC

zqbJunkAtEnd = 1024; // junk at end of zip

zqbIsDiskZero = 2048; // is disk 0

zqFieldError = -5; // bad field value

zqFileError = -7; // file handling error

zqGeneralError = -9; // unspecified failure


QueryZip method - See also

See also

<<< See also of QueryZip method >>>


QueryZip method - Example


ReadSpan method

See also Example

Applies to

TZipMaster component

Declaration

function ReadSpan(const InFileName: String; var OutFilePath: String): Integer;

Description

The ReadSpan method reads a spanned zip archive file and writes it back as one zip file.

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

-8 Memory allocation error. ( GE_NoMem )

-9 General unknown ReadSpan error. ( DS_ErrorUnknown )


ReadSpan method - See also

See also

WriteSpan


ReadSpan method - Example


Rename method

See also Example

Applies to

TZipMaster component

Declaration

function Rename(RenameList: TList; DateTime: Integer; How: TZMRenameOpts = htrDefault): Integer;

Description

With the Rename method you can rename a filename and/or path to a different one.

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 ZMRename records:

Type TZMRenameRec = record

Source: String; // The Source filename/path as present in the ziparchive.

Dest: String; // The Destination filename/path, this will be the new name.

Comment: String; // A new comment for this entry

DateTime: Integer; // A new Date/Time for this specific destination or 0.

End;

PZMRenameRec = ^TZMRenameRec;

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 virtually 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-2009 21:05:10' ) );

Returns 0 on success otherwise an Error Code .

In case of error Rename will return the error value, the meaning of these values can be found in Error and warning messages

This returned error values are indicators that there are errors reported, the correct error has to be looked up in the FSpecArgsExcl objects for each file

Path Names

When during the Rename action the pathnames has to be kept the AddOptions AddDirNames has to be set before starting the Rename action.

Example:

zip.AddOptions = AddOptions + [AddDirNames];

If this option is NOT set Rename will remove the Path names in the archive.

Comments

Setting a file comment:

If not renaming then either set Dest = '|' or Dest = Source

To add/replace a file comment assign a non-empty string.

To delete a file comment assign the string #0 (RenRec.Comment = #0;)

Errors and skipped files during Rename:

When a file is skipped in a rename action because some problem is found an OnSkipped event is fired.


Rename method - See also

See also

ChangeFileDetails


Rename method - Example

Example:

Var

ZipRenameList: TList;

RenRec: PZipRenameRec;

Err: Integer;

i: Integer;

FileErr: Integer;

BadFile: String;

FileErrMsg: String;

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 );

Err := ZipMaster1.Rename( ZipRenameList, 0 );

Dispose( RenRec );

ZipRenameList.Free( );

if Err then // there are errors

begin // read them

For i := 0 to Pred(ZipMaster1.FSpecArgsExcl.Count) do

begin

// get the name of the file

BadFile := ZipMaster1.FSpecArgsExcl[i];

// get the error number for that file

FileErr := Integer(Pointer(ZipMaster1.FSpecArgsExcl.Objects[i]));

// get the message for that error

FileErrMsg := ZipLoadStr(FileErr);

end;

end;

End;


TheErrorCode method

See also Example

Applies to

TZipMaster component

Declaration

function TheErrorCode(errCode: Integer): Integer;

Description

Strips off the ZMReentry_Error, returns the actual error


TheErrorCode method - See also

See also

<<< See also of TheErrorCode method >>>


TheErrorCode method - Example


Undeflate method

See also Example

Applies to

TZipMaster component

Declaration

function Undeflate(OutStream, InStream: TStream; Length: Int64; var Method: TZMDeflates ; var CRC: Cardinal): Integer;

Description

De-compress InStream to OutStream, set method and CRC on success.

If encryption was used on Entry CRC must be set to the value given by Deflate

Returns 0 on success otherwise an ErrCode .


Undeflate method - See also

See also

Deflate


Undeflate method - Example

instream := TFileStream.Create('deflated.bin', fmOpenRead);

try

outstream := TFileStream.Create('zb.tmp', fmCreate);

try

method := zmStore;

crc := 0;

Result := zip.Undeflate(outstream, instream, -1, method, crc);

Display('size = ' + IntToStr(outstream.Size) + ' posn = ' + IntToStr

(outstream.Position) + ' method = ' + crc = ' + IntToHex(crc, 4));

if z.SuccessCnt = 1 then

begin

Display('success');

end;

finally

outstream.Free;

end;

finally

instream.Free;

end;

if Result <> 0 then

handle_error!


WriteSpan method

See also Example

Applies to

TZipMaster component

Declaration

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

Description

The WriteSpan method can be used to copy an existing zip archive file to one or more disks as a spanned archive.

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

-8 Memory allocation error. ( GE_NoMem )

-9 General unknown WriteSpan error. ( DS_ErrorUnknown )


WriteSpan method - See also

See also

ReadSpan

MaxVolumeSize

KeepFreeOnDisk1

MinFreeVolumeSize

Handling of Multi Volume Zip parts


WriteSpan method - Example


ZipLoadStr method

See also Example

Applies to

TZipMaster component

Declaration

function ZipLoadStr(Id: Integer): string;

Description

Returns the message for the given Id.


ZipLoadStr method - See also

See also

OnLoadStr

Language

LanguageInfo


ZipLoadStr method - Example


AbortDLL method

See also Example

Applies to

TZipMaster component

Declaration

procedure AbortDLL;

Description

Forces the current DLL operation to abort.


AbortDLL method - See also

See also

<<< See also of AbortDLL method >>>


AbortDLL method - Example


Clear method

See also Example

Applies to

TZipMaster component

Declaration

procedure Clear;

Description

Clears internal strings, entries and settings back to default.


Clear method - See also

See also

<<< See also of Clear method >>>


Clear method - Example


ShowExceptionError method

See also Example

Applies to

TZipMaster component

Declaration

procedure ShowExceptionError(const ZMExcept: EZipMaster);

Description

If Unattended is True, sends the exception message through the OnMessage event, otherwise it is displayed in a MessageBox.

EZipMaster, derived from Exception, is used for exceptions throughout the component code.


ShowExceptionError method - See also

See also

<<< See also of ShowExceptionError method >>>


ShowExceptionError method - Example


ShowZipFmtMessage method

See also Example

Applies to

TZipMaster component

Declaration

procedure ShowZipFmtMessage(Id: Integer; const Args: array of const);

Description

The ShowZipMessage method reads a message identified by Ident from the program resource table, formats it and displays it.

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, formats using 'Args' 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.)


ShowZipFmtMessage method - See also

See also

ErrMessage

OnMessage

ShowZipMessage


ShowZipFmtMessage method - Example


ShowZipMessage method

See also Example

Applies to

TZipMaster component

Declaration

procedure ShowZipMessage(Ident: Integer; const UserStr: String);

Description

The ShowZipMessage method reads a message identified by Ident from the program resource table and displays it.

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 method - See also

See also

ErrMessage

OnMessage

ShowZipFmtMessage


ShowZipMessage method - Example


OnCheckTerminate event

See also Example

Applies to

TZipMaster component

Declaration

property OnCheckTerminate: TZMCheckTerminateEvent ;

Type

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

Description

used for Multi-threaded applications

Stops message processing from calling ProcessMessages (not allowed outside main thread).

Allows checking for Terminate


OnCheckTerminate event - See also

See also

<<< See also of OnCheckTerminate event >>>


OnCheckTerminate event - Example

// stops calls to ProcessMessages & checks for Terminated

procedure TZipThread.CheckTerminate(Sender: TObject; var stop: boolean);

begin

if Terminated then

stop := true;

end;


OnCopyZippedOverwrite event

See also Example

Applies to

TZipMaster component

Declaration

property OnCopyZippedOverwrite: TZMCopyZippedOverwriteEvent ;

Type

TZMCopyZippedOverwriteEvent = procedure(Sender: TObject; src, dst: TZMDirEntry ; var DoOverwrite: Boolean) of object;

Description

Occurs when during the execution of the function CopyZippedFiles or AddZippedFiles 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 dst. FileName by setting DoOverwrite to True. The default for DoOverwrite is False.


OnCopyZippedOverwrite event - See also

See also

CopyZippedFiles

AddZippedFiles


OnCopyZippedOverwrite event - Example


OnCRC32Error event

See also Example

Applies to

TZipMaster component

Declaration

property OnCRC32Error: TZMCRC32ErrorEvent ;

Type

TZMCRC32ErrorEvent = Procedure( Sender: TObject; ForFile: TZMString ; FoundCRC, ExpectedCRC: LongWord; var DoExtract: Boolean ) of object;

Description

OnCRC32Error event occurs when a CRC error is found while extracting.

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 event

See also Example

Applies to

TZipMaster component

Declaration

property OnDirUpdate: TNotifyEvent;

Description

OnDirUpdate event occurs when ZipMaster has refreshed the contents list.

Occurs immediately after ZipMaster reads the central directory.

This is your queue to update the screen with the new contents.


OnExtractOverwrite event

See also Example

Applies to

TZipMaster component

Declaration

property OnExtractOverwrite: TZMExtractOverwriteEvent ;

Description

OnExtractOverwrite event occurs when during an Extract a file could be overwritten.

Type

TZMExtractOverwriteEvent = procedure(Sender: TObject; const ForFile: TZMString ; IsOlder: Boolean; var DoOverwrite: Boolean; DirIndex: Integer) of object;

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 in the internal list. With this you have full access to all available archive file information for this file.


OnExtractOverwrite event - See also

See also

<<< See also of OnExtractOverwrite event >>>


OnExtractOverwrite event - Example

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;


OnFileComment event

See also Example

Applies to

TZipMaster component

Declaration

property OnFileComment: TZMFileCommentEvent ;

Type

TZMFileCommentEvent = procedure( Sender: TObject; ForFile: TZMString , var FileComment: TZMString , var IsChanged: Boolean ) of object;

Description

OnFileComment event occurs when writing the central directory of the zip archive for every file in the archive.

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.


OnFileComment event - See also

See also

<<< See also of OnFileComment event >>>


OnFileExtra event

See also Example

Applies to

TZipMaster component

Type

TZMFileExtraEvent = procedure(Sender: TObject; const ForFile: TZMString ;

var Data: RawByteString; var IsChanged: Boolean) of object;

Declaration

property OnFileExtra: TZMFileExtraEvent ;

Description

ForFile is the name of file to formatted extra data.

Data is the data to be set.

Note: This is dangerous to do unless you are careful.


OnGetNextDisk event

See also Example

Applies to

TZipMaster component

OnGetNextDisk event occurs when a disk is needed during disk spanning.

Type TZMGetNextDiskEvent = procedure( Sender: TObject; DiskSeqNo, DiskTotal: Integer; Drive: String, var Cancel: Boolean ) of object;

Declaration

property OnGetNextDisk: TZMGetNextDiskEvent ;

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.


OnGetNextDisk event - See also

See also

<<< See also of OnGetNextDisk event >>>


OnGetNextDisk event - 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 event

See also Example

Applies to

TZipMaster component

OnMessage event occurs when a DLL or the component sends a message to your program.

Type TZMMessageEvent= procedure( Sender: TObject; ErrCode: Integer; ErrMsg: TZMString ) of object;

Declaration

property OnMessage: TZMMessageEvent ;

Description

The ErrMsg argument 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 event - See also

See also

ErrCode

Verbose

Trace


OnMessage event - Example


OnNewName event

See also Example

Applies to

TZipMaster component

The OnNewName event occurs when reading the zip central directory for each entry

type

TZMNewNameEvent = procedure(Sender: TObject; SeqNo: Integer) of object;

Declaration

property OnNewName: TZMNewNameEvent ;

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 event - See also

See also

DirEntry

TZMDirEntry

OnDirUpdate

UseDirOnlyEntries


OnNewName event - Example


OnPasswordError event

See also Example

Note on passwords:

Applies to

TZipMaster component

OnPasswordError event occurs when a DLL needs a password for encryping or decrypting.

Type TZMPasswordErrorEvent = Procedure( Sender: TObject; IsZipAction: Boolean; var NewPassword: String; ForFile: TZMString ; var RepeatCount: LongWord ; var Action: TMsgDlgBtn ) of object;

Declaration

property OnPasswordError: TZMPasswordErrorEvent ;

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 an Add action else it is from 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 event - See also

See also

GetExtrPassword

GetAddPassword

GetPassword


OnPasswordError event - Example

Procedure TMainForm.ZipBuilder1PasswordError(Sender: TObject;

IsZipAction: Boolean; var NewPassword: String; const ForFile: String;

var RepeatCount: LongWord; var Action: TMsgDlgBtn )

Begin

if IsZipAction then

Action := ZipMaster1.GetPassword(ZipMaster1.Info(PW_Caption),

ZipMaster1.Info(PW_MessageEnter),

DHC_AddPwrd1,

[mbOK << mbCancel],

NewPassword);

else

Action := ZipMaster1.GetPassword(ZipMaster1.Info(PW_Caption),

ZipMaster1.Info(PW_MessageEnter) +

ZipMaster1.Info(PW_ForFile) +

ForFile,

[mbOK << mbCancel << mbAll],

NewPassword );

End;


OnProgress event

See also Example

Applies to

TZipMaster component

OnProgress event occurs during compression and decompression of a Zip archive and while reading, writing or processing.

type TZMProgressEvent = procedure(Sender: TObject; details: TZMProgressDetails ) of object;

Declaration

property OnProgress: TZMProgressEvent ;

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.

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.)


OnProgress event - See also

See also

<<< See also of OnProgress event >>>


OnProgress event - Example


OnSetAddName event

See also Example

Applies to

TZipMaster component

OnSetAddName event occurs when adding files to an archive and gives you a chance to change the path and/or file name.

Type TZMSetAddNameEvent = procedure(Sender: TObject; var FileName: TZMString ;

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

Declaration

property OnSetAddName: TZMSetAddNameEvent ;

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.

Leaving the FileName empty( empty string) and setting IsChanged set to true; the file will NOT be included in the archive, it will be skipped.

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 event - See also

See also

<<< See also of OnSetAddName event >>>


OnSetAddName event - Example


OnSetExtName event

See also

Applies to

TZipMaster component

OnSetAddName event occurs when adding files to an archive and gives you a chance to change the path and/or file name.

Type TZMSetExtNameEvent = procedure(Sender: TObject; var FileName: TZMString ;

const BaseDir: TZMString; var IsChanged: Boolean) of object;

Declaration

property OnSetExtName: TZMSetExtNameEvent ;

Description

OnSetExtName event occurs when extracting files from an archive and gives you a chance to change the path and or file name.

When you change 'FileName' you must also set IsChanged to True.

If a new path is used without specifying the Drive then ExtrBaseDir is used as the Root folder

If you set Filename = "\newpath\Filename.ext" this will be translated to ExtrBaseDir\newpath\Filename.ext

If you set Filename = "newpath\Filename.ext" this will also be translated to ExtrBaseDir\newpath\Filename.ext


OnSetExtName event - See also

See also

ExtrBaseDir

Extract


OnSetCompLevel event

See also

Applies to

TZipMaster component

Occurs before compressing each file giving you a chance to change its compression level.

type TZMSetCompLevel = procedure(Sender: TObject; const ForFile: TZMString ; var level: Integer; var IsChanged: Boolean) of object;

Declaration

property OnSetCompLevel: TZMSetCompLevel ;

Description

Occurs only when adding files to the archive, use this when you want to set a compression level other than the value in AddCompLevel property to the archive.

Sender: TObject - the ZipMaster component firing the event

const ForFile: TZMString - the name of the file that will be compressed

var level: Integer - the new compression level (0..9)

var IsChanged: Boolean - set True if level is changed


OnSetCompLevel event - See also

See also

AddCompLevel

Add


OnSkipped event

See also Example

Applies to

TZipMaster component

Occurs when an operation fails to find or open a file.

Type TZMSkippedEvent = procedure(Sender: TObject; const ForFile: TZMString ;

SkipType: TZMSkipTypes; var ExtError: Integer) of object;

Declaration

property OnSkipped: TZMSkippedEvent ;

Description

Fired when an operation fails to process an instruction or file.

On entry ExtError will be the >= 0 if NoSkipping for that type is false

If ExtError < 0 upon return from a handler the operation will abort.


OnSkipped event - See also

See also

NoSkipping

TZMSkipAborts

TZMSkipTypes


OnSkipped event - Example


OnStateChange property

See also Example

Applies to

TZipMaster component

type TZMStateChange = procedure(Sender: TObject; state: TZMStates ; var NoCursor: boolean); of object;

Declaration

property OnStateChange: TZMStateChange ;

Description

Allows handling changes in the component state eg. to block button clicks when busy.

state - indicates the new operational State

When NoCursor is set to true the current cursor will not be changed, if set to false the cursor will be reflecting the Active state.

If Active the Waitcursor is started, if not Active the Waitcursor is stopped.


OnStateChange property - See also

See also

Busy


OnStateChange property - Example


OnStatusDisk event

See also Example

Applies to

TZipMaster component

OnStatusDisk event occurs when spanning disks and trying to overwrite an existing file.

Type TZMStatusDiskEvent = Procedure( Sender: TObject; PreviousDisk: Integer; PreviousFile: String; Status: TZMZipDiskStatus ; var Action: TZMDiskAction ) of object;

Declaration

property OnStatusDisk: TZMStatusDiskEvent;

Description

PreviousDisk is when applicable the disknumber of the previous disk which could be overwritten.

PreviousFile contains the filename of the zip archive.

TZMDiskStatus 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 .

TZMZipDiskAction 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.

zdaYesToAll Continue spanning and do not ask again.


OnStatusDisk event - See also

See also

KeepFreeOnDisk1

MaxVolumeSize

MinFreeVolumeSize


OnStatusDisk event - Example


OnStream event

See also Example

Applies to

TZipMaster component

Occurs during Add or Extract operations involving streams.

type TZMStreamEvent = procedure(Sender: TObject; opr: TZMStreamOp ; snumber: integer;

var strm: TStream; var stat: TZMSStats ; var done: Boolean) of object;

Declaration

property OnStream: TZMStreamEvent ;

Description

It can be used to Create/Open, Destroy/Close or Identify a stream.

If done is set it will override the default handling of stream operations.


OnStream event - See also

See also

TZMPipe

TZMPipeList


OnStream event - Example


OnTick event

Applies to

TZipMaster component

activity indicator

Type TZMTickEvent = Procedure(Sender: TObject) Of Object;

Declaration

property OnTick: TZMTickEvent ;

Description

Use to indicate that something is happening.


OnLoadStr event

See also Example

Applies to

TZipMaster component

Allows using message strings from a resource dll or other external source

Type TZMLoadStrEvent = procedure(Ident: Integer; var DefStr: String) of object;

Declaration

var

OnLoadStr: TZMLoadStrEvent ;

Description

OnLoadStr event occurs when any TZipMaster component needs to load a message or error string from its resource file.

This gives you the chance to replace this with a string from another external resources such as an language dll.

Ident is the identifier of the message or error string required , the result will be returned in the Str parameter

OnLoadStr is a global event which will handle events from all TZipMaster components.

The message identifiers are declared in ZMMsg19.pas.


OnLoadStr event - See also

See also

ZipLoadStr

Language

LanguageInfo


OnLoadStr event - Example

procedure TForm1.ZipMastererZipStr(ID: Integer; var Str: String);

const

LibName: String = 'C:\LangDlls\StrangeLangDll.dll';

var

hDll: HINSTANCE;

buff: array [0..255] of char;

s: String;

begin

HINSTANCE hDll := LoadLibrary(LibName);

if hDll <> 0 then

begin

if LoadString(hDll, ID, buff, 255) > 0 then

Str = String(buff);

FreeLibrary(hDll);

end;

end;

...

ZipMaster1.OnLoadStr := ZipMasterZipStr;

...


OnZipDialog event

See also Example

Applies to

TZipMaster component

called before displaying message dialogs to allow custom handling of messages

Type

TZMDialogEvent = procedure(Sender: TObject; const title: String;

var msg: String; var Result: Integer; btns: TMsgDlgButtons) of object;

Declaration

property OnZipDialog: TZMDialogEvent;

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= Dialog 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 ZMCtx.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


OnZipDialog event - See also

See also

<<< See also of OnZipDialog event >>>


OnZipDialog event - Example

This handler expects a class TPasswordDlg, capable of displaying the message, the required buttons and having a TEdit to enter the required passwords

procedure TMainForm.ZipBuilderZipDialog(Sender: TObject;

const Title: String; var msg: String;

var Context: Integer; Btns: TMsgDlgButtons);

var

ctx: Integer;

begin

ctx := Context and $FFFF;

String MyTitle := Title;

if (ctx = DHC_AddPwrd1) or (ctx = DHC_AddPwrd2) then

// values declared in ZMCtx.pas

MyTitle := 'My Password dialog';

TPasswordDlg Pdlg := TPasswordDlg.create(this, 0, Btns);

try

msg := Pdlg.ShowModalPwdDlg(MyTitle, msg);

Context := Pdlg.ModalResult;

finally

Pdlg.Free;

end;

end;


PZMRenameRec type

See also

Unit

ZipMstr19

Declaration

type PZMRenameRec = ^TZMRenameRec;

Description

structure used to 'identify' streams


PZMRenameRec type - See also

See also

<<< See also of PZMRenameRec type >>>


PZMSStats type

Unit

ZipMstr19

Declaration

type PZMSStats = ^ TZMSStats ;

Description

Pointer to structure used to identify streams.


TSFXOpt type

See also

Unit

ZipMstr19

Declaration

type TSFXOpt = (soAskCmdLine, soAskFiles, soHideOverWriteBox, soAutoRun, soNoSuccessMsg, soExpandVariables, soInitiallyHideFiles, soForceHideFiles, soCheckAutoRunFileName, soCanBeCancelled, soCreateEmptyDirs, soSuccessAlways);

Description

set of TSFXOption

soAskCmdLine, // allow user to prevent execution of the command line

soAskFiles, // allow user to prevent certain files from extraction

soHideOverWriteBox, // do not allow user to choose the overwrite mode

soAutoRun, // start extraction + evtl. command line automatically

// only if sfx filename starts with "!" or is "setup.exe"

soNoSuccessMsg, // don't show success message after extraction

soExpandVariables, // expand environment variables in path/cmd line...

soInitiallyHideFiles, // don't show file listview on startup

soForceHideFiles, // do not allow user to show files list

// (no effect if soInitiallyShowFiles is set)

soCheckAutoRunFileName, // can only autorun if !... or setup.exe

soCanBeCancelled, // extraction can be cancelled

soCreateEmptyDirs, // recreate empty directories

soSuccessAlways // always give success message even if soAutoRun or soNoSuccessMsg


TSFXOpt type - See also

See also

SFXOptions

TSFXOpts


TSFXOpts type

See also

Unit

ZipMstr19

Declaration

type TSFXOpts = set of TSFXOpt ;

Description

Set of options for building SFX files


TSFXOpts type - See also

See also

SFXOptions

TSFXOpt


TZMChangeFunction type

See also Example

Unit

TZipMstr20

Declaration

type TZMChangeFunction = function(rec: TZMDirRec ; var Data): Integer;

Description

This is the definition of the function applied to each selected entry during ChangeFileDetails to make the changes.

This function should return 0 on success otherwise an error value.


TZMChangeFunction type - See also

See also

ChangeFileDetails

Rename


TZMForEachFunction type

See also Example

Unit

ZipMstr19

Declaration

type TZMForEachFunction = function(rec: TZMDirEntry ; var Data): Integer;

Description

A user defined function to operate (read-only) on each directory entry.

rec: the directory entry (read-only)

Data: user defined data passed to the ForEach function.

Return <> 0 on any error.

Set Cancel to abort.


TZMForEachFunction type - See also

See also

ForEach


TZMRenameRec type

See also

Unit

ZipMstr19

Declaration

type TZMRenameRec = record

   Source: String;

   Dest: String;

   Comment: String;

   DateTime: Integer;

  end;

Description

Record used in the Rename method to specify what needs to be changed.

   Source: The name of the existing entry

   Dest: The replacement name

   Comment: A new comment for this entry (can be empty if changing name or date)

   DateTime: a new DOS Date stamp for this entry (can be empty if changing name or comment)


TZMRenameRec type - See also

See also

Rename

ChangeFileDetails


TZMAddOpts type

See also

Unit

ZipMstr19

Declaration

type TZMAddOpts = set of TZMAddOptsEnum ;

Description

Options used when building a zip file, in property AddOptions


TZMAddOpts type - See also

See also

AddOptions

WriteOptions

SpanOptions


TZMAddOptsEnum type

See also

Unit

ZipMstr19

Declaration

type TZMAddOptsEnum = (AddDirNames, AddRecurseDirs, AddMove, AddFreshen, AddUpdate, AddHiddenFiles, AddArchiveOnly, AddResetArchive, AddEncrypt, AddSeparateDirs, AddVolume, AddFromDate, AddSafe, AddVersion, AddNTFS);

Description

Options when building a zip file


TZMAddOptsEnum type - See also

See also

TZMAddOpts

AddOptions

WriteOptions

SpanOptions


TZMAddStoreExts type

See also

Unit

ZipMstr19

Declaration

type TZMAddStoreExts = set of TZMAddStoreSuffixEnum ;

Description

A set of predefined suffixes of file types to be stored instead of compressed.

Compression of these types is slow and ineffective, in extreme cases may even make the file larger.


TZMAddStoreExts type - See also

See also

AddStoreSuffixes

ExtAddStoreSuffixes

Filespec switches

OnSetCompLevel

AddCompLevel


TZMAddStoreSuffixEnum type

See also

Unit

ZipMstr19

Declaration

type TZMAddStoreSuffixEnum = (assGIF, assPNG, assZ, assZIP, assZOO, assARC, assLZH, assARJ, assTAZ, assTGZ, assLHA, assRAR, assACE, assCAB, assGZ, assGZIP, assJAR, assEXE, assEXT, assJPG, assJPEG, ass7Zp, assMP3, assWMV, assWMA, assDVR, assAVI);

Description

Set enumerations of extensions to only be stored instead of attempting to be compressed.


TZMAddStoreSuffixEnum type - See also

See also

AddStoreSuffixes

ExtAddStoreSuffixes

Filespec switches

OnSetCompLevel

AddCompLevel


TZMCheckTerminateEvent type

See also

Unit

ZipMstr19

Declaration

type TZMCheckTerminateEvent = procedure(Sender: TObject; var abort: Boolean); of object;

Description

Used to check for terminating threads.


TZMCheckTerminateEvent type - See also

See also

<<< See also of TZMCheckTerminateEvent type >>>


TZMCopyZippedOverwriteEvent type

See also

Unit

ZipMstr19

The OnCopyZipOverwrite event occurs when the function CopyZippedFiles needs to know if a file may be overwritten.

Declaration

type TZMCopyZippedOverwriteEvent = procedure(Sender: TObject; src, dst: TZMDirEntry ; var DoOverwrite: Boolean); of object;

Description

Occurs when during the execution of the functions AddZippedFiles and 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 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.


TZMCopyZippedOverwriteEvent type - See also

See also

AddZippedFiles

CopyZippedFiles


TZMCRC32ErrorEvent type

See also

Unit

ZipMstr19

OnCRC32Error event occurs when a CRC error is found while extracting.

Declaration

type TZMCRC32ErrorEvent = procedure(Sender: TObject; const ForFile: TZMString ; FoundCRC, ExpectedCRC: Longword; var DoExtract: Boolean); of object;

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.


TZMCRC32ErrorEvent type - See also

See also

<<< See also of TZMCRC32ErrorEvent type >>>


TZMDeleteOpts type

See also

Unit

ZipMstr19

Declaration

type TZMDeleteOpts = (htdFinal, htdAllowUndo);

Description

Options for deleting a file, used in the HowToDelete property

   htdFinal      - deletes the file

   htdAllowUndo  - moves file to recycle bin


TZMDeleteOpts type - See also

See also

HowToDelete


TZMDeflates type

See also

Unit

ZipMstr19

Declaration

type TZMDeflates = (zmStore, zmStoreEncrypt, zmDeflate, zmDeflateEncrypt);

Description

Options for deflating/undeflating a stream.

   zmStore          - stores the file

   zmStoreEncrypt   - stores the file encrypted (not recomended)

   zmDeflate        - deflate the file

   zmDeflateEncrypt - deflate and encrypt the file.

Used by Deflate and Undeflate


TZMDeflates - See also

Deflate

Undeflate


TZMDialogEvent type

See also

Unit

ZipMstr19

called before displaying message dialogs to allow custom handling of messages

Declaration

type TZMDialogEvent = 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.


Dialog Context

Defined in ZMCtx19.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


TZMDialogEvent type - See also

See also

<<< See also of TZMDialogEvent type >>>


TZMDiskAction type

See also

Unit

ZipMstr19

Declaration

type TZMDiskAction = (zdaYesToAll, zdaOk, zdaErase, zdaReject, zdaCancel);

Description

Action values for TZMStatusDiskEvent

Value Meaning

zdaYesToAll Continue spanning and do not ask again

zdaOk Continue diskspanning (the default).

zdaErase Erase the disk first.

zdaReject Try again.

zdaCancel Cancel the disk spanning operation.


TZMDiskAction type - See also

See also

TZMStatusDisk

OnStatusDisk


TZMEncodingOpts type

See also

Unit

ZipMstr19

Declaration

type TZMEncodingOpts = (zeoAuto, zeoNone, zeoOEM, zeoUTF8, zeoUPath);

Description

the EncodeAs values (writing) -

zeoUPATH - convert to Ansi but have UTF8 proper name in data

zeoUTF - convert to UTF8

zeoOEM - convert to OEM

zeoNone - store 'as is' (Ansi on Windows)

'default' (zeoAuto) - [in order of preference]

  • is Ansi - use zeoNone
  • can be converted to Ansi - use zeoUPath (unless comment also extended)
  • use zeoUTF8

Encoded (reading)

zeoUPATH- use UPATH if available

zeoUTF - assume name is UTF8 - convert to Ansi/Unicode

zeoOEM - assume name is OEM - convert to Ansi/Unicode

zeoNone - assume name is Ansi - convert to Ansi/Unicode

zeoAuto - unless flags/versions say otherwise, or it has UTF8 name in data, treat it as OEM (FAT) / Ansi (NTFS)

This is also the type returned by the TZMDirEntry . Encoded property for that particular entry.


TZMEncodingOpts type - See also

See also

EncodeAs

Encoding

TZMDirEntry.Encoded


TZMExtractOverwriteEvent type

See also

Unit

ZipMstr19

Declaration

type TZMExtractOverwriteEvent = procedure(Sender: TObject; const ForFile: TZMString ; IsOlder: Boolean; var DoOverwrite: Boolean; DirIndex: Integer); of object;

Description

Occurs when extracting would overwrite an existing file - allows asking what to do.

Sender: TObject           - reference to the ZipMaster component firing the event

  const ForFile: TZMString; - the name of the file

  IsOlder: Boolean;         - True if it would replace an older file

  var DoOverwrite: Boolean; - set True to overwrite the existing file

  DirIndex: Integer         - the entry sequence number


TZMExtractOverwriteEvent type - See also

See also

OnExtractOverwrite

Extract


TZMExtrOpts type

See also

Unit

ZipMstr19

Declaration

type TZMExtrOpts = set of TZMExtrOptsEnum ;

Description

options for when extracting from a zip file.

ExtrDirNames,   True = extract directory names

  ExtrOverWrite,  True = always overwrite existing files

  ExtrFreshen,    True = overwrite existing older files

  ExtrUpdate,     True = extract new files and overwrite older existing files

  ExtrTest,       True = do not extract only test zip file

  ExtrForceDirs,  True = force ExtrBaseDir to exist (if it can)

  ExtrNTFS,       True = where known restore the saved time stamps


TZMExtrOpts type - See also

See also

Extract

ExtrOptions

Encoded

TZMEncodingOpts


TZMExtrOptsEnum type

See also

Unit

ZipMstr19

Declaration

type TZMExtrOptsEnum = (ExtrDirNames, ExtrOverWrite, ExtrFreshen, ExtrUpdate, ExtrTest, ExtrForceDirs, ExtrNTFS);

Description

ExtrDirNames,   True = extract directory names

  ExtrOverWrite,  True = always overwrite existing files

  ExtrFreshen,    True = overwrite existing older files

  ExtrUpdate,     True = extract new files and overwrite older existing files

  ExtrTest,       True = do not extract only test zip file

  ExtrForceDirs,  True = force ExtrBaseDir to exist (if it can)

  ExtrNTFS,       True = where known restore the saved time stamps


TZMExtrOptsEnum type - See also

See also

Extract

TZMExtrOpts

ExtrOptions


TZMFileCommentEvent type

See also

Unit

ZipMstr19

Declaration

type TZMFileCommentEvent = procedure(Sender: TObject; const ForFile: TZMString ; var FileComment: TZMString; var IsChanged: Boolean); of object;

Description

Occurs when building a zip file to allow setting a comment for each file

Sender: TObject;           - ZipMaster component firing the event

  const ForFile: TZMString;  - the name of the file

  var FileComment: TZMString;- the comment to change or replace

  var IsChanged: Boolean     - set True to indicate that it was changed


TZMFileCommentEvent type - See also

See also

Add

OnFileComment

OnFileExtra

TZMFileExtraEvent


TZMFileExtraEvent type

See also

Unit

ZipMstr19

Declaration

type TZMFileExtraEvent = procedure(Sender: TObject; const ForFile: TZMString ; var Data: RawByteString; var IsChanged: Boolean); of object;

Description

Occurs when building a zip file to allow setting a extra for each file

Sender: TObject; - ZipMaster component firing the event

const ForFile: TZMString; - the name of the file

var Data: RawByteString; - the formatted data to set or replace

var IsChanged: Boolean - set True to indicate that it was changed


TZMFileExtraEvent type - See also

See also

Add

OnFileExtra

OnFileComment

TZMFileFileCommentEvent


TZMGetNextDiskEvent type

See also

Unit

ZipMstr19

Declaration

type TZMGetNextDiskEvent = procedure(Sender: TObject; DiskSeqNo, DiskTotal: Integer; Drive: String; var AbortAction: Boolean); of object;

Description

Occurs when a different disk is required when working with multi-disk zip files

Sender: TObject;         - the ZipMaster component firing the event

  DiskSeqNo,               - the number of the required disk

  DiskTotal: Integer;      - the total number of disks (if known)

  Drive: String;           - the disk drive

  var AbortAction: Boolean - set True to abort


TZMGetNextDiskEvent type - See also

See also

<<< See also of TZMGetNextDiskEvent type >>>


TZMMergeOpts type

See also

Unit

ZipMstr19

Declaration

type TZMMergeOpts = (zmoConfirm, zmoAlways, zmoNewer, zmoOlder, zmoNever);

Description

Controls merging files with AddZippedFiles and CopyZippedFiles

  zmoConfirm,  - Ask via OnCopyZippedOverwrite event on each conflict

  zmoAlways,   - always replace the existing file

  zmoNewer,    - replace the existing if the new file is newer

  zmoOlder,    - replace the existing if the new file is older

  zmoNever,    - never replace the existing file


TZMMergeOpts type - See also

See also

AddZippedFiles

CopyZippedFiles

OnCopyZippedOverwrite


TZMMessageEvent type

See also

Unit

ZipMstr19

Declaration

type TZMMessageEvent = procedure(Sender: TObject; ErrCode: Integer; const ErrMsg: TZMString ); of object;

Description

Occurs for errors or diagnostic messages

  Sender: TObject;        - the ZipMaster component firing the event

  ErrCode: Integer;       - the error identifier number (or -1)

  const ErrMsg: TZMString - the message


TZMMessageEvent type - See also

See also

OnMessage

Verbose

Trace


TZMNewNameEvent type

See also

Unit

ZipMstr19

Declaration

type TZMNewNameEvent = procedure(Sender: TObject; SeqNo: Integer); of object;

Description

Occurs after reading the central directory to indicate that another entry is available and gives you the opportunity to fill in for example a TListView.

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.


TZMNewNameEvent type - See also

See also

OnNewName

List

OnDirUpdate


TZMOvrOpts type

See also

Unit

ZipMstr19

Declaration

type TZMOvrOpts = (ovrAlways, ovrNever, ovrConfirm);

Description

Controls overwriting existing files when SFX extracts files.

Set by SFXOverWriteMode .

Value Meaning

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

OvrAlways Always overwrite existing files.

OvrNever Never overwrite - skip those files.


TZMOvrOpts type - See also

See also

SFXOverWriteMode

Working with SFX


TZMPasswordErrorEvent type

See also

Unit

ZipMstr19

Declaration

type TZMPasswordErrorEvent = procedure(Sender: TObject; IsZipAction: Boolean; var NewPassword: String; const ForFile: TZMString ; var RepeatCount: Longword; var Action: TMsgDlgBtn); of object;

Description

Occurs for when a password is incorrect or required

Sender: TObject; - the ZipMaster component firing the event

IsZipAction: Boolean - True if compress

var NewPassword: String - the new password

const ForFile: TZMString - the name of the file

var RepeatCount: Longword - number of retries remaining, 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.

var Action: TMsgDlgBtn - is the action to take when returning from this event, possible actions are: mbOk, mbCancel, mbCancelAll or mbAbort. Default is mbOk.

NOTE: This event will be called at most 15 times per file even when you try to increase RepeatCount multiple times.


TZMPasswordErrorEvent type - See also

See also

OnPasswordError

GetExtrPassword

GetAddPassword

Password Notes

PasswordReqCount


TZMProgressDetailsEvent type

TZMProgressEvent type

See also

Unit

ZipMstr19

Declaration

type TZMProgressEvent = procedure(Sender: TObject; details: TZMProgressDetails ) of object;

Description

Occurs during operations to allow updating of "status" or "Progress" bars.

  Sender: TObject;          - the ZipMaster component firing the event

details: TZMProgressDetails


TZMProgressEvent type - See also

See also

TZMProgressType

TZMProgressDetails

OnProgress


TZMPipe class

See also Properties

Unit

ZipMstr19

Description

A class to enable connecting streams so that they can be added to, or extracted from, a zip file - this can be done while processing other files.


TZMPipe class - See also

See also

TZipMaster properties

Add

Extract

TZMPipeList

Using streams


TZMPipe class - Properties

Attributes

DOSDate

FileName

OwnsStream

Size

Stream


TZMPipe class - Using


Attributes property

See also Example

Applies to

TZMPipe component

Declaration

property Attributes: Cardinal;

Description

Standard DOS file attributes.

Only used when writing a stream to the zip.


DOSDate property

See also Example

Applies to

TZMPipe component

Declaration

property DOSDate: Cardinal;

Description

Standard DOS file stamp.

Only used when writing a stream to the zip.


FileName property

See also Example

Applies to

TZMPipe component

Declaration

property FileName: String;

Description

File name as it is or will be in the zip file.

Note - No drive or wild cards are allowed.


OwnsStream property

See also Example

Applies to

TZMPipe component

Declaration

property OwnsStream: boolean;

Description

If True the list will destroy the stream when the operation is complete or on failure.


Size property

See also Example

Applies to

TZMPipe component

Declaration

property Size: Integer;

Description

The size of the stream.

This will be set automatically when a stream is assigned

Only used when writing a stream to the zip.


Stream property

See also Example

Applies to

TZMPipe component

Declaration

property Stream: TStream;

Description

The stream to be added to or, extracted from, the zip file.

Note - Must be created and positioned to the beginning.


TZMPipeList class

See also Methods

Unit

ZipMstr19

Description

A list class for holding TZMPipe .


TZMPipeList class - See also

See also

TZipMaster properties

Add

Extract

TZMPipe


TZMPipeList class - Methods

Add

Clear


Add method

See also Example

Applies to

TZMPipeList component

Declaration

function Add(aStream: TStream; const FileName: string; Own: boolean): integer;

Description

Adds a stream to the list.

Returns the index in the list.


Clear method

See also Example

Applies to

TZMPipeList component

Declaration

procedure Clear;

Description

Clears all entries destroying all streams that it owns .


ZMUTF819 unit

TZipMaster

UTF8 conversion and test functions used by TZipMaster that can also be used by users.

Routines

AnsiIsSafe

AsUTF8Str

IsUTF8Trail

PUTF8ToSafe

PUTF8ToStr

PUTF8ToWideStr

PWideToUTF8

StrToUTF8

StrToUTFEx

StrToWideEx

UTF8IsSafe

UTF8SeqLen

UTF8ToSafe

UTF8ToStr

UTF8ToWide

ValidUTF8

ValidUTF8

ValidUTF8

WideIsSafe

WideToSafe

WideToUTF8


TZMProgressType type

See also

Unit

ZipMstr19

Declaration

type TZMProgressType = (NewFile, ProgressUpdate, EndOfBatch, TotalFiles2Process, TotalSize2Process, NewExtra, ExtraUpdate);

Description

Intended for "status bar" or "progress bar" updates. Criteria for this event:

ProgressType is defined as one of the types below:

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.

EndOfBatch - Completed processing on a (batch of) file(s).

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.

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.


TZMProgressType type - See also

See also

OnProgress

TZMProgressDetails

TZMProgressDetailsEvent


TZMRenameOpts type

See also

Unit

ZipMstr19

Declaration

type TZMRenameOpts = (htrDefault, htrOnce, htrFull);

Description

Used by Rename to control finding files to rename.

htrDefault  - renames each exact matching name

  htrOnce     - rename the first matching name

  htrFull     - rename the first name matching wildcard search


TZMRenameOpts type - See also

See also

Rename


TZMReplaceOpts type

See also

Unit

ZipMstr19

Declaration

type TZMReplaceOpts = (rplConfirm, rplAlways, rplNewer, rplNever);

Description

Used by AddZippedFiles and CopyZippedFiles to resolve merging files of the same name.

rplConfirm  - fire OnCopyZippedOverwrite for user which file to keep

  rplAlways   - always overwrite the existing file

  rplNewer    - compare file stamps and use the newer file

  rplNever    - keep the existing file


TZMReplaceOpts type - See also

See also

AddZippedFiles

CopyZippedFiles

OnCopyZippedOverwrite


TZMSetAddNameEvent type

See also

Unit

ZipMstr19

Declaration

type TZMSetAddNameEvent = procedure(Sender: TObject; var FileName: TZMString ; const ExtName: TZMString; var IsChanged: Boolean) of object;

Description

Occurs only when adding files to the archive.

  Sender: TObject          - the ZipMaster component firing the event

var FileName: TZMString  - the new name

  const ExtName: TZMString - the external path/name

  var IsChanged: Boolean   - set True if the name was changed


TZMSetAddNameEvent type - See also

See also

OnSetAddName


TZMSetCompLevel type

See also

Unit

ZipMstr19

Declaration

type TZMSetCompLevel = procedure(Sender: TObject; const ForFile: TZMString ; var level: Integer; var IsChanged: Boolean) of object;

Description

Occurs only when adding files to the archive.

  Sender: TObject          - the ZipMaster component firing the event

const ForFile: TZMString - the name of the file

  var level: Integer       - the new compression level (0..9)

  var IsChanged: Boolean   - set True if level is changed


TZMSetCompLevel type - See also

See also

OnSetCompLevel

AddCompLevel

Filespec_Switches


TZMSetExtNameEvent type

See also

Unit

ZipMstr19

Declaration

type TZMSetExtNameEvent = procedure(Sender: TObject; var FileName: TZMString ; const BaseDir: TZMString; var IsChanged: Boolean); of object;

Description

Occurs only when extracting files to the archive to allow changing the filename.

  Sender: TObject          - the ZipMaster component firing the event

var FileName: TZMString  - the new name

  const BaseDir: TZMString - the destination path

  var IsChanged: Boolean   - set True if the name was changed


TZMSetExtNameEvent type - See also

See also

OnSetExtName


TZMSkippedEvent type

See also

Unit

ZipMstr19

Declaration

type TZMSkippedEvent = procedure(Sender: TObject; const ForFile: TZMString ; SkipType: TZMSkipTypes; var ExtError: Integer) of object;

Description

Fired when an operation fails to process an instruction or file.

  Sender: TObject          - the ZipMaster component firing the event

const ForFile: TZMString - the new name

  SkipType: TZMSkipTypes -

  var ExtError: Integer    - on entry ExtError will be the >= 0 if NoSkipping for that SkipType is false

If ExtError < 0 upon return from a handler the operation will abort.


TZMSkippedEvent type - See also

See also

OnSkipped


TZMSkipTypes type

See also

Unit

ZipMstr19

Declaration

type TZMSkipTypes = (stOnFreshen, stNoOverwrite, stFileExists, stBadPassword, stBadName, stCompressionUnknown, stUnknownZipHost, stZipFileFormatWrong, stGeneralExtractError, stUser, stCannotDo, stNotFound, stNoShare, stNoAccess, stNoOpen, stDupName);

Description

Identifies which skip type is not allowed in the NoSkipping property causing the OnSkipped event to be fired.

These are conditions that may under different circumstances be an error or may safely be ignored.

Value Default Condition

stOnFreshen false existing file is newer than the current file

stNoOverwrite  false did not overwrite existing

stFileExists  false file exists

stBadPassword  false cannot extract because of bad password

stBadName  false skipped file because its name is invalid

stCompressionUnknown  false skipped extract because we cannot handle its method

stUnknownZipHost  false unknown host, cannot handle it

stZipFileFormatWrong false bad file format

stGeneralExtractError  false something went wrong

stUser  false user command that the file is skipped

stCannotDo  false could not handle the operation

stNotFound  false file or filespec was not found

stNoShare  false file share problem

stNoAccess  false could not access file (already in use)

stNoOpen  false could not open the file

stDupName true zip operation caused duplicate internal name

      false will only keep the first file producing that name.


TZMSkipTypes type - See also

See also

NoSkipping

TZMSkipAborts

TZMSkippedEvents.

OnSkipped


TZMSkipAborts type

See also

Unit

ZipMstr19

Declaration

type TZMSkipAborts = set of TZMSkipTypes ;

Description

Type for the property NoSkipping which controls default action for skip events .


TZMSkipAborts Type - See also

See also

TZMSkipTypes

NoSkipping

TZMSkippedEvents.

OnSkipped


TZMSpanOpts type

See also

Unit

ZipMstr19

Declaration

type TZMSpanOpts = set of TZMSpanOptsEnum ;

Description

options for when handling a multipart zip file


TZMSpanOpts type - See also

See also

<<< See also of TZMSpanOpts type >>>


TZMSpanOptsEnum type

See also

Unit

ZipMstr19

Declaration

type TZMSpanOptsEnum = (spNoVolumeName, spCompatName, spWipeFiles, spTryFormat, spAnyTime, spExactName);

Description

Options when handling a multipart zip file.

Set in the SpanOptions property.

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

spAnyTime

  If True, does not insist that all parts have the same time stamp

spExactName

  If True, it attempts to open the specified file, otherwise it trys to locate the last part


TZMSpanOptsEnum type - See also

See also

SpanOptions

Handling of MultiVolume Zip parts


TZMStateChange type

See also

Unit

ZipMstr19

Declaration

type TZMStateChange = procedure(Sender: TObject; state: TZMStates ; var NoCursor: boolean); of object;

Description

Fired when the component state changes to allow updating status indicators or blocking other operations.


TZMStateChange type - See also

See also

OnStateChange


TZMStates type

See also

Unit

ZipMstr19

Declaration

type TZMStates = (zsDisabled, zsIdle, zsBusy);

Description

Possible states of the component used in the 'state' parameter in the OnStateChange event.

zsDisabled the component is not active

zsIdle the component is active and not busy

zsBusy the component is active and executing an operation


TZMStates type - See also

See also

<<< See also of TZMStates type >>>


TZMStatusDiskEvent type

See also

Unit

ZipMstr19

Declaration

type TZMStatusDiskEvent = procedure(Sender: TObject; PreviousDisk: Integer; PreviousFile: String; Status: TZMZipDiskStatus; var Action: TZMDiskAction); of object;

Description

Fired when spanning disks and trying to overwrite an existing file.

  Sender: TObject          - the ZipMaster component firing the event

PreviousDisk: Integer    - when applicable the disknumber of the previous disk which could be overwritten.

  PreviousFile: String     - contains the filename of the zip archive.

  Status: TZMZipDiskStatus

  var Action: TZMDiskAction


TZMStatusDiskEvent type - See also

See also

OnStatusDisk


TZMStreamEvent type

See also

Unit

ZipMstr19

Declaration

type TZMStreamEvent = procedure(Sender: TObject; opr: TZMStreamOp; snumber: integer; var strm: TStream; var stat: TZMSStats; var done: Boolean) of object;

Description

Fired during add or extract involving a stream

  Sender: TObject          - the ZipMaster component firing the event

  opr: TZMStreamOp      - the operation required

  snumber: integer         - the stream number (also index in Pipes )

  var strm: TStream        - the stream object

  var stat: TZMSStats        - the details required form some operations

  var done: Boolean        - Set True if operation was handled

Note: This is fired before the default Pipes are acted upon.


TZMStreamEvent type - See also

See also

OnStream

Pipes


TZMLoadStrEvent type

See also

Unit

TZipMstr20

Declaration

type TZMLoadStrEvent = procedure(Ident: Integer; var DefStr: String) of object;

Description

Fired when a string resource is required.

Note: This event is fired from all TZipMaster components - only the last handler set in OnLoadStr will receive it.


TZMLoadStrEvent type - See also

See also

ZipLoadStr

OnLoadStr

Language

LanguageInfo


TZMString type

Unit

ZipMstr19

Declaration

D2009 or later (Unicode)

type TZMString = UnicodeString;

D2007 or earlier

type TZMString = AnsiString;

Description

This string type is used for file entry names to enable handling of international names.

On Unicode versions (D2009 or later) this is a standard String.

On earlier versions its contents will be either AnsiString or, if UseUTF8 is True, UTF8.


TZMTickEvent type

See also

Unit

ZipMstr19

Declaration

type TZMTickEvent = procedure(Sender: TObject); of object;

Description

Fired during operations to allow indicating that something is happening.

  Sender: TObject          - the ZipMaster component firing the event


TZMTickEvent type - See also

See also

<<< See also of TZMTickEvent type >>>


TZMWideString type

See also

Unit

ZipMstr19

Declaration

D2009 or later (Unicode)

type TZMWideString = UnicodeString;

D2007 or earlier

type TZMWideString = WideString;

Description

A string of Wide characters (Unicode).

The actual type depends upon the compiler version.


TZMWideString type - See also

See also

TZMString


TZMWriteOpts type

See also

Unit

ZipMstr19

Declaration

type TZMWriteOpts = set of TZMWriteOptsEnum ;

Description

other options


TZMWriteOpts type - See also

See also

AddOptions

ExtrOptions

MaxVolumeSize


TZMWriteOptsEnum type

See also

Unit

ZipMstr19

Declaration

type TZMWriteOptsEnum = (zwoDiskSpan, zwoZipTime, zwoForceDest);

Description

Controls options when writing or rewriting a zip archive

   zwoDiskSpan    - split (span) multiple parts

   zwoZipTime     - set the archive time stamp to the latest entry

   zwoForceDest   - try to force the destination to exist


TZMWriteOptsEnum type - See also

See also

AddOptions

ExtrOptions

MaxVolumeSize


TZMZipDiskStatus type

See also

Unit

ZipMstr19

Declaration

type TZMZipDiskStatus = set of TZMZipDiskStatusEnum ;

Description

Disk staus values as reported in the OnStatusDisk event.


TZMZipDiskStatus type - See also

See also

OnStatusDisk


TZMZipDiskStatusEnum type

See also

Unit

ZipMstr19

Declaration

type TZMZipDiskStatusEnum = (zdsEmpty, zdsHasFiles, zdsPreviousDisk, zdsSameFileName, zdsNotEnoughSpace);

Description

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 .


TZMZipDiskStatusEnum type - See also

See also

TZMZipDiskStatusEvent


TZMSStats type

See also

Unit

ZipMstr19

Declaration

type TZMSStats = packed record Size: Int64; Date: Cardinal; Attrs: Cardinal; end;

Description

Used to identify stream properties for Add or Extract operations.

Size: Int64     - the size to be zipped

  Date: Cardinal  - the entry date

  Attrs: Cardinal - DOS attributes for the entry


TZMSStats type - See also

See also

OnStream


TZMStreamOp type

See also

Unit

ZipMstr19

Declaration

type TZMStreamOp = (zsoIdentify, zsoOpen, zsoClose);

Description

Stream operations used by OnStream

zsoIdentify - Identify the stream

zsoOpen - Open the stream

zsoClose - Close the stream


TZMStreamOp type - See also

See also

OnStream


ZMUtils19 unit

TZipMaster

Utility functions used by TZipMaster that can also be used by users.

Routines

AbsErr

CalcCRC32

CanHash

CheckSFXType

DelimitPath

DirExists

DiskAvailable

EraseFile

ExeSize

ExeVers

ExeVersion

ExtractNameOfFile

File_Size

FileDateToLocalDateTime

FileSeek64

ForceDirectory

GetVolumeLabel

HasWild

HasWildW

Hi64

IsFolder

IsSameFile

IsWild

IsWinXP

LastPos

LastPosW

Lo64

NameIsBad

OEMToStr

OpenResStream

PathConcat

QueryZip

SetSlash

SetSlashW

StrHasExt

StrToOEM

VersStr

WinVersion

File_Close

File_Delete

Constants

CheckSFXType values

cstNone = 0; // not found

cstExe = 1; // might be stub of unknown type

cstSFX17 = 17; // found 1.7 SFX headers

cstSFX19 = 19; // found 1.9 SFX headers

cstDetached = 2048; // is detached - if name specified ZipName will modified for it

QueryZip return bit values and errors

zqbStartEXE = 1; // is EXE file may be SFX

zqbStartLocal = 2; // normal zip file start

zqbStartSpan = 4; // first part of span

zqbStartCentral = 8; // continuing Central Header

zqbHasComment = 16;

zqbHasLocal = 32; // first Central entry points to local header

zqbHasCentral = 64; // Central entry where it should be

zqbHasEOC = 128; // End of Central entry

zqbHasLoc64 = 256; // EOC64 locator entry

zqbHasEOC64 = 512; // Zip64 EOC

zqbJunkAtEnd = 1024; // junk at end of zip

zqbIsDiskZero = 2048; // is disk 0

zqFieldError = -5; // bad field value

zqFileError = -7; // file handling error

zqGeneralError = -9; // unspecified failure


CalcCRC32 function

Unit

ZMUtils19

Declaration

function CalcCRC32(const mem; len: Integer; init: DWORD): DWORD;

Description

Calculates CRC32 of a block of memory.

mem - pointer to the memory block

len - length of the memory block

init - initial CRC value, usually 0 .


BytesWritten property

See also

Applies to

TZMProgressDetails class

Declaration

property BytesWritten: Int64;

Description

Number of bytes written.

Run-time only

Read-only


BytesWritten property - See also

See also

OnProgress


Delta property

See also

Applies to

TZMProgressDetails class

Declaration

property Delta: Int64;

Description

Number of bytes processed since last event.

Run-time only

Read-only


Delta property - See also

See also

OnProgress


ItemName property

See also

Applies to

TZMProgressDetails class

Declaration

property ItemName: TZMString ;

Description

Name of the current item being processed

Run-time only

Read-only


ItemName property - See also

See also

OnProgress


ItemNumber property

See also

Applies to

TZMProgressDetails class

Declaration

property ItemNumber: Integer;

Description

DirEntry index of current item.

Run-time only

Read-only


ItemNumber property - See also

See also

OnProgress


ItemPerCent property

See also

Applies to

TZMProgressDetails class

Declaration

property ItemPerCent: Integer;

Description

Percentage of item processed

Run-time only

Read-only


ItemPerCent property - See also

See also

OnProgress


ItemPosition property

See also

Applies to

TZMProgressDetails class

Declaration

property ItemPosition: Int64;

Description

Position in current item.

Run-time only

Read-only


ItemSize property

See also

Applies to

TZMProgressDetails class

Declaration

property ItemSize: Int64;

Description

Size of the current item being processed

Run-time only

Read-only


ItemSize property - See also

See also

OnProgress


Order property

See also

Applies to

TZMProgressDetails class

Declaration

property Order: TZMProgressType ;

Description

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

Run-time only

Read-only


Order property - See also

See also

OnProgress


TotalCount property

See also

Applies to

TZMProgressDetails class

Declaration

property TotalCount: Int64;

Description

Total number of items to be processed.

Run-time only

Read-only


TotalCount property - See also

See also

OnProgress


TotalPerCent property

See also

Applies to

TZMProgressDetails class

Declaration

property TotalPerCent: Integer;

Description

Percentage of items processed

Run-time only

Read-only


TotalPerCent property - See also

See also

OnProgress


TotalPosition property

See also

Applies to

TZMProgressDetails class

Declaration

property TotalPosition: Int64;

Description

position of current item.

Run-time only

Read-only


TotalPosition property - See also

See also

OnProgress


TotalSize property

See also

Applies to

TZMProgressDetails class

Declaration

property TotalSize: Int64;

Description

Total size of all items

Run-time only

Read-only


TotalSize property - See also

See also

OnProgress


TZMDirEntry class

See also Properties

Unit

ZipMstr19

Description

A read-only abstract class representing the zip central directory entry


TZMDirEntry class - See also

See also

DirEntry

TZMDirRec


TZMDirEntry - Properties

Properties

Read-Only

CompressedSize

CompressionMethod

CRC32

DateStamp

DateTime

Encoded

Encrypted

ExtFileAttrib

ExtraData

ExtraField

ExtraFieldLength

FileComment

FileCommentLen

FileName

FileNameLength

Flag

HeaderName

IntFileAttrib

IsDirOnly

RelOffLocalHdr

StartOnDisk

StatusBits

UncompressedSize

VersionMadeBy

VersionNeeded


CompressedSize property

See also

Applies to

TZMDirEntry class

Declaration

property CompressedSize: Int64;

Description

The compressed size of the compressed file

Run-time only

Read-only


CompressedSize property - See also

See also

<<< See also of CompressedSize property >>>


CompressionMethod property

See also

Applies to

TZMDirEntry class

Declaration

property CompressionMethod: Word;

Description

Method used to compress the file

Run-time only

Read-only

Valid Values

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 Data Compression Library Imploding

11 - Reserved by PKWARE

12 - File is compressed using BZIP2 algorithm

PKWARE is the registered trademark.


CompressionMethod property - See also

See also

AddCompLevel


CRC32 property

See also

Applies to

TZMDirEntry class

Declaration

property CRC32: Cardinal;

Description

CyclicRedundancyCode of the original file - used for error checking

Run-time only

Read-only


CRC32 property - See also

See also

<<< See also of CRC32 property >>>


DateStamp property

See also

Applies to

TZMDirEntry class

Declaration

property DateStamp: TDateTime;

Description

Last modified time stamp of the file adjusted to local time and converted to TDateTime.

Run-time only

Read-only


DateStamp property - See also

See also

DateTime


DateTime property

See also

Applies to

TZMDirEntry class

Declaration

property DateTime: Cardinal;

Description

The last modified time stamp of the file - unadjusted in DOS format

Run-time only

Read-only


DateTime property - See also

See also

DateStamp


Encoded property

See also

Applies to

TZMDirEntry class

Declaration

property Encoded: TZMEncodingOpts ;

Description

Returns how the file name and comment were encoded.

zeoUPATH- filename and/or comment stored as UTF8 in extra data using Info-Zip UPath or UComment tags - the strings in the header are OEM

zeoUTF - filename and/or comment stored as UTF8

zeoOEM - filename and/or comment stored are assumed to be OEM

zeoNone - filename and/or comment stored are assumed to be Ansi in Encoding_CP code page (defaults Windows current Ansi)

Run-time only

Read-only


Encoded property - See also

See also


Encrypted property

See also

Applies to

TZMDirEntry class

Declaration

property Encrypted: Boolean;

Description

True if file was encoded.

:= (Flag and 1) <> 0;

Run-time only

Read-only


Encrypted property - See also

See also

AddEncrypt

Password


ExtFileAttrib property

See also

Applies to

TZMDirEntry class

Declaration

property ExtFileAttrib: Longword;

Description

The file attributes - only lower 7 bits are mapped to Windows attributes

Run-time only

Read-only


ExtFileAttrib property - See also

See also

<<< See also of ExtFileAttrib property >>>


ExtraData property

See also

Applies to

TZMDirEntry class

Declaration

property ExtraData[Tag: Word]: RawByteString;

Description

Returns the first extra data having the supplied tag.

Run-time only

Read-only


ExtraData property - See also

See also

<<< See also of ExtraData property >>>


ExtraField property

See also

Applies to

TZMDirEntry class

Declaration

property ExtraField: RawByteString;

Description

Returns a copy of the file extra data.

Run-time only

Read-only


ExtraField property - See also

See also

<<< See also of ExtraField property >>>


ExtraFieldLength property

See also

Applies to

TZMDirEntry class

Declaration

property ExtraFieldLength: Word;

Description

The length of the extra data field (in bytes).

Run-time only

Read-only


ExtraFieldLength property - See also

See also

<<< See also of ExtraFieldLength property >>>


FileComment property

See also

Applies to

TZMDirEntry class

Declaration

property FileComment: TZMString ;

Description

Returns a copy of the file comment.

Run-time only

Read-only


FileComment property - See also

See also

<<< See also of FileComment property >>>


FileCommentLen property

See also

Applies to

TZMDirEntry class

Declaration

property FileCommentLen: Word;

Description

The internal length of the file comment field (in bytes).

Note: Because of string translation Length(FileComment) is likely to be different.

Run-time only

Read-only


FileCommentLen property - See also

See also

<<< See also of FileCommentLen property >>>


FileName property

See also

Applies to

TZMDirEntry class

Declaration

property FileName: TZMString ;

Description

The file name converted to external format and encoding.

Run-time only

Read-only


FileName property - See also

See also

Encoded


FileNameLength property

See also

Applies to

TZMDirEntry class

Declaration

property FileNameLength: Word;

Description

The length of the internal file name field (in bytes).

Note: Because of string translation Length(FileName) is likely to be different.

Run-time only

Read-only


FileNameLength property - See also

See also

<<< See also of FileNameLength property >>>


Flag property

See also

Applies to

TZMDirEntry class

Declaration

property Flag: Word;

Description

Various bit flags settings indicating aspects of how the file was compressed.

Bit 0 Set if file is encrypted.

Run-time only

Read-only


Flag property - See also

See also

<<< See also of Flag property >>>


HeaderName property

See also

Applies to

TZMDirEntry class

Declaration

property HeaderName: RawByteString;

Description

The internal name as stored in the local header.

Run-time only

Read-only


HeaderName property - See also

See also

FileName


IntFileAttrib property

See also

Applies to

TZMDirEntry class

Declaration

property IntFileAttrib: Word;

Description

Internal file attributes.

Run-time only

Read-only


IntFileAttrib property - See also

See also

<<< See also of IntFileAttrib property >>>


IsDirOnly property

See also

Applies to

TZMDirEntry class

Declaration

property IsDirOnly: Boolean;

Description

Returns True if the entry is a path - paths end with a '/'.

Run-time only

Read-only


IsDirOnly - See also

See also

FileName

HeaderName

UseDirOnlyEntries


RelOffLocalHdr property

See also

Applies to

TZMDirEntry class

Declaration

property RelOffLocalHdr: Int64;

Description

Offset of the local zip header on the StartOnDisk part of the zip file.

Run-time only

Read-only


RelOffLocalHdr property - See also

See also

<<< See also of RelOffLocalHdr property >>>


StatusBits property

See also

Applies to

TZMDirEntry class

Declaration

property StatusBits: Cardinal;

Description

Internal status bit flags used internally by ZipMaster.

// ZMDirEntry status bit constants

const

zsbDirty = $1;

zsbSelected = $2;

zsbSkipped = $4;

zsbIgnore = $8;

zsbDirOnly = $10;

zsbInvalid = $20;

zsbError = $40; // processing error

Run-time only

Read-only


StatusBits property - See also

See also

<<< See also of StatusBits property >>>


UncompressedSize property

See also

Applies to

TZMDirEntry class

Declaration

property UncompressedSize: Int64;

Description

The size of the file before compression.

Run-time only

Read-only


UncompressedSize property - See also

See also

<<< See also of UncompressedSize property >>>


VersionMadeBy property

See also

Applies to

TZMDirEntry class

Declaration

property VersionMadeBy: Word;

Description

Indicates the program version that made the file (low byte) and the operating system it was made in (high byte).

Run-time only

Read-only


VersionMadeBy property - See also

See also

<<< See also of VersionMadeBy property >>>


VersionNeeded property

See also

Applies to

TZMDirEntry class

Declaration

property VersionNeeded: Word;

Description

Specifies what zip version (Low byte) and operating system (high byte) is required for extraction.

Run-time only

Read-only


VersionNeeded property - See also

See also

<<< See also of VersionNeeded property >>>


TZMDirRec class

See also Methods

Unit

ZipMstr19

Description

A sub-class of TZMDirEntry that allows changing some properties.

This is used via a TZMChangeFunction that is called by ChangeFileDetails .


TZMDirRec class - See also

See also

TZMDirEntry

ChangeFileDetails


TZMDirRec - Methods

Methods

ChangeAttrs

ChangeComment

ChangeData

ChangeDate

ChangeEncoding

ChangeName

ChangeStamp


ChangeAttrs method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeAttrs(nAttr: Cardinal): Integer; virtual; abstract;

Description

Allows changing an entries external attributes .

Returns non-zero error code or 0 for success.


ChangeAttrs method - See also

See also

<<< See also of ChangeAttrs method >>>


ChangeAttrs method - Example


ChangeComment method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeComment(const ncomment: TZMString ): Integer; virtual; abstract;

Description

Allows changing an entries Comment .

Returns non-zero error code or 0 for success.


ChangeComment method - See also

See also

<<< See also of ChangeComment method >>>


ChangeComment method - Example


ChangeData method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeData(ndata: RawByteString): Integer; virtual; abstract;

Description

Allows changing an entries Extra Data .

Returns non-zero error code or 0 for success.


ChangeData method - See also

See also

<<< See also of ChangeData method >>>


ChangeData method - Example


ChangeDate method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeDate(ndosdate: Cardinal): Integer; virtual; abstract;

Description

Allows changing an entries Date stamp .

Returns non-zero error code or 0 for success.

ndosdate is date in DOS format.


ChangeDate method - See also

See also

<<< See also of ChangeDate method >>>


ChangeDate method - Example


ChangeEncoding method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeEncoding: Integer; virtual; abstract;

Description

Allows changing how an entry is encoded

Returns non-zero error code or 0 for success.


ChangeEncoding method - See also

See also

<<< See also of ChangeEncoding method >>>


ChangeEncoding method - Example


ChangeName method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeName(const nname: TZMString ): Integer; virtual; abstract;

Description

Allows changing an entries name .

Returns non-zero error code or 0 for success.

Changes both internal and external names and may cause Encoded to change


ChangeName method - See also

See also

<<< See also of ChangeName method >>>


ChangeName method - Example


ChangeStamp method

See also Example

Applies to

TZMDirRec component

Declaration

function ChangeStamp(ndate: TDateTime): Integer;

Description

Allows changing an entry's Date stamp .

Returns non-zero error code or 0 for success.


ChangeStamp method - See also

See also

<<< See also of ChangeStamp method >>>


ChangeStamp method - Example


TZipMasterEnumerator class

Unit

ZipMstr19

Description

D2007 and later only.

Allows using for .. in .. to iterate the DirEntries


AbsErr function

Unit

ZMUtils19

Declaration

function AbsErr(err: Integer): Integer;

Description

Many internal functions return a negative error values, this function converts it to 'normal'.


CanHash function

Unit

ZMUtils19

Declaration

function CanHash(const FSpec: String): Boolean;

Description

Used internally to detect if a file spec is safe to hash - eg. no wildcards.


CheckSFXType function

Unit

ZMUtils19

Declaration

function CheckSFXType(const fileHandle: Integer; var ZipName: String; var size: Integer): Integer; overload;

function CheckSFXType(const Name: String; var ZipName: String; var size: Integer): Integer; overload;

Description

Tries to identify the type of SFX Stub

Returns <0 error.

const

cstNone = 0; // not found

cstExe = 1; // might be stub of unknown type

cstSFX17 = 17; // found 1.7 SFX headers

cstSFX20 = 20; // found 2.0 SFX headers

cstDetached = 2048; // is detached - if name specified ZipName will modified for it - this is a bit flag added to the version.


DelimitPath function

Unit

ZMUtils19

Declaration

function DelimitPath(const Path: String; Sep: Boolean): String;

Description

If Sep is True return the Path with a trailing path delimiter, otherwise make certain that Path does not have one.


DirExists function

Unit

ZMUtils19

Declaration

function DirExists(const FName: String): Boolean;

Description

Returns true if the path FName exists.


DiskAvailable function

Unit

ZMUtils19

Declaration

function DiskAvailable(const path: String): Boolean;

Description

Return True if media exists for path.


EraseFile function

Unit

ZMUtils19

Declaration

function EraseFile(const FName: String; permanent: Boolean): Integer;

Description

Delete the file FName.

If permanent is False move it to the recycle bin.


ExeSize function

Unit

ZMUtils19

Declaration

function ExeSize(const Name: String): Cardinal; overload;

function ExeSize(fileHandle: Integer): Cardinal; overload;

Description

Return the size of the executable part.

This is meant to find the SFX stub size excluding any extra structures.

In general SFX files are built

SFX stub (the executable part)

Required Information used to extract

Zipped files.


ExeVers function

Unit

ZMUtils19

Declaration

function ExeVers(const FName: String): Integer;

Description

Returns the version number from a file's version information resource.


ExeVersion function

Unit

ZMUtils19

Declaration

function ExeVersion(const FName: String; var MS, LS: DWORD): Boolean;

Description

Reads the Version information from a file's version information resource.

Returns true if found then the file version is in MS and LS.


ExtractNameOfFile function

Unit

ZMUtils19

Declaration

function ExtractNameOfFile(const FileName: String): String;

Description

Returns the name part of FileName excluding the extension.


File_Size function

Unit

ZMUtils19

Declaration

function File_Size(const FSpec: TFilename): Int64;

Description

Returns the size of the specified file or -1 if not found.


FileDateToLocalDateTime function

Unit

ZMUtils19

Declaration

function FileDateToLocalDateTime(stamp: Integer): TDateTime;

Description

Converts the DOS date/time stamp to the local time (adjusts for daylight saving).


FileSeek64 function

Unit

ZMUtils19

Declaration

function FileSeek64(Handle: Integer; const Offset: Int64; Origin: Integer): Int64;

Description

Allow seeking 64 bit offsets.


ForceDirectory function

Unit

ZMUtils19

Declaration

function ForceDirectory(const DirName: String): Boolean;

Description

Attempts to create the named directory if it does not exist.

Returns True if successful.


GetVolumeLabel function

Unit

ZMUtils19

Declaration

function GetVolumeLabel(const drive: String): String;

Description

Return the volume label for the specified drive.


HasWild function

Unit

ZMUtils19

Declaration

function HasWild(const FSpec: String): Integer;

function HasWildW(const FSpec: WideString): Integer;

Description

Returns the index of the first wildcard character found.

Wildcard characters are -

* match zero or more characters

? match any single character


Hi64 function

Unit

ZMUtils19

Declaration

function Hi64(i: Int64): Cardinal;

Description

Returns the high 32 bits of an Int64.


IsFolder function

Unit

ZMUtils19

Declaration

function IsFolder(const name: RawByteString): boolean; overload;

function IsFolder(const Name: String): Boolean; overload;

Description

Return True if the last character is path delimiter.


IsSameFile function

Unit

ZMUtils19

Declaration

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.


IsWild function

Unit

ZMUtils19

Declaration

function IsWild(const FSpec: String): Boolean;

Description

Returns True if the string contains a wildcard character.

Wildcard characters are -

* match zero or more characters

? match any single character


IsWinXP function

Unit

ZMUtils19

Declaration

function IsWinXP: Boolean;

Description

Return True if running on Windows XP or later.


LastPos function

Unit

ZMUtils19

Declaration

function LastPos(const s: String; ch: Char; before: Integer = MAXINT): Integer;

function LastPosW(const s: WideString; wch: Widechar; before: Integer = MAXINT): Integer;

Description

Returns the index of the last occurance of the given character before the specified index.


Lo64 function

Unit

ZMUtils19

Declaration

function Lo64(i: Int64): Cardinal;

Description

Returns the low 32 bits of an Int64.


NameIsBad function

See also Example

Unit

ZMUtils19

Declaration

function NameIsBad(const astr: String): Boolean;

Description

Returns True is astr has invalid characters or format for use as a filename.


NameIsBad function - See also

See also

<<< See also of NameIsBad function >>>


NameIsBad function - Example


OEMToStr function

See also

Unit

ZMUtils19

Declaration

function OEMToStr(const astr: Ansistring): String;

Description

Converts astr from OEM into a string.


OEMToStr function - See also

See also

StrToOEM


OpenResStream function

Unit

ZMUtils19

Declaration

function OpenResStream(const ResName: String; const rtype: PChar): TResourceStream;

Description

Attempts to open a resource stream first looking in the executable module then, if unfound, trying the package module.


PathConcat function

Unit

ZMUtils19

Declaration

function PathConcat(const path, extra: String): String;

Description

appends second to first ensuring single backslash.

ie

first + second = first\second

first\ + \second = first\second


QueryZip function

See also Example

Unit

ZMUtils19

Declaration

function QueryZip(const FName: String): Integer;

Description

Tests the named zip file for various fields.

Returns < 0 on error otherwise it returns bit mapped values for the located fields.

It can be used for a relatively quick test to see if it is actually a zip file.

const // QueryZip return bit values and errors

zqbStartEXE = 1; // is EXE file may be SFX

zqbStartLocal = 2; // normal zip file start

zqbStartSpan = 4; // first part of span

zqbStartCentral = 8; // continuing Central Header

zqbHasComment = 16; // comment length good (no junk at end)

zqbHasLocal = 32; // first Central entry points to local header

zqbHasCentral = 64; // Central entry where it should be

zqbHasEOC = 128; // End of Central entry

zqbHasLoc64 = 256; // EOC64 locator entry

zqbHasEOC64 = 512; // Zip64 EOC

zqbJunkAtEnd = 1024; // junk at end of zip

zqbIsDiskZero = 2048; // is disk 0

zqFieldError = -5; // bad field value

zqFileError = -7; // file handling error

zqGeneralError = -9; // unspecified failure


QueryZip function - See also

See also

<<< See also of QueryZip function >>>


QueryZip function - Example


SetSlash function

Unit

ZMUtils19

Declaration

function SetSlash(const path: String; dir: TPathSlashDirection): String;

function SetSlashW(const path: WideString; dir: TPathSlashDirection): WideString;

type TPathSlashDirection = (psdExternal, psdInternal);

Description

Sets the path delimiters to either

psdExternal - Windows standard backslash \

psdInternal - zip internal format slash /


StrHasExt function

Unit

ZMUtils19

Declaration

function StrHasExt(const astr: AnsiString): Boolean; overload;

function StrHasExt(const astr: RawByteString): Boolean; overload;

function StrHasExt(const astr: String): Boolean; overload;

Description

Returns True is the string contains a character value > #127


StrToOEM function

See also

Unit

ZMUtils19

Declaration

function StrToOEM(const astr: String): String;

Description

Converts the string to OEM.


StrToOEM function - See also

See also

OEMToStr


VersStr function

Unit

ZMUtils19

Declaration

function VersStr(vers: Integer; Comma: Boolean = False): String;

Description

Converts our version value to a readable string.

If Comma is true the format is '%d,%d,%d,%d'

if false the format is '%d.%d.%d.%4.4d'


WinVersion function

Unit

ZMUtils19

Declaration

function WinVersion: Integer;

Description

Converts the Windows version into an easily usable approximate value (= (Major_version * 100) + Minor_version).


File_Close procedure

Unit

ZMUtils19

Declaration

procedure File_Close(var fh: Integer);

Description

Invalidates the handle variable then closes the handle (if it can).


File_Delete procedure

Unit

ZMUtils19

Declaration

procedure File_Delete(const FName: String);

Description

If it can locate the file it attempts to delete it.


TZMProgressDetails class

See also Properties

Unit

TZipMstr19

type

TZMProgressDetails= class;

Description

Provides operation progress read-only details in the OnProgress event

type

TZMProgressDetails= class(TObject)

public

destructor Destroy; override;

property BytesWritten : Int64;

property Delta : Int64;

property ItemName : TZMString ;

property ItemNumber : Integer;

property ItemPerCent : Integer;

property ItemPosition : Integer;

property ItemSize : Integer;

property Order : TZMProgressType ;

property TotalCount : Int64;

property TotalPerCent : Integer;

property TotalPosition : Integer;

property TotalSize : Int64;

end;


TZMProgressDetails class - See also

See also

<<< See also of TZMProgressDetails class >>>


TZMProgressDetails - Properties

Properties

Run-time only [image] Key properties

BytesWritten

Delta

ItemName

ItemNumber

ItemPerCent

ItemPosition

ItemSize

Order

TotalCount

TotalPerCent

TotalPosition

TotalSize


AnsiIsSafe function

Unit

ZMUTF819

Declaration

function AnsiIsSafe(const ustr: AnsiString; ToOEM: boolean): Boolean;

Description

When ToEOM is True, verify all characters in ustr can safely be converted.


AsUTF8Str function

Unit

ZMUTF819

Declaration

function AsUTF8Str(const zstr: TZMString): UTF8String;

Description

Converts zstr to an UTF8String if it has extended characters.


PUTF8ToSafe function

Unit

ZMUTF819

Declaration

function PUTF8ToSafe(const raw: PAnsiChar; len: integer): AnsiString;

function UTF8ToSafe(const ustr: AnsiString; ToOEM: boolean): AnsiString;

Description

Converts a string of char or an Ansistring into an AnsiString escaping unsupported characters using

code page CP_OEMCP when ToOEM is true,

codepage CP_ACP when ToOEM is false.


PUTF8ToStr function

Unit

ZMUTF819

Declaration

function PUTF8ToStr(const raw: PAnsiChar; len: integer): String;

function UTF8ToStr(const astr: UTF8String): String;

Description

Converts a string of AnsiChar or an UTF8 string into a String:

On Unicode versions (CB2009 or later) this is a standard String.

On earlier versions String is an AnsiString


PUTF8ToWideStr function

Unit

ZMUTF819

Declaration

function PUTF8ToWideStr(const raw: PAnsiChar; len: integer): TZMWideString;

function UTF8ToWide(const astr: UTF8String; len: integer = - 1): TZMWideString;

Description

Converts a string of AnsiChar or an UTF8 string into a TZMWideString .


PWideToUTF8 function

Unit

ZMUTF819

Declaration

function PWideToUTF8(const pwstr: PWideChar; len: integer = -1): UTF8String;

function WideToUTF8(const astr: TZMWideString ; len: integer = -1): UTF8String;

Description

Converts a string of WideChar to UTF8.

If len = -1 all of the characters up to the terminating #0 are used.


StrToUTF8 function

Unit

ZMUTF819

Declaration

function StrToUTF8(const ustr: String): UTF8String;

Description

Converts a String into an UTF8String

On Unicode versions (CB2009 or later) String is a standard UnicodeString.

On earlier versions String is an AnsiString


StrToUTFEx function

Unit

ZMUTF819

Declaration

function StrToUTFEx(const astr: AnsiString; cp: cardinal = 0; len: integer = - 1): TZMString ;

Description

Converts an AnsiString into a TZMString, using the codepage cp and the length len, if len is -1 the total length of astr is used.


StrToWideEx function

Unit

ZMUTF819

Declaration

function StrToWideEx(const astr: AnsiString; cp: cardinal; len: integer): TZMWideString ;

Description

Converts an AnsiString into a TZMWideString, using the codepage cp and the length len, if len is -1 the total length of astr is used.


UTF8IsSafe function

Unit

ZMUTF819

Declaration

function UTF8IsSafe(const ustr: AnsiString; ToOEM: boolean): Boolean;

Description

Returns true if all characters in ustr are supported using

code page CP_OEMCP when ToOEM is true,

codepage CP_ACP when ToOEM is false.


IsUTF8Trail function

Unit

ZMUTF819

Declaration

function IsUTF8Trail(c: AnsiChar): boolean;

Description

Returns True if c is a trailing character of a multi-character sequence.


UTF8SeqLen function

Unit

ZMUTF819

Declaration

function UTF8SeqLen(c: AnsiChar): integer;

Description

Returns the number of bytes in an UTF8 multi-byte code sequence.


ValidUTF8 function

Unit

ZMUTF819

Declaration

function ValidUTF8(const str: AnsiString; len: integer = - 1): integer; overload;

function ValidUTF8(const str: UTF8String; len: integer = - 1): integer; overload;

function ValidUTF8(pstr: PAnsiChar; len: integer): integer; overload;

Description

Test for valid UTF8 character(s) in the string

return > 0 if some valid UTF8 characters are present

return 0 if no UTF8 characters are present

return < 0 if some characters are invalid UTF8 characters


WideIsSafe function

Unit

ZMUTF819

Declaration

function WideIsSafe(const wstr: TZMWideString ; ToOEM: boolean): Boolean;

Description

Returns true if all characters in wstr are supported using

code page CP_OEMCP when ToOEM is true,

codepage CP_ACP when ToOEM is false.


WideToSafe function

Unit

ZMUTF819

Declaration

function WideToSafe(const wstr: TZMWideString ; ToOEM: boolean): AnsiString;

Description

Convert a TZMWideString to AnsiString escaping unsupported characters using

code page CP_OEMCP when ToOEM is true,

codepage CP_ACP when ToOEM is false.


ZipMaster component

TZipMaster - Version 1.90

Main Unit

ZipMstr19.pas

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 for zip and unzip operations, DelZip190.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 ConvertToSFX method.

TZipMaster can encrypt and decrypt files through the Password property.

Many operations do not require the dll.

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

Overview of changes v1.9

- for specific changes see Details

- for full package file details see Source files

Zip extensions version 4.50 can be used.

Zip file names - can use UTF8 for storing international file names.

Most types and constants now are prefixed TZM or TZ

Pre-D2009 to prevent corruption of international names they can be kept as UTF8.

D2009 (and later) file names are converted to Unicode so no corruption should occur.

NTFS file stamps can be saved or restored.

The dll is now Unicode (still supports Win 98).

Updated SFX stub with support integrated into the component .

Add or Extract with multiple streams.

Distributed under the GNU LESSER GENERAL PUBLIC LICENSE Version 3 (2007)

updated 2009-02-03


InfoZip information

To obtain the officialMissing image: infozip.wmfsource code consult their Website: http://freesoftware.com/pub/infozip/Info-ZIP.html%!E F("h t t p://f r e e s o f t w a r e.c o m/p u b/i n f o z i p/I n f o-Z I P.h t m l",`',1)


Bug Reports

TZipMaster

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

DelphiZip mailing list: delphizip@freelists.org

Join the mailing list: http://www.freelists.org/list/delphizip

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

João Alexandre de Toledo: j.toledo@uol.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

Xavier Mor-Mur: xmormur@telepolis.com

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

Roger Aelbrecht: zipbuilder@drehoeksw.net

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

Roland Ruder: r.ruder@gmx.de

latest update by Winfried Posur: WPosur@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

Sólya Zoltán:

Italian translation found in ZipMsgIT.rc and ZipMsgIT.res

Fabrizio Atza: faatza@tin.it

Japanese translation found in ZipMsgJP.rc and ZipMsgJP.res

Korean translation found in ZipMsgKO.rc and ZipMsgKO.res

Yun,BokSoo: woodcom@kebi.com

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

Slovenian translation found in ZipMsgSI.rc and ZipMsgSI.res

Spanish translation found in ZipMsgES.rc and ZipMsgES.res

Xavier Mor-Mur: xmormur@telepolis.com

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.]

HuanlinTsai: huanlin_tsai@yahoo.com

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

Brazilian (Portuguese) translation found in SFXstr_BR.txt

Catalan SFX translation as found in SFXstr_CAT.txt

Xavier Mor-Mur: xmormur@telepolis.com

Danish translation found in SFXstr_DK.txt

Carsten S. Rasmussen

Dutch translation found in SFXstr_NL.txt

Roger Aelbrecht: Zipbuilder@drehoeksw.net

French translation found in SFXstr_FR.txt

Nicolas Mastin

German translation found in SFXstr_DE.txt

Roland Ruder: r.ruder@gmx.de

Hungarian translation found in SFXstr_HU.txt

Sólya Zoltán

Italian translation found in SFXstr_IT.txt

Matteo Riso

Korean translation found in SFXstr_KO.txt

Yun,BokSoo : woodcom@kebi.com

Polish SFX translation as found in SFXstr_PL.txt

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

Spanish SFX translation as found in SFXstr_ES.txt

Jorge Almaraz


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 file that is 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...

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

In memory of

Chris Vleghert,

Eric W. Engler


Licence

See also: GNU GENERAL PUBLIC LICENSE

GNU LESSER GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies

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

This version of the GNU Lesser General Public License incorporates

the terms and conditions of version 3 of the GNU General Public

License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser

General Public License, and the "GNU GPL" refers to version 3 of the GNU

General Public License.

"The Library" refers to a covered work governed by this License,

other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided

by the Library, but which is not otherwise based on the Library.

Defining a subclass of a class defined by the Library is deemed a mode

of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an

Application with the Library. The particular version of the Library

with which the Combined Work was made is also called the "Linked

Version".

The "Minimal Corresponding Source" for a Combined Work means the

Corresponding Source for the Combined Work, excluding any source code

for portions of the Combined Work that, considered in isolation, are

based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the

object code and/or source code for the Application, including any data

and utility programs needed for reproducing the Combined Work from the

Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License

without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a

facility refers to a function or data to be supplied by an Application

that uses the facility (other than as an argument passed when the

facility is invoked), then you may convey a copy of the modified

version:

a) under this License, provided that you make a good faith effort to

ensure that, in the event an Application does not supply the

function or data, the facility still operates, and performs

whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of

this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from

a header file that is part of the Library. You may convey such object

code under terms of your choice, provided that, if the incorporated

material is not limited to numerical parameters, data structure

layouts and accessors, or small macros, inline functions and templates

(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the

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

covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license

document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,

taken together, effectively do not restrict modification of the

portions of the Library contained in the Combined Work and reverse

engineering for debugging such modifications, if you also do each of

the following:

a) Give prominent notice with each copy of the Combined Work that

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

covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license

document.

c) For a Combined Work that displays copyright notices during

execution, include the copyright notice for the Library among

these notices, as well as a reference directing the user to the

copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this

License, and the Corresponding Application Code in a form

suitable for, and under terms that permit, the user to

recombine or relink the Application with a modified version of

the Linked Version to produce a modified Combined Work, in the

manner specified by section 6 of the GNU GPL for conveying

Corresponding Source.

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

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

a copy of the Library already present on the user's computer

system, and (b) will operate properly with a modified version

of the Library that is interface-compatible with the Linked

Version.

e) Provide Installation Information, but only if you would otherwise

be required to provide such information under section 6 of the

GNU GPL, and only to the extent that such information is

necessary to install and execute a modified version of the

Combined Work produced by recombining or relinking the

Application with a modified version of the Linked Version. (If

you use option 4d0, the Installation Information must accompany

the Minimal Corresponding Source and Corresponding Application

Code. If you use option 4d1, you must provide the Installation

Information in the manner specified by section 6 of the GNU GPL

for conveying Corresponding Source.)

5. Combined Libraries.

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 that are not Applications and are not covered by this

License, and convey such a combined library under terms of your

choice, if you do both of the following:

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

on the Library, uncombined with any other library facilities,

conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it

is a work based on the Library, and explaining where to find the

accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions

of the GNU 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 as you received it specifies that a certain numbered version

of the GNU Lesser General Public License "or any later version"

applies to it, you have the option of following the terms and

conditions either of that published version or of any later version

published by the Free Software Foundation. If the Library as you

received it does not specify a version number of the GNU Lesser

General Public License, you may choose any version of the GNU Lesser

General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide

whether future versions of the GNU Lesser General Public License shall

apply, that proxy's public statement of acceptance of any version is

permanent authorization for you to choose that version for the

Library.


GNU General Public License

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies

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

Preamble

The GNU General Public License is a free, copyleft license for

software and other kinds of works.

The licenses for most software and other practical works are designed

to take away your freedom to share and change the works. By contrast,

the GNU General Public License is intended to guarantee your freedom to

share and change all versions of a program--to make sure it remains free

software for all its users. We, the Free Software Foundation, use the

GNU General Public License for most of our software; it applies also to

any other work released this way by its authors. You can apply it to

your programs, too.

When we speak of free software, we are referring to freedom, 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

them if you wish), that you receive source code or can get it if you

want it, that you can change the software or use pieces of it in new

free programs, and that you know you can do these things.

To protect your rights, we need to prevent others from denying you

these rights or asking you to surrender the rights. Therefore, you have

certain responsibilities if you distribute copies of the software, or if

you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether

gratis or for a fee, you must pass on to the recipients the same

freedoms that you received. You must make sure that they, too, receive

or can get the source code. And you must show them these terms so they

know their rights.

Developers that use the GNU GPL protect your rights with two steps:

(1) assert copyright on the software, and (2) offer you this License

giving you legal permission to copy, distribute and/or modify it.

For the developers' and authors' protection, the GPL clearly explains

that there is no warranty for this free software. For both users' and

authors' sake, the GPL requires that modified versions be marked as

changed, so that their problems will not be attributed erroneously to

authors of previous versions.

Some devices are designed to deny users access to install or run

modified versions of the software inside them, although the manufacturer

can do so. This is fundamentally incompatible with the aim of

protecting users' freedom to change the software. The systematic

pattern of such abuse occurs in the area of products for individuals to

use, which is precisely where it is most unacceptable. Therefore, we

have designed this version of the GPL to prohibit the practice for those

products. If such problems arise substantially in other domains, we

stand ready to extend this provision to those domains in future versions

of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents.

States should not allow patents to restrict development and use of

software on general-purpose computers, but in those that do, we wish to

avoid the special danger that patents applied to a free program could

make it effectively proprietary. To prevent this, the GPL assures that

patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and

modification follow.

TERMS AND CONDITIONS

0. Definitions.

"This License" refers to version 3 of the GNU General Public License.

"Copyright" also means copyright-like laws that apply to other kinds of

works, such as semiconductor masks.

"The Program" refers to any copyrightable work licensed under this

License. Each licensee is addressed as "you". "Licensees" and

"recipients" may be individuals or organizations.

To "modify" a work means to copy from or adapt all or part of the work

in a fashion requiring copyright permission, other than the making of an

exact copy. The resulting work is called a "modified version" of the

earlier work or a work "based on" the earlier work.

A "covered work" means either the unmodified Program or a work based

on the Program.

To "propagate" a work means to do anything with it that, without

permission, would make you directly or secondarily liable for

infringement under applicable copyright law, except executing it on a

computer or modifying a private copy. Propagation includes copying,

distribution (with or without modification), making available to the

public, and in some countries other activities as well.

To "convey" a work means any kind of propagation that enables other

parties to make or receive copies. Mere interaction with a user through

a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays "Appropriate Legal Notices"

to the extent that it includes a convenient and prominently visible

feature that (1) displays an appropriate copyright notice, and (2)

tells the user that there is no warranty for the work (except to the

extent that warranties are provided), that licensees may convey the

work under this License, and how to view a copy of this License. If

the interface presents a list of user commands or options, such as a

menu, a prominent item in the list meets this criterion.

1. Source Code.

The "source code" for a work means the preferred form of the work

for making modifications to it. "Object code" means any non-source

form of a work.

A "Standard Interface" means an interface that either is an official

standard defined by a recognized standards body, or, in the case of

interfaces specified for a particular programming language, one that

is widely used among developers working in that language.

The "System Libraries" of an executable work include anything, other

than the work as a whole, that (a) is included in the normal form of

packaging a Major Component, but which is not part of that Major

Component, and (b) serves only to enable use of the work with that

Major Component, or to implement a Standard Interface for which an

implementation is available to the public in source code form. A

"Major Component", in this context, means a major essential component

(kernel, window system, and so on) of the specific operating system

(if any) on which the executable work runs, or a compiler used to

produce the work, or an object code interpreter used to run it.

The "Corresponding Source" for a work in object code form means all

the source code needed to generate, install, and (for an executable

work) run the object code and to modify the work, including scripts to

control those activities. However, it does not include the work's

System Libraries, or general-purpose tools or generally available free

programs which are used unmodified in performing those activities but

which are not part of the work. For example, Corresponding Source

includes interface definition files associated with source files for

the work, and the source code for shared libraries and dynamically

linked subprograms that the work is specifically designed to require,

such as by intimate data communication or control flow between those

subprograms and other parts of the work.

The Corresponding Source need not include anything that users

can regenerate automatically from other parts of the Corresponding

Source.

The Corresponding Source for a work in source code form is that

same work.

2. Basic Permissions.

All rights granted under this License are granted for the term of

copyright on the Program, and are irrevocable provided the stated

conditions are met. This License explicitly affirms your unlimited

permission to run the unmodified Program. The output from running a

covered work is covered by this License only if the output, given its

content, constitutes a covered work. This License acknowledges your

rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not

convey, without conditions so long as your license otherwise remains

in force. You may convey covered works to others for the sole purpose

of having them make modifications exclusively for you, or provide you

with facilities for running those works, provided that you comply with

the terms of this License in conveying all material for which you do

not control copyright. Those thus making or running the covered works

for you must do so exclusively on your behalf, under your direction

and control, on terms that prohibit them from making any copies of

your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under

the conditions stated below. Sublicensing is not allowed; section 10

makes it unnecessary.

3. Protecting Users' Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological

measure under any applicable law fulfilling obligations under article

11 of the WIPO copyright treaty adopted on 20 December 1996, or

similar laws prohibiting or restricting circumvention of such

measures.

When you convey a covered work, you waive any legal power to forbid

circumvention of technological measures to the extent such circumvention

is effected by exercising rights under this License with respect to

the covered work, and you disclaim any intention to limit operation or

modification of the work as a means of enforcing, against the work's

users, your or third parties' legal rights to forbid circumvention of

technological measures.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program's source code as you

receive it, in any medium, provided that you conspicuously and

appropriately publish on each copy an appropriate copyright notice;

keep intact all notices stating that this License and any

non-permissive terms added in accord with section 7 apply to the code;

keep intact all notices of the absence of any warranty; and give all

recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey,

and you may offer support or warranty protection for a fee.

5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to

produce it from the Program, in the form of source code under the

terms of section 4, provided that you also meet all of these conditions:

a) The work must carry prominent notices stating that you modified

it, and giving a relevant date.

b) The work must carry prominent notices stating that it is

released under this License and any conditions added under section

7. This requirement modifies the requirement in section 4 to

"keep intact all notices".

c) You must license the entire work, as a whole, under this

License to anyone who comes into possession of a copy. This

License will therefore apply, along with any applicable section 7

additional terms, to the whole of the work, and all its parts,

regardless of how they are packaged. This License gives no

permission to license the work in any other way, but it does not

invalidate such permission if you have separately received it.

d) If the work has interactive user interfaces, each must display

Appropriate Legal Notices; however, if the Program has interactive

interfaces that do not display Appropriate Legal Notices, your

work need not make them do so.

A compilation of a covered work with other separate and independent

works, which are not by their nature extensions of the covered work,

and which are not combined with it such as to form a larger program,

in or on a volume of a storage or distribution medium, is called an

"aggregate" if the compilation and its resulting copyright are not

used to limit the access or legal rights of the compilation's users

beyond what the individual works permit. Inclusion of a covered work

in an aggregate does not cause this License to apply to the other

parts of the aggregate.

6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms

of sections 4 and 5, provided that you also convey the

machine-readable Corresponding Source under the terms of this License,

in one of these ways:

a) Convey the object code in, or embodied in, a physical product

(including a physical distribution medium), accompanied by the

Corresponding Source fixed on a durable physical medium

customarily used for software interchange.

b) Convey the object code in, or embodied in, a physical product

(including a physical distribution medium), accompanied by a

written offer, valid for at least three years and valid for as

long as you offer spare parts or customer support for that product

model, to give anyone who possesses the object code either (1) a

copy of the Corresponding Source for all the software in the

product that is covered by this License, on a durable physical

medium customarily used for software interchange, for a price no

more than your reasonable cost of physically performing this

conveying of source, or (2) access to copy the

Corresponding Source from a network server at no charge.

c) Convey individual copies of the object code with a copy of the

written offer to provide the Corresponding Source. This

alternative is allowed only occasionally and noncommercially, and

only if you received the object code with such an offer, in accord

with subsection 6b.

d) Convey the object code by offering access from a designated

place (gratis or for a charge), and offer equivalent access to the

Corresponding Source in the same way through the same place at no

further charge. You need not require recipients to copy the

Corresponding Source along with the object code. If the place to

copy the object code is a network server, the Corresponding Source

may be on a different server (operated by you or a third party)

that supports equivalent copying facilities, provided you maintain

clear directions next to the object code saying where to find the

Corresponding Source. Regardless of what server hosts the

Corresponding Source, you remain obligated to ensure that it is

available for as long as needed to satisfy these requirements.

e) Convey the object code using peer-to-peer transmission, provided

you inform other peers where the object code and Corresponding

Source of the work are being offered to the general public at no

charge under subsection 6d.

A separable portion of the object code, whose source code is excluded

from the Corresponding Source as a System Library, need not be

included in conveying the object code work.

A "User Product" is either (1) a "consumer product", which means any

tangible personal property which is normally used for personal, family,

or household purposes, or (2) anything designed or sold for incorporation

into a dwelling. In determining whether a product is a consumer product,

doubtful cases shall be resolved in favor of coverage. For a particular

product received by a particular user, "normally used" refers to a

typical or common use of that class of product, regardless of the status

of the particular user or of the way in which the particular user

actually uses, or expects or is expected to use, the product. A product

is a consumer product regardless of whether the product has substantial

commercial, industrial or non-consumer uses, unless such uses represent

the only significant mode of use of the product.

"Installation Information" for a User Product means any methods,

procedures, authorization keys, or other information required to install

and execute modified versions of a covered work in that User Product from

a modified version of its Corresponding Source. The information must

suffice to ensure that the continued functioning of the modified object

code is in no case prevented or interfered with solely because

modification has been made.

If you convey an object code work under this section in, or with, or

specifically for use in, a User Product, and the conveying occurs as

part of a transaction in which the right of possession and use of the

User Product is transferred to the recipient in perpetuity or for a

fixed term (regardless of how the transaction is characterized), the

Corresponding Source conveyed under this section must be accompanied

by the Installation Information. But this requirement does not apply

if neither you nor any third party retains the ability to install

modified object code on the User Product (for example, the work has

been installed in ROM).

The requirement to provide Installation Information does not include a

requirement to continue to provide support service, warranty, or updates

for a work that has been modified or installed by the recipient, or for

the User Product in which it has been modified or installed. Access to a

network may be denied when the modification itself materially and

adversely affects the operation of the network or violates the rules and

protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided,

in accord with this section must be in a format that is publicly

documented (and with an implementation available to the public in

source code form), and must require no special password or key for

unpacking, reading or copying.

7. Additional Terms.

"Additional permissions" are terms that supplement the terms of this

License by making exceptions from one or more of its conditions.

Additional permissions that are applicable to the entire Program shall

be treated as though they were included in this License, to the extent

that they are valid under applicable law. If additional permissions

apply only to part of the Program, that part may be used separately

under those permissions, but the entire Program remains governed by

this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option

remove any additional permissions from that copy, or from any part of

it. (Additional permissions may be written to require their own

removal in certain cases when you modify the work.) You may place

additional permissions on material, added by you to a covered work,

for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you

add to a covered work, you may (if authorized by the copyright holders of

that material) supplement the terms of this License with terms:

a) Disclaiming warranty or limiting liability differently from the

terms of sections 15 and 16 of this License; or

b) Requiring preservation of specified reasonable legal notices or

author attributions in that material or in the Appropriate Legal

Notices displayed by works containing it; or

c) Prohibiting misrepresentation of the origin of that material, or

requiring that modified versions of such material be marked in

reasonable ways as different from the original version; or

d) Limiting the use for publicity purposes of names of licensors or

authors of the material; or

e) Declining to grant rights under trademark law for use of some

trade names, trademarks, or service marks; or

f) Requiring indemnification of licensors and authors of that

material by anyone who conveys the material (or modified versions of

it) with contractual assumptions of liability to the recipient, for

any liability that these contractual assumptions directly impose on

those licensors and authors.

All other non-permissive additional terms are considered "further

restrictions" within the meaning of section 10. If the Program as you

received it, or any part of it, contains a notice stating that it is

governed by this License along with a term that is a further

restriction, you may remove that term. If a license document contains

a further restriction but permits relicensing or conveying under this

License, you may add to a covered work material governed by the terms

of that license document, provided that the further restriction does

not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you

must place, in the relevant source files, a statement of the

additional terms that apply to those files, or a notice indicating

where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the

form of a separately written license, or stated as exceptions;

the above requirements apply either way.

8. Termination.

You may not propagate or modify a covered work except as expressly

provided under this License. Any attempt otherwise to propagate or

modify it is void, and will automatically terminate your rights under

this License (including any patent licenses granted under the third

paragraph of section 11).

However, if you cease all violation of this License, then your

license from a particular copyright holder is reinstated (a)

provisionally, unless and until the copyright holder explicitly and

finally terminates your license, and (b) permanently, if the copyright

holder fails to notify you of the violation by some reasonable means

prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is

reinstated permanently if the copyright holder notifies you of the

violation by some reasonable means, this is the first time you have

received notice of violation of this License (for any work) from that

copyright holder, and you cure the violation prior to 30 days after

your receipt of the notice.

Termination of your rights under this section does not terminate the

licenses of parties who have received copies or rights from you under

this License. If your rights have been terminated and not permanently

reinstated, you do not qualify to receive new licenses for the same

material under section 10.

9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or

run a copy of the Program. Ancillary propagation of a covered work

occurring solely as a consequence of using peer-to-peer transmission

to receive a copy likewise does not require acceptance. However,

nothing other than this License grants you permission to propagate or

modify any covered work. These actions infringe copyright if you do

not accept this License. Therefore, by modifying or propagating a

covered work, you indicate your acceptance of this License to do so.

10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically

receives a license from the original licensors, to run, modify and

propagate that work, subject to this License. You are not responsible

for enforcing compliance by third parties with this License.

An "entity transaction" is a transaction transferring control of an

organization, or substantially all assets of one, or subdividing an

organization, or merging organizations. If propagation of a covered

work results from an entity transaction, each party to that

transaction who receives a copy of the work also receives whatever

licenses to the work the party's predecessor in interest had or could

give under the previous paragraph, plus a right to possession of the

Corresponding Source of the work from the predecessor in interest, if

the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the

rights granted or affirmed under this License. For example, you may

not impose a license fee, royalty, or other charge for exercise of

rights granted under this License, and you may not initiate litigation

(including a cross-claim or counterclaim in a lawsuit) alleging that

any patent claim is infringed by making, using, selling, offering for

sale, or importing the Program or any portion of it.

11. Patents.

A "contributor" is a copyright holder who authorizes use under this

License of the Program or a work on which the Program is based. The

work thus licensed is called the contributor's "contributor version".

A contributor's "essential patent claims" are all patent claims

owned or controlled by the contributor, whether already acquired or

hereafter acquired, that would be infringed by some manner, permitted

by this License, of making, using, or selling its contributor version,

but do not include claims that would be infringed only as a

consequence of further modification of the contributor version. For

purposes of this definition, "control" includes the right to grant

patent sublicenses in a manner consistent with the requirements of

this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free

patent license under the contributor's essential patent claims, to

make, use, sell, offer for sale, import and otherwise run, modify and

propagate the contents of its contributor version.

In the following three paragraphs, a "patent license" is any express

agreement or commitment, however denominated, not to enforce a patent

(such as an express permission to practice a patent or covenant not to

sue for patent infringement). To "grant" such a patent license to a

party means to make such an agreement or commitment not to enforce a

patent against the party.

If you convey a covered work, knowingly relying on a patent license,

and the Corresponding Source of the work is not available for anyone

to copy, free of charge and under the terms of this License, through a

publicly available network server or other readily accessible means,

then you must either (1) cause the Corresponding Source to be so

available, or (2) arrange to deprive yourself of the benefit of the

patent license for this particular work, or (3) arrange, in a manner

consistent with the requirements of this License, to extend the patent

license to downstream recipients. "Knowingly relying" means you have

actual knowledge that, but for the patent license, your conveying the

covered work in a country, or your recipient's use of the covered work

in a country, would infringe one or more identifiable patents in that

country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or

arrangement, you convey, or propagate by procuring conveyance of, a

covered work, and grant a patent license to some of the parties

receiving the covered work authorizing them to use, propagate, modify

or convey a specific copy of the covered work, then the patent license

you grant is automatically extended to all recipients of the covered

work and works based on it.

A patent license is "discriminatory" if it does not include within

the scope of its coverage, prohibits the exercise of, or is

conditioned on the non-exercise of one or more of the rights that are

specifically granted under this License. You may not convey a covered

work if you are a party to an arrangement with a third party that is

in the business of distributing software, under which you make payment

to the third party based on the extent of your activity of conveying

the work, and under which the third party grants, to any of the

parties who would receive the covered work from you, a discriminatory

patent license (a) in connection with copies of the covered work

conveyed by you (or copies made from those copies), or (b) primarily

for and in connection with specific products or compilations that

contain the covered work, unless you entered into that arrangement,

or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting

any implied license or other defenses to infringement that may

otherwise be available to you under applicable patent law.

12. No Surrender of Others' Freedom.

If 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 convey a

covered work so as to satisfy simultaneously your obligations under this

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

not convey it at all. For example, if you agree to terms that obligate you

to collect a royalty for further conveying from those to whom you convey

the Program, the only way you could satisfy both those terms and this

License would be to refrain entirely from conveying the Program.

13. Use with the GNU Affero General Public License.

Notwithstanding any other provision of this License, you have

permission to link or combine any covered work with a work licensed

under version 3 of the GNU Affero General Public License into a single

combined work, and to convey the resulting work. The terms of this

License will continue to apply to the part which is the covered work,

but the special requirements of the GNU Affero General Public License,

section 13, concerning interaction through a network will apply to the

combination as such.

14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of

the GNU 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

Program specifies that a certain numbered version of the GNU General

Public License "or any later version" applies to it, you have the

option of following the terms and conditions either of that numbered

version or of any later version published by the Free Software

Foundation. If the Program does not specify a version number of the

GNU General Public License, you may choose any version ever published

by the Free Software Foundation.

If the Program specifies that a proxy can decide which future

versions of the GNU General Public License can be used, that proxy's

public statement of acceptance of a version permanently authorizes you

to choose that version for the Program.

Later license versions may give you additional or different

permissions. However, no additional obligations are imposed on any

author or copyright holder as a result of your choosing to follow a

later version.

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY

APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT

HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM

IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF

ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING

WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS

THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),

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

SUCH DAMAGES.

17. Interpretation of Sections 15 and 16.

If the disclaimer of warranty and limitation of liability provided

above cannot be given local legal effect according to their terms,

reviewing courts shall apply local law that most closely approximates

an absolute waiver of all civil liability in connection with the

Program, unless a warranty or assumption of liability accompanies a

copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS


Changes v1.9

TZipMaster

New -

Zip extensions version 4.50 -

Files larger than 4Gb supported

More than 64k files

Zip file names - can use UTF8 for storing international file names.

When writing zip files the format used is controlled by new WriteOptions

zeoAuto, use OEM unless extended characters, otherwise UPath or UTF8

zeoRaw, do not encode file names

zeoOEM, convert file names to OEM

zeoUTF8, store extended file names as UTF8 (Default)

zeoUPATH store extended file names using unique safe name and (Info-Zip) UTF8

When reading zip files the format expected is controlled by the new property Encoded

zeoAuto, unless flags/versions say otherwise, or it has UTF8 name in data,

treat it as OEM (FAT) / Ansi (NTFS)

zeoNone, assume name is Ansi - convert to Ansi/Unicode

zeoOEM, assume name is OEM - convert to Ansi/Unicode

zeoUTF, assume name is UTF8 - convert to Ansi/Unicode

zeoUPATH, use UPATH if available

Pre-D2009 to prevent corruption of international names they can be kept as UTF8 - see property UseUTF8 .

D2009 (and later) file names are converted to Unicode so no corruption should occur.

NTFS file stamps can be saved or restored - see AddNTFS and ExtrNTFS .

When adding new files to an existing archive the old file be preserved - see AddVersion .

Types

TZMString

D2009+ UnicodeString

Pre D2009 Ansi/UTF8

TZMWideString

D2009+ UnicodeString

Pre D2009 WideString

TZMDirEntry

now a class was TZipDirEntry

TZMDirRec

version of TZMDirEntry allowing limited editing

TZMSStats

used to 'identify' streams

Enumerations

TZMStates

component operating state - see TZMStateChange

TZMDeflates

Deflate methods - see Deflate or Undeflate

TZMEncodingOpts

how names are encoded (reading)

TZMStreamOp

used to handle stream event requests

TZMWriteOpts

used when writing a zip file

TZMAddOptsEnum. addSeparateDirs

has been replaced by addNoSeparateDirs because the default now

is to always add them (the directory entry details are required).

Functions

AddZippedFiles

add specified files from another zip file

ChangeFileDetails

apply a function to modify file details for specified zip entries

ForEach

use a function on specified read-only zip entries

Deflate

compress a stream

Undeflate

uncompress compressed stream

Properties

UseUTF8

controls string representation (Pre D2009 only)

Encoding

Filename and comment character encoding

Encoding_CP

codepage to use to decode filename - 'raw' names only

WriteOptions

controls how zip files will be written

MaxVolumeSizeKb

maximum volume size in kbytes

NoSkipping

if true skipping a file is an error

Events

TZMStreamEvent

Allows using streams in add/extract operations

TZMStateChange

Indicates changes to component busy state

TZMCopyZippedOverwriteEvent

from AddZippedFile , CopyZippedFile *changed

TZMSkippedEvent

replaces TExtractSkipped

TItemProgressEvent

removed - use TZMProgressEvent

TProgressEvent

removed - use TZMProgressEvent

TTotalProgressEvent

removed - use TZMProgressEvent

TZMNewNameEvent

changed signature

TZMSetCompLevelEvent

new


{}

Hierarchy

TObject1 Q H 3 4 P>m a i n@D E L 4 V C L

|

TPersistent1 Y 6 L K C_>m a i n@D E L 4 V CL

|

TComponent1 J I X 1 J 6>m a i n@D E L 4 V CL

|

TZipMaster


Source files

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

<install dir>\

ZipMstr19.pas - main component source

ZipMstr19.res - components version resource

ZipVers19.inc - required defines for Delphi versions (only 4..10 supported)

ZMCenDir19.pas - exposes the zip file central directory to outside world

ZMCompat19.pas - support for earlier Delphi versions

ZMCore19.pas - basic support functions and event triggering

ZMCtx19.pas - Dialog box help context values

+ ZMDefMsgs19.pas - default message strings and tables

ZMDelZip19.pas - dll interface definitions

ZMDlg19.pas - dialog box support

ZMDllLoad19.pas - handles loading the dll

ZMDllOpr19.pas - performs tasks requiring the dll

ZMDrv19.pas - drive level support for zip files

ZMEOC19.pas - performs operations on the eoc

ZMExtrLZ7719.pas - extractor for LZ77 compressed streams

ZMHash19.pas - support for hashing directory entries for faster finds

ZMIRec19.pas - performs operations on central directory entries

ZMMatch19.pas - wild compares of file specs

+ ZMMsg19.pas - message values

ZMMsgStr19.pas - handles message string storage and language selection

ZMSFXInt19.pas - sfx stub interface

ZMStructs19.pas - definition of internal zip structures

ZMUTF819.pas - support for UTF8/16 conversions

ZMUtils19.pas - some functions to make life easier

ZMWAux19.pas - SFX and span support

ZMWorkFile19.pas - basic in/out for zip files

ZMWrkr19.pas - does the work

ZMWUtils19.pas - some WideString functions

ZMXcpt19.pas - EZipMaster definitions

ZMZipFile19.pas - performs operations on a zip file

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)

ZMSFXU19.exe - SFX loader stub (Unicode)

ZMSFX19.exe - SFX Loader stub (Ansi)

<install dir>\Delphi\

ZipMster19D?.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

ZipSFX.dcr - decoration

SortGridReg.pas - register function

SortGrid.dcr - decoration

<install dir>\DLL\

DelZip190.dll - required dll

DelZip190.lib - library file for static binding the dll (CBuilder)

<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).

The SFXStub with its required languages can also be included in the resources.

A compressed version of the dll may also be included in the resources so that it is always available.


Resources see also

Resource Format

ZipResMaker


Resource Format

TZipMaster

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.

ZipResMaker creates resource files compiling .rc files to .res files using BRCC32.

The possible .rc files that are created :

- ZMRES19_dll.rc for the dll resulting in ZMRes19_dll.res

- ZMRES19_str.rc for the selected languages resulting in ZMRes19_str.res

- ZMRES19_sfx.rc for the SFX stub resulting in ZMRes19_sfx.res

- ZMRES19_all.rc a combination of any of the above resulting in ZMRes19_all.res.

Content of the resource script file

Essentially the content of the .rc files is

ZMRES19_dll.rc :

DZResDLL RCDATA LOADONCALL MOVEABLE DISCARDABLE "DZ_Dll19.bin"

ZMRES19_str.rc:

DZResSTR RCDATA LOADONCALL MOVEABLE DISCARDABLE "DZ_STR19.bin"

ZMRES19_sfx.rc:

DZResSFX RCDATA LOADONCALL MOVEABLE DISCARDABLE "DZ_SFX19.bin"

ZMRES19_sfx.rc:

DZResSFX RCDATA LOADONCALL MOVEABLE DISCARDABLE "DZ_SFXU19.bin"

ZMRES19_All.rc:

Can be any combination of the above.

DZResDLL, DZResSTR, DZResSFX are the resource ID strings for DLL, Language strings and SFX.

DZ_Dll19.bin is the binary file created from the Dll.

DZ_STR19.bin is a binary file created from all selected language resource files ( ZipMsgxx.res files)

DZ_SFX19.bin is a binary file created from the SFX stub ( ZMSfx19.exe)

DZ_SFXU19.bin is a binary file created from the SFX stub ( ZMSfxU19.exe)

Format of DZ_Dll19.bin

The first 4 bytes of DZ_Dll19.bin are the version values of the DelZip190.dll

Example: first 4 bytes of DZ_Dll19.bin are 0x2B 0xFE 0x1C 0x00

Representing the version 1900075.

The rest of DZ_Dll19.bin is the normal delzip190.dll with or without compression.

For usage during debugging inside the IDE we recommend to compress the dll using LZ77 see the ZMCompLZ77 for compression and ZMExtrLZ77 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

In ZipResMaker this can be indicated by checking/unchecking the "Compress with UPX" option

Format of DZ_STR19.bin

The binary file consists of blocks for all selected languages:

Each language is in the file as a single bloc.

The format for each languages is

Language ID 1 word the language code as indicated in the ZipMsgxx.rc file

Compressed size 1 word

Size of the name 1 word

Name variable length 1 byte per character

Size of data 1 word

Data variable length

The data part is the ZipMsgxx.res file compressed with the LZ77 compress method.

Format of DZ_SFX19.bin and DZ_SFXU19.bin

The first 4 bytes of DZ_SFX19.bin and DZ_SFXU19.bin are the version values of the selected ZMSFX19.exe

Example: first 4 bytes of ZMSFXU.bin are 0x04 0xFE 0x1C 0x00

Representing the version 1900036.

The rest of DZ_SFX19.bin and DZ_SFXU19.bin are the normal ZMSFX19.exe with or without compression including the selected languages.

For usage during debugging of the SFX stub we recommend not to compress the stub.

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

In ZipResMaker this can be indicated by checking/unchecking the "Compress with UPX" option

The selected languages will be included in the ZMSFX19.exe as resources.

First the language strings are read from the SFXstr_xx.txt files into a table, that table is compressed using the

TZipMaster component and the AddStreamToStream method.

The compressed table is then added to the stub as a resource using the UpdateResource API with arguments

UpdateResource(hUpdateRes, // update resource handle

RT_RCDATA, // change resource

PChar(id), // resource name

MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), // neutral language

ts.Memory, // ptr to resource info

ts.Size)) // size of resource info.

Were id is a sequence number starting with 129 for the first language, 130 for the second and so on.

We use MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) because the SFXStub will find the real language indicator in the

lanugage strings and use that information (Lang_ID is the first info in the table).


UPX

The Ultimate Packer for eXecutables

Copyright (c) 1996-2002 Markus Oberhumer & Laszlo Molnar <http://upx.sourceforge.net/%!EF("http://upx.sourceforge.net",`',1>)

<h t t p://u p x.s o u r c e f o r g e.n e t/%!E F("h t t p://u p x.s o u r c e f o r g e.n e t",`',1><h t t p://u p x.s o u r c e f o r g e.n e t/%!E F("h t t p://u p x.s o u r c e f o r g e.n e t",`',1><h t t p://u p x.s o u r c e f o r g e.n e t/%!E F("h t t p://u p x.s o u r c e f o r g e.n e t",`',1><h t t p://u p x.s o u r c e f o r g e.n e t/%!E F("h t t p://u p x.s o u r c e f o r g e.n e t",`',1> 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.

These defines are in ZipMaster19.pas (the main component file).

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 DelZip190.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.

// undefine to use ResourceStrings

{$Define USE_COMPRESSED_STRINGS}

// define to statically load dll at program startup

{.$DEFINE STATIC_LOAD_DELZIP_DLL}


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.


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_Load 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 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).


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


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


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.


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.


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.


Filespecs

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.


Errors and Messages

Value Identifier Default message

10096 DT_Language

'US: default';

10097 DT_Author

'R.Peters';

10098 DT_Desc

'Language Neutral';

General messages

10101 GE_FatalZip

'Fatal Error in DLL: abort exception';

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'#10'Password ignored';

10106 GE_Except

'Exception in Event handler ';

10109 GE_Inactive

'not Active';

10111 GE_TempZip

'Temporary zipfile: %s';

10112 GE_WasBusy

'Busy + %s';

10113 GE_EventEx

'Exception in Event ';

10124 GE_DLLCritical

'critical DLL Error %d';

10125 GE_Unknown

' Unknown error %d';

10126 GE_Skipped

'Skipped %s %d';

10127 GE_Copying

'Copying: %s';

10128 GE_Abort

'User Abort';

10130 GE_ExceptErr

'Error Exception: ';

10131 GE_NoSkipping

'Skipping not allowed';

10132 GE_FileChanged

'Zip file changed';

The zip file was altered between setting ZipFileName and processing the file.

Rename messages

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.

10154 PW_Caption

'Password';

10155 PW_MessageEnter

'Enter Password ';

10156 PW_MessageConfirm

'Confirm Password ';

ChangeFileDetails messages

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';

10184 CF_SFXCopyError

'Error while copying the SFX data';

10187 CF_NoDest

'No destination specified';

List problems

10201 LI_ReadZipError

'Seek error reading Zip archive!';

10202 LI_ErrorUnknown

'Unknown error in List() function';

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.

DialogBox buttons

10220 ZB_Yes

'&Yes';

10221 ZB_No

'&No';

10222 ZB_OK

'&OK';

10223 ZB_Cancel

'&Cancel';

10224 ZB_Abort

'&Abort';

10225 ZB_Retry

'&Retry';

10226 ZB_Ignore

'&Ignore';

10227 ZB_CancelAll

'CancelAll';

10228 ZB_NoToAll

'NoToAll';

10229 ZB_YesToAll

'YesToAll';

General errors

10301 AD_NothingToZip

'Error - no files to zip!';

10302 AD_UnattPassword

'Unattended action not possible without a password';

You tried to perform an unattended Add without giving a password first.

10304 AD_AutoSFXWrong

'Error %.1d occurred during Auto SFX creation.';

This error number is one of the errors as returned by the ConvertToSFX 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!';

10309 AD_BadFileName

'Invalid Filename';

10310 AD_InvalidEncode

'Invalid encoding options';

10320 AZ_NothingToDo

'Nothing to do';

10321 AZ_SameAsSource

'source and destination on same removable drive';

10322 AZ_InternalError

'Internal error';

Delete messages

10401 DL_NothingToDel

'Error - no files selected for deletion';

Extract messages

10502 EX_UnAttPassword

'Warning - Unattended Extract: possible not all files extracted';

10504 EX_NoExtrDir

'Extract directory ''%s'' must exist';

Loading Dll

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

10652 LD_DllLoaded

'Loaded %s';

The named DLL was found and loaded into memory

10653 LD_DllUnloaded

'Unloaded %s';

The named DLL was unloaded

10654 LD_LoadErr

'Error [%d %s] loading %s';

SFX preparation errors

10801 SF_StringTooLong

'Error: Combined SFX strings unreasonably long!';

The combined length of the properties SFXCaption , SFXDefaultDir , SFXCommandLine is too large.

10802 SF_NoZipSFXBin

'Error: SFX stub ''%s'' not found!';

The file binary stub was not found on the search path and thus can not be used to make a self extracting zip archive.

See also: SFXPath

10810 SF_DetachedHeaderTooBig

'Detached SFX Header too large';

The detached stub and header are too large to fit in the available space

10902 CZ_InputNotExe

'Error: input file is not an .EXE file';

ZipFileName does not specify a self extracting archive (with .EXE extension).

10906 CZ_BrowseError

'Error while browsing resources.';

10907 CZ_NoExeResource

'No resources found in executable.';

10908 CZ_ExeSections

'Error while reading executable sections.';

10909 CZ_NoExeIcon

'No icon resources found in executable.';

10910 CZ_NoIcon

'No icon found.';

10911 CZ_NoCopyIcon

'Cannot copy icon.';

10912 CZ_NoIconFound

'No matching icon found.';

General messages and errors

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';

11015 DS_CEHWrongSig

'A central header signature is wrong';

11017 DS_CENameLen

'Error while reading a central file name';

11020 DS_DataDesc

'Error while reading/writing a data descriptor area';

11022 DS_CECommentLen

'Error while reading a file comment';

11024 DS_ErrorUnknown

'UnKnown error in function ReadSpan(), WriteSpan(), ChangeFileDetails() or CopyZippedFiles()'#10;

11025 DS_NoUnattSpan

'Unattended disk spanning not implemented';

if you want disk spanning 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.

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';

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

''#10'in drive: %s';

11036 DS_NoValidZip

'This archive is not a valid Zip archive';

11039 DS_AskDeleteFile

'There is already a file %s'#10'Do you want to overwrite this file';

11040 DS_AskPrevFile

'ATTENTION: This is previous disk no %d!!!'#10'Are you sure you want to overwrite the contents';

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_NotChangeable

'Cannot write to %s';

11052 DS_Zip64FieldError

'Error reading Zip64 field';

11053 DS_Unsupported

'Unsupported zip version';

11054 DS_ReadError

'Error reading file';

11055 DS_WriteError

'Error writing file';

11056 DS_FileError

'File Error';

11057 DS_FileChanged

'File changed';

11058 DS_SFXBadRead

'Error reading SFX';

11059 DS_BadDrive

'cannot use drive';

11060 DS_LOHWrongName

'Local and Central names different : %s';

11061 DS_BadCRC

'CRC error';

11062 DS_NoEncrypt

'encryption not supported';

11063 DS_NoInStream

'No input stream';

11064 DS_NoOutStream

'No output stream';

11065 DS_SeekError

'File seek error';

11066 DS_DataCopy

'Error copying compressed data';

11067 DS_CopyError

'File copy error';

11068 DS_TooManyParts

'More than 999 parts in multi volume archive';

11101 FM_Erase

'Erase %s';

11102 FM_Confirm

'Confirm';

Change details

11307 CD_CEHDataSize

'The combined length of CEH + FileName + FileComment + ExtraData exceeds 65535';

11309 CD_DuplFileName

'Duplicate Filename: %s';

11310 CD_NoProtected

'Cannot change details of Encrypted file';

11312 CD_NoChangeDir

'Cannot change path';

Progress Messages

11401 PR_Archive

'*Resetting Archive bit';

11402 PR_CopyZipFile

'*Copying Zip File';

11403 PR_SFX

'*SFX';

11404 PR_Header

'*??';

11405 PR_Finish

'*Finalising';

11406 PR_Copying

'*Copying';

11407 PR_CentrlDir

'*Central Directory';

11408 PR_Checking

'*Checking';

11409 PR_Loading

'*Loading Directory';

11410 PR_Joining

'*Joining split zip file';

11411 PR_Splitting

'*Splitting zip file';

11412 PR_Writing

'*Writing zip file';

11413 PR_PreCalc

'*Precalculating CRC';

11450 DZ_Skipped

'Filespec ''%s'' skipped';

11451 DZ_InUse

'Cannot open in-use file ''%s''';

11452 DZ_Refused

'not permitted to open ''%s''';

11453 DZ_NoOpen

'Can not open ''%s''';

11454 DZ_NoFiles

'no files found';

11455 DZ_SizeChanged

'size of ''%s'' changed';

Trace messages

11600 TM_Erasing

'EraseFloppy - Removing %s';

11601 TM_Deleting

'EraseFloppy - Deleting %s';

11602 TM_GetNewDisk

'Trace : GetNewDisk Opening: %s';

11603 TM_SystemError

'System error: %d';

11604 TM_Trace

'Trace: ';

11605 TM_Verbose

'info: ';

Dll errors and messages

11648 DZ_RES_GOOD

'Good';

11649 DZ_RES_CANCELLED

'Cancelled';

11650 DZ_RES_ABORT

'Aborted by User!';

11651 DZ_RES_CALLBACK

'Callback exception';

11652 DZ_RES_MEMORY

'No memory';

11653 DZ_RES_STRUCT

'Invalid structure';

11654 DZ_RES_ERROR

'Fatal error';

11655 DZ_RES_PASSWORD_FAIL

'Password failed!';

11656 DZ_RES_PASSWORD_CANCEL

'Password cancelled!';

11657 DZ_RES_INVAL_ZIP

'Invalid zip structure!';

11658 DZ_RES_NO_CENTRAL

'No Central directory!';

11659 DZ_RES_ZIP_EOF

'Unexpected end of Zip file!';

11660 DZ_RES_ZIP_END

'Premature end of file!';

11661 DZ_RES_ZIP_NOOPEN

'Error opening Zip file!';

11662 DZ_RES_ZIP_MULTI

'Multi-part Zips not supported!';

11663 DZ_RES_NOT_FOUND

'File not found!';

11664 DZ_RES_LOGIC_ERROR

'Internal logic error!';

11665 DZ_RES_NOTHING_TO_DO

'Nothing to do!';

11666 DZ_RES_BAD_OPTIONS

'Bad Options specified!';

11667 DZ_RES_TEMP_FAILED

'Temporary file failure!';

11668 DZ_RES_NO_FILE_OPEN

'File not found or no permission!';

11669 DZ_RES_ERROR_READ

'Error reading file!';

11670 DZ_RES_ERROR_CREATE

'Error creating file!';

11671 DZ_RES_ERROR_WRITE

'Error writing file!';

11672 DZ_RES_ERROR_SEEK

'Error seeking in file!';

11673 DZ_RES_EMPTY_ZIP

'Missing or empty zip file!';

11674 DZ_RES_INVAL_NAME

'Invalid characters in filename!';

11675 DZ_RES_GENERAL

'Error ';

11676 DZ_RES_MISS

'Nothing found';

11677 DZ_RES_WARNING

'Warning: ';

11678 DZ_ERR_ERROR_DELETE

'Delete failed';

11679 DZ_ERR_FATAL_IMPORT

'Fatal Error - could not import symbol!';

11680 DZ_ERR_SKIPPING

'Skipping: ';

11681 DZ_ERR_LOCKED

'File locked';

11682 DZ_ERR_DENIED

'Access denied';

11683 DZ_ERR_DUPNAME

'Duplicate internal name';


Working with SFX

Resource Format Example

Before doing any of the following operations on a SFX -

  • Add
  • AddZippedFiles
  • ChangeFileDetails
  • ConvertToSFX
  • ConvertToSpanSFX
  • CopyZippedFiles
  • Delete
  • Rename

The following properties need to be valid -

  • SFXCaption
  • SFXCommandLine
  • SFXDefaultDir
  • SFXIcon
  • SFXMessage
  • SFXOptions
  • SFXOverwriteMode
  • SFXPath
  • SFXRegFailPath


Working with SFX - Example

{$R 'Res\ZMRes19_sfx.res'} // link the stub to our application

zip.ZipFileName := 'Example.EXE'; // file to work on

if zip.ErrCode <> 0 then

Handle_the_error!

zip.FSpecArgs := '*.pas';

zip.SFXCaption := 'Sample SFX';

zip.SFXCommandLine := ''; // no post-extract operation

zip.SFXDefaultDir := 'c:\temp'; // a default destination

zip.SFXIcon := nil; // use default

zip.SFXMessage := 'This is an example'; // a MessageBox before the main dialog

zip.SFXOptions := [soCanBeCancelled]; // allow cancelling extraction

zip.SFXOverwriteMode := ovrConfrim; // ask before overwriting

zip.SFXPath := '><'; // use the stub in the Resources

zip.SFXRegFailPath := ''; // not using registry paths

err := zip.Add; // do the operation

if err <> 0 then

Handle_the_error!

Notes:

1. if the file exists before setting ZipFileName and the SFX properties can be read the SFX?? properties will be loaded from that file.

2. setting any SFX?? property before setting ZipFileName will stop the old properties from being used.

3. unless the stub is linked in the applications resources, SFXPath must be set to a valid stub.


ZipResMaker

TZipMaster See also: Resources

Description

Used to prepare the resources for binding to executable

<install dir>\TOOLS\ZipResMaker\ZipResMaker.exe


ZipMstr19 unit

Main unit

Components

TZipMaster

Classes

TZMProgressDetails

TZMDirEntry

TZMDirRec

TZipMasterEnumerator

TZMPipe

TZMPipeList

Types

PZMRenameRec

PZMSStats

TSFXOpt

TSFXOpts

TZMChangeFunction

TZMForEachFunction

TZMRenameRec

TZMAddOpts

TZMAddOptsEnum

TZMAddStoreExts

TZMAddStoreSuffixEnum

TZMCheckTerminateEvent

TZMCopyZippedOverwriteEvent

TZMCRC32ErrorEvent

TZMDeleteOpts

TZMDialogEvent

TZMDiskAction

TZMEncodingOpts

TZMExtractOverwriteEvent

TZMExtrOpts

TZMExtrOptsEnum

TZMFileCommentEvent

TZMFileExtraEvent

TZMGetNextDiskEvent

TZMMergeOpts

TZMMessageEvent

TZMNewNameEvent

TZMOvrOpts

TZMPasswordErrorEvent

TZMProgressDetailsEvent

TZMProgressType

TZMRenameOpts

TZMReplaceOpts

TZMSetAddNameEvent

TZMSetCompLevel

TZMSetExtNameEvent

TZMSkippedEvent

TZMSkipAborts

TZMSkipTypes

TZMSpanOpts

TZMSpanOptsEnum

TZMStateChange

TZMStates

TZMStatusDiskEvent

TZMStreamEvent

TZMStrEvent

TZMString

TZMTickEvent

TZMWideString

TZMWriteOpts

TZMWriteOptsEnum

TZMZipDiskStatus

TZMZipDiskStatusEnum

TZMSStats

TZMStreamOp

Constants

DELZIPVERSION

ZIPBUILDERBUILD = "1.9.0.xxxx"; xxxx = build number

ZIPBUILDERDATE = "d/m/yyyy"; d/m/yyyy = day/moth/year of last build

ZIPBUILDERPRIV = 190xxxx; xxxx = build number

ZMDefAddStoreSuffixes

ZMReentry_Error

ZMPWLEN

zsbDirOnly

zsbDirty

zsbError

zsbIgnore

zsbInvalid

zsbSelected

zsbSkipped


Contact information

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

Join the mailing list: http://www.freelists.org/list/delphizip

or

  problems@delphizip.org   (include ZipMaster in the subject)