Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FCIAddFile function

The FCIAddFile adds a file to the cabinet under construction.

Syntax


BOOL FCIAddFile(
  _In_ HFCI                 hfci,
  _In_ LPSTR                pszSourceFile,
  _In_ LPSTR                pszFileName,
  _In_ BOOL                 fExecute,
  _In_ PFNFCIGETNEXTCABINET GetNextCab,
  _In_ PFNFCISTATUS         pfnProgress,
  _In_ PFNFCIGETOPENINFO    pfnOpenInfo,
  _In_ TCOMP                typeCompress
);

Parameters

hfci [in]

A valid FCI context handle returned by the FCICreate function.

pszSourceFile [in]

The name of the file to add; this value should include path information.

pszFileName [in]

The name under which to store the file in the cabinet.

fExecute [in]

If set TRUE, the file will be executed when extracted.

GetNextCab [in]

Pointer to an application-defined callback function to obtain specifications on the next cabinet to create. The function should be declared using the FNFCIGETNEXTCABINET macro.

pfnProgress [in]

Pointer to an application-defined callback function to update the progress information available to the user. The function should be declared using the FNFCISTATUS macro.

pfnOpenInfo [in]

Pointer to an application-defined callback function to open a file and retrieve the file date, time, and attributes. The function should be declared using the FNFCIGETOPENINFO macro.

typeCompress [in]

The compression type to use.

Note  To indicate LZX compression, use the TCOMPfromLZXWindow macro.
 
ValueMeaning
tcompTYPE_NONE
0x0000

No compression.

tcompTYPE_MSZIP
0x0001

Microsoft ZIP compression.

 

Return value

If the function succeeds, it returns TRUE; otherwise, FALSE.

Extended error information is provided in the ERF structure used to create the FCI context.

Example

For an example, see Creating a Cabinet.

Remarks

When set, the _A_EXEC attribute is added to the file entry in the CAB. This mechanism is used in some Microsoft self-extracting executables, and could be used for this purpose in any custom extraction application.

Requirements

Header

Fci.h

Library

Cabinet.lib

DLL

Cabinet.dll

See also

FCICreate

 

 

Show: