FeatureSpendUninstallCost

InstallShield 2014 » InstallScript Language Reference

Project: This function applies to InstallScript projects.

The FeatureSpendUninstallCost function is used to tell the setup that the progress bar should be updated for a certain amount of uninstall ‘cost’ that has been spent by an event external to the setup. This function has the effect of updating the progress bar appropriately as if the setup itself had spent the corresponding amount of cost. This function can only be called during a standard file operation event, such as an event resulting from calling FeatureTransferData or FeatureMoveData. Typically, this function is called during the OnInstalling or OnInstalled event as a result of an external event occurring that spends cost.

Note: It is not necessary to call this function for file transfer operations that are listed the uninstall log file., such as XCopyFile or CopyFile operations. The status bar is updated automatically for items listed in the log file, note also that you do not need to call FeatureAddUninstallCost for items listed in the log file, as the setup automatically accounts for all items listed in the log file. However, FeatureAddCost must be called in this case so the file transfer operation is aware of the additional cost.

Syntax

FeatureSpendUninstallCost ( nOps, nOpType);

Parameters

FeatureSpendUninstallCost Parameters

Parameter

Description

nOps

The number of operations to spend.

nOpType

Indicates the type of operation. Pass one of the following predefined constants in this parameter:

FEATURE_OPCOST_UNINSTALL_FILE—Specifies the operation as uninstalling a file. You can also specify this constant using the value 4096. This enables you to experiment with different sizes to determine what size to use for your custom operation.
FEATURE_OPCOST_UNINSTALL_REGORINI—Specifies the operation as uninstalling a registry file. You can also specify this constant using the value 2048. This enables you to experiment with different sizes to determine what size to use for your custom operation.
FEATURE_OPCOST_UNINSTALL_UNREGFILE—Specifies the operation as unregistering a file. You can also specify this constant using the value 16384. This enables you to experiment with different sizes to determine what size to use for your custom operation.

Note: You can also pass a numeric value in this parameter to indicate an operation of a specific cost. You may need to experiment with different values to determine the appropriate value for a specified custom operation. Note that the total uninstall cost added is nOps multiplied by nOpType.

Return Values

FeatureSpendUninstallCost Parameters

Return Value

Description

ISERR_SUCCESS

Indicates that the function successfully updated the progress bar.

< ISERR_SUCCESS

Indicates that the function was unable to update the progress bar.

See Also