SetupData.CalculateRequiredSpace

number SetupData.CalculateRequiredSpace ( 

function CallbackFunction = nil )

Description

Calculates the amount of disk space needed by the setup at it's current state, with the variables, packages, etc. as they are at the time that the action is called.

Tip: To display the information returned by this action in a formatted way, use String.GetFormattedSize.

Parameters

CallbackFunction

(function) The name of a function that will be called whenever progress is made in the disk space calculation. (You can use this callback function to display the progress of the disk space calculation in your own custom way.)

Note: If CallbackFunction is set to nil, then the progress information will be sent to the built-in status dialog, assuming it is currently visible. (You can show or hide the status dialog with a StatusDlg.Show or StatusDlg.Hide action.)

The callback function must be able to receive the following parameters:

CurrentFileName

(string) The filename whose size is being calculated.

PercentDone

(number) The percentage of the calculation that has been completed so far.

The callback function should return a boolean value (true or false) indicating whether the calculation should continue:

VALUE

DESCRIPTION

true

Continue with the space calculation.

false

Stop the space calculation as soon as possible.

Returns

(number) The required disk space (in bytes) needed for the install. If an error occurs, -1 will be returned. You can use Application.GetLastError to determine whether this action failed, and why.

ResultVariable

When adding an action with the action editor, you can use this field to specify a variable that the return value will be stored in.

See also:  Related Actions