Share via


<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 Installer 會隨 .NET Framework 一起安裝,因此不需要個別安裝。

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

另請參閱