Installation instructions for DZSFX:
------------------------------------

Preliminary remarks:
=====================
1) The contents of this zip archive should go into a base directory of \ZipBeta\NewSFX.

2) You need to copy the redistributable modules to the desired
   directory on your development computer if you want to use the TZipMasterSFX comp.
   E.g.: copy \ZipBeta\NewSFX\SFX\DZSFX*.BIN to your Windows System directory.

3) Since I normally use the latest Delphi release, sometimes new properties
   of Delphi's VCLs will get saved with DFM files.  Please tell it to
   "Ignore" any "Property not found" type of error you may see.

4) If you are using a version of Delphi Zip older than 1.70 (e.g. one of the 1.60 versions),
   you have to undefine the conditional switch {$DEFINE ZM170UP} in vcl\sfxver.inc

Installation
=============
1) You MUST install this package on a computer that has Delphi (either
   version 2, 4, 5 or 6).

2) The VCLs included with this release are:
   TZipMasterSFX - a TZipMaster addin for managing the new SFX
   TZipSFX - a standalone component for creating new style sfx archives

   The files required to support these VCLs are located in the
   VCL subdirectory.  You have two choices for how to proceed
   (option A is recommended):

   A) add the directory C:\ZipBeta\NewSFX\VCL to your VCL search path.
                             or
   B) copy the files in C:\ZipBeta\NewSFX\VCL to another
         directory already in your VCL search path.

   If you want to use option A, the instructions for this are
   included below.  If you want option B, then please copy those
   files now.

3) Install the VCLs

   This procedure will install the VCLs into the IDE.  After
   this, you will be able to see them on the "Delphi Zip" tab.

   Delphi 2:
      a) Close any Files or Projects that are open.
      b) Select the "Component...Install" choice.
      c) If you want to add C:\ZipBeta\NewSFX\VCL to the library search
         path, you may do it now using the second edit box.

      d) Click on the Add button.
      e) Enter the path and filename of where the ZIPMSTRSFX.PAS
         file is located, or find it now with Browse.

      f) Click on the Add button.
      g) Enter the path and filename of where the ZIPSFX.PAS
         file is located, or find it now with Browse.

      h) Click on OK.  The component library will rebuilt.

   Delphi 3:
      These instructions assume you will place the VCLs into
      the standard user package "DCLUSR30.DPK".  Advanced
      developers may want to use a different package, or to
      make a new package.  Packages can be confusing, so I will
      only document the simplest case, of putting them into
      "DCLUSR30.DPK", which will work fine for most developers.

      a) Close any Files or Projects that are open.
      b) Select the "Component, Install Component" choice. Make
         sure the "Into existing package" tab is selected.
      c) Check to see if package: "DCLUSR30.DPK" is already
         selected.  If not, you should now locate "dclusr30.dpk".
      d) Add the C:\ZipBeta\NewSFX\VCL directories to the
         search path box (unless you copied the files to a path
         already in the search path).

      e) In the Unit name block, enter ZIPMSTRSFX.PAS. Click OK.
      f) It will ask if you want to rebuild the Component Library.
         ANSWER NO (saves time to do it only 1 time later).

      g) Click on Add.
      h) In the Unit name block, enter ZIPSFX.PAS. Click OK.

      i) Click on "Compile" to rebuild the Component Library.
         If it does not automatically install the new VCLs to the
         component palette, then click on the "install" button of
         the package option dialog box.

      j) When done, close the package option dialog box by
         clicking on it's upper right corner.  Say "Yes" to
         keep the changes.

   Delphi 4, 5, and 6:
      Here's some new instructions that will install into a new package.

      1) Menu | Component | Install Component...
        a) Tab->Into New package
        b)   Package file name:   ZipMasterSFX
        c)   Package description: New SFX for delzip package
        d)   Unit Filename:  Choose Browse and select ZIPMSTRSFX.PAS
                             from the directory where you put it in.
        e)   Click Ok

        ( Message "ZipMasterSFX.bpl will be built then installed", Continue )

      2) Click No

      3) Menu |Comoponent | Install Component...
        a) Tab->Into Existing package
        b)   Unit Filename:  Choose Browse and select ZIPSFX.PAS
                             from the directory where you put it in.
        c)   Click Ok

        ( Message "ZipMasterSFX.bpl will be built then installed", Continue )

      4) Click Yes

After the compilation a message should popup that TZipMasterSFX and TZipSFX
have been installed (probably on the "Delphi Zip" palette) and registered.


history of DZSFX:
-----------------

apr 21, 2003:
=============

  - korean translation by Yun Bok Soo.
    now NINE different languages are supported: catalan, danish, dutch,
    english, french, german, italian, korean and spanish.
    thanks to all contributors!

mar 23, 2003:
=============

  - modifed the ExecInf function (it seems not to be necessary to distinguish
    between win32 and winnt operating systems). thanks to Roger Aelbrecht!

  - modifed the string handling, so strings are not longer loaded from
    resource, they are now in unit SFXStrings.pas. this saves ~2 kibyte.
    SFXStrings.pas includes the SFXStrings_<lang id>.inc to use localized
    strings.

