GetAndAddFileCost

InstallShield 2024 » InstallScript Language Reference

The GetAndAddFileCost function determines the cost of the specified file and adds it to the current value of nvCostHigh and/or nvCostLow. This allows you to calculate and add up the cost of multiple files by calling the function multiple times in a loop. Set nvCostHigh and nvCostLow to zero before calling the function to determine the cost of a single file. This function is typically used when you need to determine the cost of an existing file on disk so this cost can then be passed to FeatureAddCost.

Note:Note that this function does not actually set any information to be used directly by the installation. You must call FeatureAddCost (as appropriate) after calling this function to add the additional cost to an existing feature.

Syntax

GetAndAddFileCost ( szSrcFile, szTargetDir, nClusterSize, nvCostHigh, nvCostLow );

Parameters

GetAndAddFileCost Parameters

Parameter

Description

szSrcFile

The fully qualified path and file name of the existing file on disk to determine the cost of.

szTargetDir

If nClusterSize is 0, the target folder for the file. This path is used to determine the cluster size of the target drive. If nClusterSize is non-zero, this parameter is ignored.

nClusterSize

Specifies the cluster size of the target drive. If this parameter is 0, the function determines this information from szTargetDir.

nvCostHigh

The upper 31 bits of the installation cost (in bytes) of this file is added to the current value of this variable.

nvCostLow

The lower 31 bits of the installation cost (in bytes) of this file is added to the current value of this variable.

Return Values

GetAndAddFileCost Return Values

Return Value

Description

ISERR_SUCCESS

Indicates that the function was successful.

< ISERR_SUCCESS

Indicates that the function was not successful.

See Also