Contents - Index - Next


TSFXConfig component

 

See also Properties Methods


 

Description

This unit allows for the easy  modification of options for the 32bit configurable SFX Delphi stub that is supplied with VCLZip.  Use this in conjunction with the MakeNewSFX method. 

 

The following properties and methods of TSFXConfig set the different options allowed in the 32bit SFX that is distributed with VCLZip.  

 

PUBLIC 

 

procedure CreateHeader; 

Call this method after you have set all options and you are ready to call MakeNewSFX  This will actually create theHeader, which is the options header that is passed into MakeNewSFX. 

 

property theHeader: PChar read FHeader; 

This is the options header that you pass into MakeNewSFX.  It will be placed between the sfx stub and the zip file when the SFX is created.  theHeader is created by calling CreateHeader after all options have been set.

  

property HeaderLen: WORD read FHeaderLen; 

This is the length of the resulting options header that is created when you call CreateHeader.  This length is passed into MakeNewSFX along with theHeader.  

 

PUBLISHED

 

property UserCanDisableCmdLine( Value: Boolean ); 

Setto True if you want the SFX dialog to have a checkbox which allows the user of the SFX to disable the running of the command line (see setStringData below to see how to set up the command line).  The default is False.  

 

Set to True if you want the SFX dialog to have a checkbox which allows the user of the SFX to disable the running of the command line (see setStringData below to see how to set up the command line).  The default is False.  

 

property UserCanChooseFiles: Boolean); 

Set to True if you want the end user of the SFX to be able to select the files in the listbox to be extracted.  If set to False (the default), all files will be extracted. 

 

property UserCanChangeOverwrite: Boolean ; 

Set to True if you want the end user to be able to determine the overwrite mode through a set of option buttons on the dialog box.  If set to False, the overwrite mode will be set to the default overwrite mode which you can set using the setOverwriteMode (below), and the end user won't be able to change it.  

 

property OverwriteMode: TsfxOverwriteMode ; 

Set to the value you want the default overwrite mode to be.  The default value is omPrompt.  The allowable values are: 

 

  omPrompt A dialog box will be diplayed asking the user if they wish to overwrite an existing file with the file currently being unzipped. 

  omAlways Always overwrite any existing files. 

  omNever Never overwrite any existing files, do not extract if file already exists. 

  

property AutoRun: Boolean ; 

Setting this value to True will cause the SFX to automatically run and extract its contents to the destination path that you set in the call to setStringData (see below).  In this case, upon double clicking, the sfx will automatically run without any intervention from the user.  A window will not appear (unless you assign a value to InfoText in which case an information window will be shown before unzipping commences).  You can still have the sfx execute a program or file when done by setting the CmdLine property.

  

property Caption: String; 

The SFX Dialog's caption

 

property DefaultPath: String;    

The default extraction directory shown in the dialog's target directory text box.  The user will be able to change this. If set to '><', the files will be extracted to the system temporary directory.  The default is '' which means the directory will first be set at the same directory as where the SFX itself resides. (e.g. "><readme\test.txt" after an extraction to the path "C:\Program files\unpacked" means :  "c:\progra~1\unpacked\readme\test.txt") <- the short path will be created by zipsfx.

 

property  CmdLine: String; 

The command line to execute after all files have been extracted. If the string "><" (greater than+less than) is somewhere in the command line, it will be replaced with the path where the archive has been extracted to.  

If the pipe "|" is in the command-line, the part to the left will get the application to run and the part to the right will be it's argument.  if the archive is extracted to e.g. "d:\unpack", then we will get the following :  

 

Command Line Will parse To:  

"><setup\setup.exe|><install.inf" run "d:\unpack\setup\setup.exe" with parameters  "d:\unpack\install.inf".  

"c:\windows\notepad.exe|><readme.txt" run "c:\windows\notepad.exe" with parameters  "d:\unpack\readme.txt".  

"><readme.txt" open "d:\unpack\readme.txt" with its associated program, if there is any.  

"><setup.exe"   run "d:\unpack\setup.exe" without special parameters. 

  

property InfoText: String; 

If InfoText is set to anything, then the first thing the sfx will do when it is run is show a window with this text in it.  This text can be set to whatever you want and it can include carraige returns too.  This information window will be shown even if AutoRun is set to True. 

 

property InfoTitle: String; 

This will be the caption shown in the Information Window.