jan 12, 2003:
=============

  - danish translation by Carsten S. Rasmussen.
    now EIGHT different languages are supported: catalan, danish, dutch,
    english, french, german, italian and spanish. thanks to all contributors!

nov 23, 2002:
=============

  - french translation by Nicolas Mastin.
  - changed the inflate_fixed routines (it probably is still somewhat
    buggy, but seems to work). thanks to James Turner!

oct 23, 2002:
=============

  - included a dutch translation. thanks to Roger Aelbrecht!

oct 11, 2002:
=============

  - included a modified catalan translation contributed by Jordi March i Nogué

  - changed the sfx initialization to calculate header signatures at run time
    to avoid signatures in the sfx code itself (the zipdll.dll doesn't like them).
    thanks to Roger Aelbrecht!

sep 26, 2002:
=============

  - catalan language files added. many thanks to Eduard Llach!
    now five different languages are supported: english, german, italian,
    spanish and catalan. thanks to all contributors!

  - the TZipSFX's SFXLanguage property does now also understand the native
    language names if these sfx stubs are compiled into your app in resource
    form (e.g. if DZSFXIT.RES is compiled into the program, you may set the
    SFXLanguage property to 'italiano', see demo2 for an example)

sep 18, 2002:
=============

  - added the language template files (sfx??.txt) in the \lang sub dir.

  - spanish language files added. many thanks to Jorge Almaraz!
    now four different languages are supported: english, german, italian (by
    Matteo Riso) and spanish (by Jorge Almaraz). thanks to all contributors!

    !!! contributors who are willing to translate the sfx into another language
    !!! are very welcome!!!

    translate the \lang\SFXUS.TXT file into your language, save it under a different
    name (containing the short id of your language) and send it to me. please also
    translate the text "<your language> translation by <your name>" (replacing the
    <placeholders> by your language and name), so i can credit you in the localized
    sfx's about box.

sep 07, 2002:
==============

  - added some more icons (in SFXSource\Icons) contributed by Jose ?, many thanks!

  - the compiled SFX stubs now contain a info string containing language and release date

  - better runtime language support in TZipSFX:
    - you can compile all available sfx language stubs at once ($R DZSFX_ALL.RES) into your app
    - retrieve a list of available languages using the TZipSFX.GetSupportedSFXLanguages class
      function (returns a string containing the short language id's as a CR/LF-separated list)
    - retrieve the original language when reading TZIpSFX's properties from a compiled sfx archive
    - set each TZipSFX instance's language at runtime (SFXLanguage property)

sep 06, 2002:
==============

  - the sfx dialogs now support WinXP themes (by compiling in the manifest resource
    SFXSource\manifest.res), thanks to Matteo Riso!

sep 05, 2002:
==============

  - changed the localization procedure: to add another language, modify the strings
    in lang\sfxus.txt, save the changes to a new text file (replace the us by your
    abbreviated language name) and send it to me. in the next release, it will be included
    (you may also edit the BUILDLANG declaration in sfxsource\MAKEFILE manually and issue
    a "make allsfx" command to built also the new language sfx)

  - added mutiple languages support to TZipMstrSFX and TZipSFX by setting the variable
    DZSFX_LANG to one of the supported languages (currently 'US', 'DE' or 'IT') at runtime
    (to use the sfx-from-resource feature of TZipSFX, you will also have to link all the
    dzsfx??.res files in the vcl dir whose language you want to support to your application
    by adding a {$R dzsfxXX.res} command)

  - TZipSFX, TZipMstrSFX now work with Delphi Zip v 1.70. To use with Delphi Zip 1.60,
    comment/remove the line {$DEFINE ZM170UP} in vcl\sfxver.inc

  - modifed the sfx stub's gui (e.g. to better support localization)

  - the sfx now understands the special extractdir <VOLATILE>, this one will expand
    to a unique dir under the temp path at runtime. if files have been extracted
    to this dir AND a command line has been executed, this directory will be recursively
    deleted after next boot (by storing a command.com/cmd.exe line in the
    HKLM\...\RunOnce reg key)

jun 29, 2002:
==============

  - now the sfx stub, TZipSFX and TZipMstrSFX also work under delphi 2

may 13, 2002:
==============

  - now the sfx tries to make correct oem->ansi filename conversion

  - uses an include unit (vcl\ZipStructs.pas), where the
    structures used in zip archives are defined

  - on extraction failure, the first selected item will be shown
    in the list for better visual feedback

  - starting autorun extraction is now timer driven, so the dialog should always
    become visible

  - added support for environment variable %TICKS%, so (rather) unique pathes
    can be created

  - added a component TZipSFX including help file and demo

may 08, 2002:
==============

  - ParamStr(0) replaced by GetModuleFileName (needs less code)

  - if extraction failed and overwritebox is hidden, then
    overwrite mode is reset to ask

may 07, 2002:
==============

  - changed makefile to automatically create a distribution archive

  - added a commandline sfx tool in the sfxsource\tools subdir (mainly
    for automatic creation of distribution archive)

  - removed an unnecessary Sleep(100) call in SFXProcs.pas, ExtractFile

  - added LocalHeader.ExtraFieldLen to offset to calculate the correct
    file position in SFXProcs.pas, ExtractFile

may 06, 2002:
==============

    first public release of the new sfx


Credits to:
-----------

  - Eric W. Engler (englere[at]abraxis[dot]com)
  - Thomas Hoelzer (thoelzer[at]cityweb[dot]de)
  - Deepu Chandy Thomas (deepuct[at]hotmail[dot]com)
  - Todd Fast (tfast[at]eden[dot]com)
  - Didier Havelange (Didier.Havelange[at]ping[dot]be)
  - Frank Reichert (F.Rei[at]gmx[dot]de)
  - Angus Johnson (ajohnson[at]rpi.net[dot]au)
  - Didier Havelange (Didier.Havelange[at]ping[dot]be)
  - Matteo Riso (matteo[at]zipgenius[dot]it)
  - James Turner (james.d.h.turner[at]ntlworld[dot]com)
  - Jorge Almaraz (jalmmor[at]terra[dot]es)
  - Eduard Llach (eduard[at]infomed[dot]es)
  - Jordi March i Nogué (march_ribot[at]teleline[dot]es)
  - Roger Aelbrecht (Roger.Aelbrecht[at]wanadoo[dot]be)
  - Nicolas Mastin (nmastin[at]free[dot]fr)
  - Carsten S. Rasmussen (crasmussen[at]mail.tele[dot]dk)
  - Yun Bok Soo (woodcom[at]kebi[dot]com)

and many others...


Notes about DZSFX:
------------------

Chapter one: Missing error messages
============

    Every project using Delphi Zip and Delphi Zip SFX components must specify which
    language to use for error messages. For English users, include this in
    your .DPR files:

    {$R ZipMsgUS.res}

Chapter two: Reducing the file size of the sfx executable
============

    1) Compile it using an older Delphi version. The higher Delphi's version, the more
           overhead is produced on compiling/linking the executable.

       * This may not apply to Delphi 6, at least it produces a smaller executable than
           Delphi 4.

    2) Use a smaller 3rd part run time library, e.g. the system unit replacement of KOL
           (http://bonanzas.rinet.ru/, Downloads, System units replacement, available only
           for Delphi 5 and 6), this rtl saves about 10 kibyte.

    3) Use Jordan Russell's stripreloc (http://www.jrsoftware.org/striprlc.php), it strips
       the unnecessary (for .EXE files!) .reloc resource section from the executable,
       this saves about 1,5 kibyte.

    4) Use a Resource Editor like Angus Johnson's Resource Hacker
       (http://www.rpi.net.au/~ajohnson/resourcehacker/) to remove Delphi's "special"
       resources (esp. PackageInfo and DVCLAL), but there may be legal issues on removing
       them!

    5) Use a executable compresser (like UPX, http://upx.sourceforge.net) to shrink the
       sfx even more (but then there may be some problems with certain virus scanners)

Chapter three: Getting rid of the dzsfx*.bin files
==============

    TZipSFX does not need the sfx stub DZSFX*.BIN somewhere on your hard
        disk if you link the resources vcl\dzsfx*.res via
    {$R DZSFX[CAT|DE|DK|ES|FR|IT|NL|US].RES} to your project.
    Each of those .res files contains a localized version of the sfx exe stub
    (dzsfxDE.res e.g. contains the german sfx stub, dzsfxIT.res the italian one and so
    on). To use different localized sfx versions at runtime, link the resources for all
      languages you want to support to your application {$R DZSFX...} and set the global
    variable DZSFX_LANG to one of the supported languages ('US','IT'...) before creating
    an sfx.


Problem Reports or Suggestions regarding DZSFX:
-----------------------------------------------

We DO want to hear your ideas!  If you find a problem with
any part of this project, or if you just have an idea for
us to consider, send us e-mail!

But, please make sure that your bug has not already been
reported.  Check the delzip sfx web site often:

http://delphizip.mirkes.de

Official Delphi Zip website:
http://www.geocities.com/SiliconValley/Network/2114/zipbeta.html


Demos which come with the DZSFX package:
----------------------------------------

Demo 1
=======
From the Delphi IDE, open the project C:\ZipBeta\NewSFX\Demos\TZipMasterSFX\SFXDemo1.DPR.

Examine the forms and decide if you need to resize any of the controls, or change
the  position of anything. This is sometimes necessary if I developed the forms at
a different screen resolution than you are using.

The demo1 program is a derivative from delphi zip's demo1, it shows how to use a
TZipMasterSFX component as an addin to a TZipMaster to handle the new sfx format.

Demo 2
=======
From the Delphi IDE, open the project C:\ZipBeta\NewSFX\Demos\TZipSFX\SFXDemo2.DPR.

Examine the forms and decide if you need to resize any of the controls, or change
the position of anything. This is sometimes necessary if I developed the forms at
a different screen resolution than you are using.

This demo shows you how to use the TZipSFX component to convert zip archives in
SFX exe archives and back.


Different language support in DZSFX:
------------------------------------

Language support:
==================
Currently, the sfx supports the following languages:
- Catalan ('CAT') (thanks to Eduard Llach and Jordi March i Nogué)
- Danish ('DK') (thanks to Carsten S. Rasmussen)
- Dutch ('NL') (thanks to Roger Aelbrecht)
- French ('FR') (thanks to Nicolas Mastin)
- German ('DE')
- Italian ('IT') (thanks to Matteo Riso)
- Korean ('KO') (thanks to Yun Bok Soo)
- Spanish ('ES') (thanks to Jorge Almaraz)
- US English ('US')

Each of these sfx bins are stored in a different .bin and .res file:
CAT: sfx\dzsfxcat.bin, vcl\dzsfxcat.res
DE:  sfx\dzsfxde.bin,  vcl\dzsfxde.res
DK:  sfx\dzsfxdk.bin,  vcl\dzsfxdk.res
ES:  sfx\dzsfxes.bin,  vcl\dzsfxes.res
FR:  sfx\dzsfxfr.bin,  vcl\dzsfxfr.res
IT:  sfx\dzsfxit.bin,  vcl\dzsfxit.res
KO:  sfx\dzsfxko.bin,  vcl\dzsfxko.res
NL:  sfx\dzsfxnl.bin,  vcl\dzsfxnl.res
US:  sfx\dzsfxus.bin,  vcl\dzsfxus.res

If you use the TZipMasterSFX component:
----------------------------------------
All of the .bin files that should be supporteded must be placed in a path available to your
application (e.g. the system directory).

You may change the language of generated sfx at runtime by setting the DZSFX_LANG global variable
to one of the supported languages ('CAT', 'DE', 'DK', 'ES', 'FR', 'IT', 'KO', 'NL', 'US')
before creating a new sfx.

If you use the TZipSFX component:
----------------------------------
All of the DZSFX##.RES files that should be supported by your application should be compiled into
your app.

Example: If you want to support US-English and Italian language sfx, you would add the
following lines to your .dpr file:
{$R DZSFXUS.RES}
{$R DZSFXIT.RES}

If you want to support all available languages, just add the following line to your .dpr file:
{$R DZSFX_ALL.RES}

You can get a list of all available (compiled-in) SFX languages by using the class function
TZipSFX.GetSupportedSFXLanguages. It will return a string containig a list of supported
languages (as a CRLF-separated string).

To change the language of generated SFX's at runtime, set the TZipSFX.SFXLanguage property to
one of the supported language short ids ('US', 'IT'...) before creating a SFX.

Adding a new language:
=======================
To add another language, take one of the files in the \lang directory (probably the SFXUS.TXT
file), translate the messages (texts after the equal sign) and save the translated file under
a different name (replace the language id ('US') by the id of your language).

Then

either

send me the new translation (delphizip@mirkes.de) and i will include the new sfx##.txt,
dzsfx##.bin, SFXStrings_##.inc and dzsfx##.res in the next release

or

create the new sfx##.bin/.res by using the makefile in \sfxsource:
1) open a command shell
2) cd to the <dzsfx>\sfxsource directory
3) issue "make -DLANG=<your new language id> ..\vcl\dzsfx<your new language id>.res"
4) change the $I directive in SFXStrings.pas to include the newly generated
   SFXStrings_<your new language id>.inc


