Contents - Index - Previous - Next


MakeNewSFX method

 

Applies to

TVCLZip component

 

Declaration

function MakeNewSFX(SFXStub: string; FName: string; Options: PChar; OptionsLen: Integer): Integer;

 

Description

This method allows you to create a new Self Extracting Zip File without requiring the in between step of creating a zip file first.  (To make an SFX from an existing zip file, see the MakeSFX Method)  The contents of the zip file will be created using the contents of the FilesList Property,  just as it is used when creating a new regular zip file, and/or a the contents of a zip file specified in the FName paramter (see below).  

 

SFXStub is the filename of the SFX stub file that is to be used to create the SFX.  

 

FName is the filename of the resulting SFX file that is to be created, for instance 'MYSFX.EXE'.  If this filename is, instead, the name of an already existing zip file (.i.e. 'MYSFX.ZIP'), then the files in this zip file will be included in the resulting SFX file. This is in addition to any files that may be specified in the FilesList.  The name of the resulting SFX file in this case will be the same as the zip file except with an extention of .EXE.

  

Options and OptionsLen

This method is designed to work well with the 32bit SFX stub that is supplied with VCLZip (ZIPSFX32.BIN) configurable by adding a configuation block between the stub and zip file.   The Options and OptionsLen parameters are specifically for this purpose.  Options should point at the options memory block (remember to cast as a PChar) and OptionsLen should be set to the length of that block in bytes.  If you do not have an options block, or your stub is not compatible with the options block, just set the Options parameter to nil and set OptionsLen to zero.

  

The return value is the number of files that were successfully zipped into the SFX file.  

 

Additionally, if you use the TSFXConfig Component, along with the 32bit SFX stub that is distributed with VCLZip, this allows you to easily create a configurable 32bit SFX.  The Options and OptionsLen values are set for you and other options are easy to set:  See TSFXConfig for an example.