Class TZipMaster (unit ZipMstr)

Inherits from

TComponent

Constructors


constructor Create(AOwner : TComponent);

Remove possible trailing CR or LF


Functions

procedure Add;

Public Methods } { NOTE: Test is an sub-option of extract

function ConvertSFX:Integer;

Convert an .

function ConvertZIP:Integer;

Convert an .

function CopyFile(const InFileNAme, OutFileName: String):Integer;

returns 0 if good copy, or a negative error code

procedure Delete;

Update the Zip Directory by calling List method

destructor Destroy;

dflt to tightest compression

procedure Extract;

Update the Zip Directory by calling List method

procedure GetAddPassword;

end with

procedure GetExtrPassword;

Same as GetAddPassword, but does NOT verify

procedure List;

The Delphi code used in the List method is based on the TZReader VCL by Dennis Passmore (Compuserve: 71640,2464).

procedure Load_Unz_Dll;

reset

procedure Load_Zip_Dll;

explicitly invoke the List method

procedure Unload_Unz_Dll;


procedure Unload_Zip_Dll;

reset

procedure FreeZipDirEntryRecords;

Private "helper" functions

Empty FZipContents and free the storage used for dir entries


function GetCount: Integer;

Property get/set functions

shorten the dirname by one


function GetUnzVers: Integer;

load failed - error msg was shown to user

function GetZipVers: Integer;


procedure SetDLLDirectory(Value: String);

NOTE: we will allow a dir to be specified that doesn't exist, since this is not the only way to locate the DLLs.

procedure SetFilename(Value: String);


procedure SetFSpecArgs(Value : TStrings);

We'll normally have a TStringList value, since TStrings itself is an abstract class.

procedure SetUnZipSwitches;

end with

procedure SetZipSwitches;

end of try.

Properties

property AddCompLevel : Integer


property AddOptions : AddOpts


property DLLDirectory : String


property ExtrBaseDir : String


property ExtrOptions : ExtrOpts


property FSpecArgs : TStrings


property Password : ShortString


property SFXCaption : String


property SFXCommandLine : String


property SFXDefaultDir : String


property SFXOptions : SfxOpts


property SFXOverWriteMode : OvrOpts


property SFXPath : String


property Trace : Boolean


property Verbose : Boolean

Public properties that also show on Object Inspector

property ZipFilename : String

At runtime: every time the filename is assigned a value, the ZipDir will automatically be read.

property Cancel : Boolean


property Count : Integer


property ErrCode : Integer


property Handle : Integer

Public Properties (run-time only)

property Message : String


property SuccessCnt : Integer


property UnzBusy : Boolean


property UnzVers : Integer


property ZipBusy : Boolean


property ZipContents : TList


property ZipVers : Integer


Events

event OnDirUpdate : TNotifyEvent

Events

event OnMessage : TMessageEvent


event OnProgress : TProgressEvent


Variables

FAddCompLevel : Integer;


FAddOptions : AddOpts;


FCancel : Boolean;


FDLLDirectory : String;


FEncrypt : Boolean;


FErrCode : Integer;


FExtrBaseDir : String;


FExtrOptions : ExtrOpts;


FFSpecArgs : TStrings;


FHandle : Integer;

Private versions of property variables

FMessage : String;


FOnDirUpdate : TNotifyEvent;

declare an instance of UnZipParms } { Event variables

FOnMessage : TMessageEvent;


FOnProgress : TProgressEvent;


FPassword : ShortString;


FSFXCaption : String;

ovrConfirm (others: ovrAlways, ovrNever

FSFXCommandLine : String;

dflt=''

FSFXDefaultDir : String;

dflt='Self-extracting Archive'

FSFXOffset : LongInt;


FSFXOptions : SFXOpts;


FSFXOverWriteMode : OvrOpts;


FSFXPath : String;


FSuccessCnt : Integer;


FTrace : Boolean;


FUnzBusy : Boolean;


FVerbose : Boolean;


FZipBusy : Boolean;


FZipContents : TList;


FZipFilename : String;


UnZipParms1 : UnZipParms;

declare an instance of ZipParms

ZipParms1 : ZipParms;

dflt='' { misc private vars


Constructors


constructor Create(AOwner : TComponent);

Remove possible trailing CR or LF


Functions


procedure Add;

Public Methods } { NOTE: Test is an sub-option of extract


function ConvertSFX:Integer;

Convert an .ZIP archive to a .EXE archive. } { returns 0 if good, or else a negative error code


function ConvertZIP:Integer;

Convert an .EXE archive to a .ZIP archive. } { returns 0 if good, or else a negative error code


function CopyFile(const InFileNAme, OutFileName: String):Integer;

returns 0 if good copy, or a negative error code


procedure Delete;

Update the Zip Directory by calling List method


destructor Destroy;

dflt to tightest compression


procedure Extract;

Update the Zip Directory by calling List method


procedure GetAddPassword;

end with


procedure GetExtrPassword;

Same as GetAddPassword, but does NOT verify


procedure List;

The Delphi code used in the List method is based on the TZReader VCL by Dennis Passmore (Compuserve: 71640,2464). This "list" code is also used in the ZIPDIR VCL used by Demo3. TZReader was inspired by Pier Carlo Chiodi pc.chiodi@mbox.thunder.it } { This version fixes an odd bug reported by Markus Stephany. Zip self-extracting archives created by WinZip can have their first local signature on any byte - we normally expect it to be aligned to 32 bits. This fix makes it a little slower to read the dir of self- extracting archives, but at least it will work right in every case now! } { The List method reads thru all entries in the local Zip directory. This is triggered by an assignment to the ZipFilename, or by calling this method directly.


procedure Load_Unz_Dll;

reset


procedure Load_Zip_Dll;

explicitly invoke the List method


procedure Unload_Unz_Dll;


procedure Unload_Zip_Dll;

reset


procedure FreeZipDirEntryRecords;

Private "helper" functions

Empty FZipContents and free the storage used for dir entries


function GetCount: Integer;

Property get/set functions

shorten the dirname by one


function GetUnzVers: Integer;

load failed - error msg was shown to user


function GetZipVers: Integer;


procedure SetDLLDirectory(Value: String);

NOTE: we will allow a dir to be specified that doesn't exist, since this is not the only way to locate the DLLs.


procedure SetFilename(Value: String);


procedure SetFSpecArgs(Value : TStrings);

We'll normally have a TStringList value, since TStrings itself is an abstract class.


procedure SetUnZipSwitches;

end with


procedure SetZipSwitches;

end of try...finally


Properties


property AddCompLevel : Integer


property AddOptions : AddOpts


property DLLDirectory : String


property ExtrBaseDir : String


property ExtrOptions : ExtrOpts


property FSpecArgs : TStrings


property Password : ShortString


property SFXCaption : String


property SFXCommandLine : String


property SFXDefaultDir : String


property SFXOptions : SfxOpts


property SFXOverWriteMode : OvrOpts


property SFXPath : String


property Trace : Boolean


property Verbose : Boolean

Public properties that also show on Object Inspector


property ZipFilename : String

At runtime: every time the filename is assigned a value, the ZipDir will automatically be read.


property Cancel : Boolean


property Count : Integer


property ErrCode : Integer


property Handle : Integer

Public Properties (run-time only)


property Message : String


property SuccessCnt : Integer


property UnzBusy : Boolean


property UnzVers : Integer


property ZipBusy : Boolean


property ZipContents : TList


property ZipVers : Integer


Events


event OnDirUpdate : TNotifyEvent

Events


event OnMessage : TMessageEvent


event OnProgress : TProgressEvent


Variables


FAddCompLevel : Integer;


FAddOptions : AddOpts;


FCancel : Boolean;


FDLLDirectory : String;


FEncrypt : Boolean;


FErrCode : Integer;


FExtrBaseDir : String;


FExtrOptions : ExtrOpts;


FFSpecArgs : TStrings;


FHandle : Integer;

Private versions of property variables


FMessage : String;


FOnDirUpdate : TNotifyEvent;

declare an instance of UnZipParms } { Event variables


FOnMessage : TMessageEvent;


FOnProgress : TProgressEvent;


FPassword : ShortString;


FSFXCaption : String;

ovrConfirm (others: ovrAlways, ovrNever


FSFXCommandLine : String;

dflt=''


FSFXDefaultDir : String;

dflt='Self-extracting Archive'


FSFXOffset : LongInt;


FSFXOptions : SFXOpts;


FSFXOverWriteMode : OvrOpts;


FSFXPath : String;


FSuccessCnt : Integer;


FTrace : Boolean;


FUnzBusy : Boolean;


FVerbose : Boolean;


FZipBusy : Boolean;


FZipContents : TList;


FZipFilename : String;


UnZipParms1 : UnZipParms;

declare an instance of ZipParms


ZipParms1 : ZipParms;

dflt='' { misc private vars