Legend

Private | Private
Protected | Protected
Public | Public
Published | Published
Generated by DIPasDoc 0.8.0 on Thu 24 Apr 2003 18:46:06


All Units

Name | Description
ZipMstrSFX TZipMasterSFX (C) 2002

written by markus stephany, http://delphizip.mirkes.de, mailto:merkes@mirkes.de

last changed: 04/24/2002

this component is part of the Delphi Zip VCL by Chris Vleghert and Eric W. Engler www: http://www.geocities.com/SiliconValley/Network/2114/zipbeta.html

this component is some kind of "snap-in" for TZipMaster to support the new sfx.

it tries to be compatible (as much as possible) with TZipMaster's sfx handling, so some of the new sfx features are not available in TZipMasterSFX.

To use all features of the new sfx, use the (not yet available ;-)) TZipSfx component instead (http://delphizip.mirkes.de), but that one works quite different.

differences between TZipMasterSFX and TZipMaster's sfx handling:

- it uses a different sfx stub 'dzsfx[lang].bin' (not ZIPsfx.bin), this one should be placed in the same directory where the old zipsfx.bin is (or set its own SFXPath property properly).

- it uses an associated TZipMaster component to get the SFX... properties (and also for ShowZipMessage and things like this)

- to convert a TZipMaster's zip to an exe, set all properties in the associated TZipMaster component and then call TZipMasterSFX.ConvertToExe rather than TZipMaster.ConvertEXE, if conversion was successfull, the TZipMaster will automatically use the converted SFX as its ZipFileName (no special action must be taken).

- to convert a TZipmaster's sfx-zip to an ordinary zipfile, call TZipMasterSFX.ConvertToZip instead of TZipMaster.ConvertZip.

- to create a new sfx-zip, you should do something like this (this one's not yet tested):

1) set the sfx's properties in the ZipMaster component.

2) call ZipMasterSFX1.CreateNewSFX(FileName).

