<RelatedProducts> 元素(引导程序)

RelatedProducts 元素定义依赖于当前产品或包含在当前产品中的其他产品。

语法

<RelatedProducts>
    <DependsOnProduct
        Code
    />
    <EitherProducts>
        <DependsOnProduct
            Code
        />
    </EitherProducts>
    <IncludesProduct
        Code
    />
</RelatedProducts>

元素和属性

RelatedProducts 元素是 Product 元素的一个子元素。 它没有属性。

DependsOnProduct

DependsOnProduct 元素指示当前产品依赖于命名产品,并且命名产品应该在当前产品之前安装。 它是 RelatedProducts 元素的子元素。 一个 RelatedProducts 元素可能包含一个或多个 DependsOnProduct 元素。

DependsOnProduct 具有以下属性。

属性 说明
Code 包含的产品的代码名称,由 Product 元素的 ProductCode 属性指定。 有关详细信息,请参阅 <Product> 元素

EitherProducts

EitherProducts 元素定义零个或多个 DependsOnProduct 元素,并且没有属性。 在安装当前产品之前,必须至少安装此集中的一个 DependsOnProduct。 一个 RelatedProducts 元素可以包含零个或多个 EitherProducts 元素。

IncludesProduct

IncludesProduct 元素指示产品包含在当前安装中,无需单独安装。 它是 RelatedProducts 元素的子元素。 一个 RelatedProducts 元素可能包含一个或多个 IncludesProduct 元素。

IncludesProduct 具有以下属性。

属性 说明
Code 包含的产品的代码名称,由 Product 元素的 ProductCode 属性指定。 有关详细信息,请参阅 <Product> 元素

示例

下面的代码示例指定 Microsoft 安装程序与 .NET Framework 一起安装,因此不需要单独安装。

<RelatedProducts>
    <IncludesProduct Code="Microsoft.Windows.Installer.2.0" />
</RelatedProducts>

另请参阅