CalculateAndAddFileCost

InstallShield 2016 » InstallScript Language Reference

The CalculateAndAddFileCost 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 file of a known size 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

CalculateAndAddFileCost ( nFileSizeHigh, nFileSizeLow, szTargetDir, nClusterSize, nvCostHigh, nvCostLow );

Parameters

CalculateAndAddFileCost Parameters

Parameter

Description

nFileSizeHigh

The upper 31 bits of the file size (in bytes). Typically retrieved using GetFileInfo.

nFileSizeLow

The lower 31 bits of the file size (in bytes). Typically retrieved using GetFileInfo.

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

CalculateAndAddFileCost Return Values

Return Value

Description

ISERR_SUCCESS

Indicates that the function was successful.

< ISERR_SUCCESS

Indicates that the function was not successful.

See Also