3) if creation was successfull, the associated ZipMaster should automatically

use the newly created SFX as its ZipFile(Name).
ZipSFX | this unit contains the TZipSFX component which is used to create and convert self extracting zip archives


ZipMstrSFX

Unit ZipMstrSFX

Description

TZipMasterSFX (C) 2002

written by markus stephany, http://delphizip.mirkes.de, mailto:merkes@mirkes.de

last changed: 04/24/2002

this component is part of the Delphi Zip VCL by Chris Vleghert and Eric W. Engler www: http://www.geocities.com/SiliconValley/Network/2114/zipbeta.html

this component is some kind of "snap-in" for TZipMaster to support the new sfx.

it tries to be compatible (as much as possible) with TZipMaster's sfx handling, so some of the new sfx features are not available in TZipMasterSFX.

To use all features of the new sfx, use the (not yet available ;-)) TZipSfx component instead (http://delphizip.mirkes.de), but that one works quite different.

differences between TZipMasterSFX and TZipMaster's sfx handling:

- it uses a different sfx stub 'dzsfx[lang].bin' (not ZIPsfx.bin), this one should be placed in the same directory where the old zipsfx.bin is (or set its own SFXPath property properly).

- it uses an associated TZipMaster component to get the SFX... properties (and also for ShowZipMessage and things like this)

- to convert a TZipMaster's zip to an exe, set all properties in the associated TZipMaster component and then call TZipMasterSFX.ConvertToExe rather than TZipMaster.ConvertEXE, if conversion was successfull, the TZipMaster will automatically use the converted SFX as its ZipFileName (no special action must be taken).

- to convert a TZipmaster's sfx-zip to an ordinary zipfile, call TZipMasterSFX.ConvertToZip instead of TZipMaster.ConvertZip.

- to create a new sfx-zip, you should do something like this (this one's not yet tested):

1) set the sfx's properties in the ZipMaster component.

2) call ZipMasterSFX1.CreateNewSFX(FileName).

