SetupData.CalculateRequiredSpace

number SetupData.CalculateRequiredSpace ( 

function CallbackFunction = nil )

Example 1

Req_Space = SetupData.CalculateRequiredSpace(nil);

Calculates the disk space required by the install and stores the value in "Req_Space."

Example 2

-- Callback function for action SetupData.CalculateRequiredSpace()
function Callback (sName, nPercent)
    -- Set title, message, statustext, hide the progress meter and show the cancel button.
    StatusDlg.SetTitle("Calculating Space Required . . . ");
    StatusDlg.SetMessage("Please wait . . . " .. nPercent .. "% Complete");
    StatusDlg.ShowProgressMeter(false);
    --StatusDlg.ShowCancelButton(true, "Abort");
    -- Check if the cancel button was pressed
    bCancel = StatusDlg.IsCancelled();
    -- Let the action continue to the next file
    return true;
end


-- Show the status dialog
StatusDlg.Show(0, false);

-- Calculate the space required
nSpaceRequired = SetupData.CalculateRequiredSpace(Callback);

-- Report the results to the user
Dialog.Message("Space Required", String.GetFormattedSize(nSpaceRequired, FMTSIZE_AUTOMATIC, true));

-- Hide the status dialog
StatusDlg.Hide();

Calculates the amount of disk space required on the user's system and displays the formatted results to the user.  The callback function is used to provide the user with a custom status display while calculating.

See also:  Related Actions