Session.ComponentCosts 属性

Session 对象的 ComponentCosts 属性返回一个 RecordList 对象,该对象枚举安装组件所需的每个驱动器的磁盘空间。 用户界面使用此信息来显示所有驱动器所需的磁盘空间。 返回的磁盘空间成本以 512 字节的倍数为单位。

ComponentCosts 属性应仅在安装程序完成文件成本计算之后和 CostFinalize 操作之后使用。

此属性为只读。

语法

propVal = Session.ComponentCosts

属性值

备注

若要获取总成本,请将所有组件的成本加上安装程序引擎成本 (Component = “”)。

ComponentCosts 返回 RecordList 对象。 返回的 RecordList 对象中的每个记录具有以下字段:

字段 说明
1 卷/驱动器名称
2 最终磁盘空间成本(以 512 字节的倍数为单位)。
3 临时磁盘空间成本(以 512 字节的倍数为单位)。

 

要求

要求
版本
Windows Server 2012、Windows 8、Windows Server 2008 R2 或 Windows 7 上的 Windows Installer 5.0。 Windows Server 2008 或 Windows Vista 上的 Windows Installer 4.0 或 Windows Installer 4.5。 Windows Server 2003 或 Windows XP 上的 Windows Installer
DLL
Msi.dll
IID
IID_ISession 定义为 000C109E-0000-0000-C000-000000000046