3) if creation was successfull, the associated ZipMaster should automatically

use the newly created SFX as its ZipFile(Name).

Classes, Interfaces and Objects

Name | Description
Class TZipMasterSFX |


ZipMstrSFX: Class TZipMasterSFX

Class TZipMasterSFX

Unit

ZipMstrSFX

Declaration

type TZipMasterSFX = class()

Description

Methods

Overview

Public | function ConvertToSFX: integer;
Public | function ConvertToZip: integer;
Public | function CreateNewSFX(const sFile: string): integer;

Description

Public function ConvertToSFX: integer;

Converts the ZIP archive (according to the sfx related options of the ZipMaster component) to a SFX archive and updates the ZipMaster component to use the newly created file.

Public function ConvertToZip: integer;

Converts the SFX archive (in the ZipMaster property's ZipFileName) to a ZIP archive and updates the ZipMaster component to use the newly created file.

Public function CreateNewSFX(const sFile: string): integer;

Creates a new, empty SFX archive (according to the sfx related options of the ZipMaster component) and updates the ZipMaster component to use this newly created file.

Properties

Overview

Private | property SFXPath: TFileName;
Private | property Version: string;
Private | property ZipMaster: TZipMaster;

Description

Private property SFXPath: TFileName;

This is the path of the binary SFX stub "DZSFX[lang].BIN". This stub is needed to convert ZIP archives to self extracting EXE archives and also to create a new SFX.

There are at least two possibilities how to manage the stub:

1) Place the file dzsfx.bin in your application directory and set the SFXPath property to "dzsfx[lang].bin".

2) Place the stub in your windows system directory and set the SFXPath property accordingly or just also to "dzsfx[lang].bin").

Notes:

the [lang] placeholder stands for the desired language of the sfx stub. currently the are sfx's in english, german and italian. you can change the language at runtime by setting the global variable DZSFX_LANG to a different language identifier (currently 'US', 'IT' and 'DE').

Private property Version: string;

Shows the release/version of the TZipMasterSFX component.

Private property ZipMaster: TZipMaster;

Set this to a TZipMaster component on your form, the TZipMasterSFX will use its properties and also its event handlers (to display messages and so on).


ZipSFX

Unit ZipSFX

Description

this unit contains the TZipSFX component which is used to create and convert self extracting zip archives

Classes, Interfaces and Objects

