大网数据广告活动
安装更新与部署

File Costing

· 52CE 我爱测

Costing is the process of determining the total disk space requirements for an installation.

Costing is the process of determining the total disk space requirements for an installation. The elements calculated in the file costing process include the amount of disk space in which files are installed or removed, as well as the amount of disk space taken up by registry entries, shortcuts, and other miscellaneous files. Existing files scheduled to be overwritten are also calculated in the disk cost totals.

Total costs are accumulated on a per-component basis and consist of three separate parts: local costs, source costs, and removal costs. These parts correspond to the disk cost that is incurred if the component is installed locally, installed to run from the source media, or removed.

All calculations involving the cost of installing files depend upon the disk volume to which the file is to be installed or removed. Each time the directory associated with a component changes, the costs of the installation files controlled by that component must be recalculated. For example, because a directory change might also imply a volume change, the clustered file sizes must be recalculated. In addition, the new directory must be checked to determine whether any existing files that may be overwritten must be taken into account.

After the CostInitialize action is called, the FileCost action must be called. The CostInitialize action initializes the installer's internal routines that dynamically calculate the disk costs involved with the standard installation actions. No other dynamic cost calculations are done at this point.

Next, the CostFinalize action must be called. This action finalizes all cost calculations and makes the costing data available through the Component table.

After the CostFinalize action completes execution, the Component table is fully initialized and a user interface dialog box sequence containing a SelectionTree control can be initiated if needed. The user interface dialog boxes may offer the option to change the selection state or destination directory of any feature in the Feature table to the user. The process is similar when the selection state of a component changes; however, in this case, the dynamic cost of the changed component only is recalculated.

Once the user has completed selecting features in the user interface, the InstallValidate action should be called. This action verifies that all volumes to which cost has been attributed have sufficient space for the installation.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。