win32dependencies:ExternalDependency (Windows 10,Windows 11)

指定未包含在 MSIX 中的外部依赖项,但将在应用安装过程中进行链式安装。 如果 OS 上尚未安装指定的外部依赖项最低版本,Microsoft 应用安装程序应用将从外部存储库检索最低版本并安装依赖项。 Microsoft 维护可以使用此方法安装的依赖项列表。 有关允许的包的当前列表,请参阅 “备注 ”部分。

元素层次结构

<程序包>

    [<依赖项>]

         <win32dependencies:ExternalDependency>

语法

<win32dependencies:ExternalDependency
    Name = 'A string between 3 and 50 characters in length that consists of alpha-numeric characters, periods, and dashes only.' 
    Publisher = 'A string with a value between 1 and 8192 characters in length that fits the regular expression  of a distinguished name.'
    MinVersion = 'A version string in quad notation, ("Major.Minor.Build.Revision") where "Major" is not "0".'
    Optional = 'A boolean value.' />

特性和元素

特性

属性 说明 数据类型 必须 默认值
名称 依赖项包名称。 有关允许的依赖项包的列表,请参阅下面的“备注”部分。 长度介于 3 到 50 个字符之间的字符串,仅包含字母数字字符、句点和短划线。
发布者 依赖项包的发布者。 长度为 1 到 8192 个字符的字符串,适合可分辨名称的正则表达式。
MinVersion 外部依赖项的最低版本。 如果 OS 已安装最低版本,则不会触发安装。 四元表示法中的版本字符串, (Major.Minor.Build.Revision) ,其中 Major 不存在 0
可选 在没有 Internet 连接的情况下执行安装并且此值为 false 时,安装将在不安装外部依赖项的情况下完成。 如果此值为 true,则没有 Internet 连接的安装将失败。 布尔值。

子元素

无。

父元素

父元素 说明
依赖项 声明包依赖的其他包以完成其软件。

示例

<Package
    xmlns:win32dependencies="http://schemas.microsoft.com/appx/manifest/externaldependencies"  
    IgnorableNamespaces="... win32dependencies">
    <Dependencies>  
        <TargetDeviceFamily
            Name="Windows.Universal"
            MinVersion="11.0.0.0" 
            MaxVersionTested="12.0.0.0"/>  
        <uap4:MainPackageDependency
            Name="MyApp"
            Publisher="CN=DianCert, O=Contoso Corporation, C=US" />  
        <win32dependencies:ExternalDependency
            Name="Microsoft.WebView2"
            Publisher="CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
            MinVersion="1.1.1.1"
            Optional="true"/>
    </Dependencies>  
</Package>

备注

此功能要求在目标计算机上安装Microsoft 应用安装程序版本 1.16.12651.0 或更高版本。 可以从 Microsoft Store 获取应用。

允许的外部依赖项

下表列出了 ExternalDependency 元素中当前允许的外部依赖项。

程序包 名称属性值 Publisher 属性值
Webview2 “Microsoft.WebView2” “CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US”

要求

项目
Virtualization — 虚拟化 http://schemas.microsoft.com/appx/manifest/externaldependencies