Name | Description
Class TCustomZipSFX | implementation of the sfx<->zip converter
Class TZipSFX | published sfx<->zip converter

Variables

Name | Description
DZSFX_LANG | set this to one of the supported languages to use the specified .bin or resource sfx stub

Author

(C)2003 markus stephany, delphizip@mirkes.de, all rights reserved.

Last Modified

04-24-2003


ZipSFX: Class TCustomZipSFX

Class TCustomZipSFX

Unit

ZipSFX

Declaration

type TCustomZipSFX = class()

Description

implementation of the sfx<->zip converter

Methods

Overview

Public | procedure Convert;
Public | procedure ConvertToSFX;
Public | procedure ConvertToZip;
Public | procedure CreateNewSFX;
Public | class function GetSupportedSFXLanguages: string;
Public | procedure LoadFromFile(const sFile: TFileName);
Public | procedure SaveToFile(const sFile: TFileName);

Description

Public procedure Convert;

Based on the extensions of the SourceFile and TargetFile properties, either one of the ConvertToSFX or ConvertToZip methods will be called.

- SourceFile = 'xyz.zip' and TargetFile = 'xyz.exe' => ConvertToSFX

- SourceFile = 'xyz.exe' and TargetFile = 'xyz.zip' => ConvertToZip

In all other cases an EDelphiZip will be raised.

Public procedure ConvertToSFX;

According to the other SFX related properties, the zip archive in SourceFile will be converted to a self extracting EXE archive whose filename is set in TargetFile.

Public procedure ConvertToZip;

The self extracting EXE archive in SourceFile will be converted back to a regular ZIP archive archive whose filename is set in TargetFile.

Public procedure CreateNewSFX;

According to the other SFX related properties, an empty self extracting archive (which contains no zipped files) will be created, it's filename is read from TargetFile.

Public class function GetSupportedSFXLanguages: string;

get short id's of all sfx language modules compiled into the application

Public procedure LoadFromFile(const sFile: TFileName);

The SFX properties, source and target filename can be reload from a file previously saved via SaveToFile.

Some properties can also be read back from existing self extracting archives (only Delphi Zip SFX archives are supported)

Public procedure SaveToFile(const sFile: TFileName);

You can save all current SFX properties, source and target filename of a TCustomZipSFX class into a special file. Later those settings can be reload using the LoadFromFile method.

Properties

Overview

Protected | property CommandLine: string;
Protected | property DefaultExtractPath: string;
Protected | property DialogTitle: string;
Protected | property FallbackExtractPath: string;
Protected | property HowToDelete: THowToDeleteFile;
Protected | property Icon: TIcon;
Protected | property Message: string;
Protected | property MessageFlags: Cardinal;
Protected | property Options: TSFXOptions;
Protected | property OverwriteMode: TSFXOverwriteMode;
Protected | property SFXLanguage: string;
Protected | property SFXPath: TFileName;
Protected | property SourceFile: TFileName;
Protected | property TargetFile: TFileName;
Protected | property Version: string;

Description

Protected property CommandLine: string;

This string will be stored in the created self extracting archive (SFX).
After the SFX has extracted its archived files, the content of this string will be executed.

Notes:

- This string must not exceed 255 characters.
- This string may consist of two parts separated by a pipe ("|") character. Then the part in front of the pipe is the application to execute, the second part is the command line argument to this application.
- Each occurence of >< (greater than + less than characters) in this string will be replaced by the actual value of the extraction path at runtime of the SFX.
- Rather than executing an application, also the Installation of an .inf file is supported.
- Also environment variables can be used if soExpandVariables is set in the Options property

Samples:

($extractpath means the actual extraction path on the target computer)
"><setup.exe|><install.txt" will execute $extractpath\setup.exe with arguments $extractpath\install.txt.

"notepad.exe|><readme.txt" will execute notepad.exe (it must be somewhere in the %path%) with arguments $extractpath\readme.txt

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

"><setup.inf|.ntx86" will run the [DefaultInstall] section if Win95 (98?), but [DefaultInstall.ntx86] section if WinNT.

"%comspec% /c|><startup.bat" will open the command prompt (usually command.com or cmd.exe), run the batch file $extractpath\startup.bat and after this close the command prompt again. (This sample only works if soExpandVariables is set in the Options property)

Protected property DefaultExtractPath: string;

This string will be stored in the created self extracting archive (SFX).
The SFX will read its default extraction path from this string's content and show it up in the "Extract to" edit box.

Notes:

- This string must not exceed 255 characters.

- Each occurence of >< (greater than + less than characters) in this string will be replaced by the actual value of the temporary directory at runtime of the SFX.

- Also environment variables can be used if soExpandVariables is set in the Options property

- If soExpandVariables is set, a special environment variable %TICKS% is supported, it returns the current internal timer counter, so rather unique extraction pathes can be created.

- A special value <VOLATILE> is also supported. if this "path" is beeing used as default extraction path, it'll be expanded to a unique directory under the temp path. if files have been extracted to this unique dir AND a command line has been successfully executed, this directory will be deleted recursively nex time the computer gets rebooted (maybe useful for setup programs).

- Also reading the path from registry is possible:
If this string starts with "HK", then it's real value will be read from the registry on the target computer. The path describing the registry key must consist of a root key value (either HKLM/HKEY_LOCAL_MACHINE, HKU/HKEY_USERS or HKCU/HKEY_CURRENT_USER) , a backslash and a subkey of this rootkey again followed by a backslash. If you want to specify the name of a value to read, add this value without a trailing backslash. You are also able to create a subdirectory in the path read from the registry, just put a pipe ("|") character after the registry path and then the name of the subdirectory to create (please also look at the samples section below..)
If reading the path from registry fails, you can specify a fallback path in the FallbackExtractPath property.

Samples:

"><\a" => target computer's temporary directory + subdirectory "a"

"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir|MyNewDir" => will read the path from the value "ProgramFilesDir" in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion and add the value MyNewDir to this path from registry (e.g. "c:\Program Files\MyNewDir").

To extract to a (rather) unique path in the temporary directory, set soExpandVariables in the Options property and use the value "%temp%\%ticks%" as DefaultExtractPath.

To extract to a temporary directory that should recursively be deleted after next reboot, use the special value "<VOLATILE>".

Protected property DialogTitle: string;

This string will be stored in the created self extracting archive (SFX).
It is used as the title/caption of the SFX's dialog window.

Notes:

- This string must not exceed 255 characters.

Protected property FallbackExtractPath: string;

This string will be stored in the created self extracting archive (SFX).
If you specified a registry key name in the DefaultExtractPath property and at runtime of the SFX this value can not be read from registry, then FallBackExtractPath will be used instead.

Notes:

- This string must not exceed 255 characters.

Protected property HowToDelete: THowToDeleteFile;

If the the file in TargetFile already exists on converting, the existing file will be deleted. This Option specifies how the deletion will be done:

-htdFinal: The file will be removed, this can not simply be undone.

-htdAllowUndo: The file will be moved to the Recycle Bin (if possible).

Protected property Icon: TIcon;

This icon will be stored in the created self extracting archive (SFX).
You can load a custom icon and replace the SFX's icon by this one.

Notes:

- This replacement icon must match the size of the SFX's original icon.

Protected property Message: string;

This string will be stored in the created self extracting archive (SFX).
The SFX can display a message at startup. This property contains the text of this message. To avoid showing a message at SFX startup, leave this string empty. (see also MessageFlags)

Notes:

- This string must not exceed 255 characters.

Protected property MessageFlags: Cardinal;

This value will be stored in the created self extracting archive (SFX).
This value controls the behaviour of the SFX startup message. It's used as the uType member of the MessageBox API call. (see also the Message property)

Samples:

- Simple information dialog showing an OK button: MB_OK or MB_ICONINFORMATION = 64

- Question dialog showing YES and NO buttons: MB_YESNO or MB_ICONQUESTION = 36

Protected property Options: TSFXOptions;

options which control the behaviour of the generated sfx:

-soAskCmdLine:
This is used if the SFX should execute an application or document after extraction. If this flag is set, a checkbox will appear on the SFX main window describing the command to execute. If the user unchecks that control, no command will be executed after extraction.

- soAskFiles:
If this flag is set, the user can choose which files to extract.

- soHideOverwriteBox:
If this flag is set, the user cannot change the default overwrite mode.

- soAutoRun:
If this flag is set, the SFX will automatically start extraction of its archived files at startup.

- soNuSuccessMsg:
If set, no message ("All files have been extracted") will be displayed after successful extraction.

- soExpandVariables:
If set, all string properties (Default extraction path, Commandline etc.) of the SFX can contain variables (like %windir% or %temp%). At runtime of the SFX those variables will be substituted by their actual values.

- soInitiallyHideFiles:
If set, the list showing the files to extract will not be displayed at startup of the SFX. The user will have to click the "Files..." button to show them.

- soForceHideFiles:
If this flag and soInitiallyHideFiles are set, the button to display the files list will be removed from the SFX window, so that list cannot be shown.

- soCheckAutoRunFileName:
If this flag is set, an autorun SFX (soAutoRun flag set) will automatically extract its contents only if the filename of the SFX is either "setup.exe" or prefixed by an exclamation mark ("!").

- soCanBeCancelled:
If this flag is set, the user can interrupt the extraction process by either clicking the "Close" button or the "x" button on the title bar.

Protected property OverwriteMode: TSFXOverwriteMode;

This value controls the behaviour of the SFX when a file to extract would be overwrite an existing file on disk:

- somOverwrite:
Always overwrite existing files

- somSkip:
Never overwrite existing files

- somAsk:
Let the user confirm overwriting.

Protected property SFXLanguage: string;

language of the generated/read sfx ('US', 'DE', 'IT'...)
you may also use native language names if they are compiled into your app in resource form ( so if dzsfxit.res, dzsfxes.res and dzsfxus.res are compiled into the program, also 'italiano', 'español' and 'english' are valid language identifiers.

Protected property SFXPath: TFileName;

This is the path of the binary SFX stub "DZSFX[LANG].BIN". This stub is needed to convert ZIP archives to self extracting EXE archives and also to create a new SFX.

There are at least three options to handle this stub:
1) Place the file dzsfx[lang].bin in your application directory and set the SFXPath property to "dzsfx[lang].bin".

2) Place the stub in your windows system directory and set the SFXPath property accordingly (or just also to "dzsfx[lang].bin").

3) It is also possible to compile this binary sfx stub into your application, so you don't have to care about the path of the dzsfx[lang].bin file anymore. Just place a {$R DZSFX[lang].RES} somewhere in your delphi project and forget about the SFXPath property...

4) To compile all available sfx language modules to your application, just add a line {$R DZSFX_ALL.RES} to your project.

Notes:

the [lang] placeholder stands for the desired language of the sfx stub. currently the are sfx's in english, german and italian. you can change the language at runtime by setting the SFXLanguage property to a different language identifier (currently 'US', 'IT' and 'DE'). you may also link more than one dzsfx[lang].res file to your application to use this feature (and also all available sfx language modules at once {$R DZSFX_ALL.RES})

Protected property SourceFile: TFileName;

On conversion of ZIP<->SFX EXE archives, this is the name of the file that is to be converted.

Protected property TargetFile: TFileName;

On conversion of ZIP<->SFX EXE archives, this is the name of the target file. It is also the name of the new empty SFX when using the CreateNewSFX method.

Protected property Version: string;

Shows the release/version of the TZipSFX component.


ZipSFX: Class TZipSFX

Class TZipSFX

Unit

ZipSFX

Declaration

type TZipSFX = class(TCustomZipSFX)

Description

published sfx<->zip converter

Hierarchy

TCustomZipSFX

Properties

Overview

Private | property CommandLine;
Private | property DefaultExtractPath;
Private | property DialogTitle;
Private | property FallbackExtractPath;
Private | property Icon;
Private | property Message;
Private | property MessageFlags;
Private | property Options;
Private | property OverwriteMode;
Private | property SFXLanguage;
Private | property SFXPath;
Private | property SourceFile;
Private | property TargetFile;
Private | property Version;

Description

Private property CommandLine;

see inherited CommandLine

Private property DefaultExtractPath;

see inherited DefaultExtractPath

Private property DialogTitle;

see inherited DialogTitle

Private property FallbackExtractPath;

see inherited FallbackExtractPath

Private property Icon;

see inherited Icon

Private property Message;

see inherited Message

Private property MessageFlags;

see inherited MessageFlags

Private property Options;

see inherited Options

Private property OverwriteMode;

see inherited OverwriteMode

Private property SFXLanguage;

see inherited SFXLanguage

Private property SFXPath;

see inherited SFXPath

Private property SourceFile;

see inherited SourceFile

Private property TargetFile;

see inherited TargetFile

Private property Version;

see inherited Version


All Classes, Interfaces and Objects

Name | Unit | Description
TCustomZipSFX | ZipSFX | implementation of the sfx<->zip converter
TZipMasterSFX | ZipMstrSFX |
TZipSFX | ZipSFX | published sfx<->zip converter


All Types

None


All Variables

Name | Unit | Description
DZSFX_LANG | ZipSFX | set this to one of the supported languages to use the specified .bin or resource sfx stub


All Constants

None


All Functions and Procedures

None


All Identifiers

Name | Unit | Description
DZSFX_LANG | ZipSFX | set this to one of the supported languages to use the specified .bin or resource sfx stub
TCustomZipSFX | ZipSFX | implementation of the sfx<->zip converter
TZipMasterSFX | ZipMstrSFX |
TZipSFX | ZipSFX | published sfx<->zip converter


DZSFX License:
--------------

    This software is provided "as is" without warranty of any kind,
    either expressed or implied.  the entire risk as to the
    quality and performance of the software is with you.  should the
    software prove defective, you assume the cost of all necessary
    servicing, repair, or correction.  in no event shall the author,
    copyright holder, or any other party who may redistribute the
    software be liable to you for damages, including any general,
    special, incidental, or consequential damages arising out of
    the use or inability to use the software (including, but not
    limited to, loss of data, data being rendered inaccurate, loss of
    business profits, loss of business information, business
    interruptions, loss sustained by you or third parties, or a
    failure of the software to operate with any other software) even
    if the author, copyright holder, or other party has been advised
    of the possibility of such damages.

                      Distribution Policy
              Guidelines for Legal Re-distribution

  1) This applies to both end-users and developers.

  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 its 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 derrivitive 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.
        Info-Zip:   http://www.cdrom.com/pub/infozip/

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

  6) We 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 the demo
     programs to end-users without my approval.  These are
     only example applications to teach you how to use
     this package.