Share via


win32dependencies:ExternalDependency (Windows 10,Windows 11)

指定未包含在 MSIX 中的外部相依性,但會鏈結為應用程式安裝的一部分。 如果作業系統上尚未安裝指定的外部相依性最低版本,Microsoft 應用程式安裝程式應用程式會從外部存放庫擷取最低版本,並安裝相依性。 Microsoft 會維護可使用此方法安裝的相依性清單。 如需目前允許的套件清單,請參閱一節。

元素階層

<套件>

    [ < 相依性 > ]

         <win32dependencies:ExternalDependency>

Syntax

<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 個字元之間的字串,只包含英數位元、句號和虛線。 Yes
發行者 相依性套件的發行者。 長度介於 1 到 8192 個字元之間的字串,其符合辨別名稱的正則運算式。 Yes
MinVersion 外部相依性的最低版本。 如果作業系統已安裝最低版本,將不會觸發安裝。 四次標記法中的版本字串, (Major.Minor.Build.Revision) ,其中 Major 不是 0 Yes
選擇性 在沒有網際網路連線的情況下執行安裝,且此值為 false 時,安裝將會完成,而不需要安裝外部相依性。 如果此值為 true,則沒有網際網路連線的安裝將會失敗。 布林值。 Yes

子元素

無。

父元素

Parent 項目 描述
Dependencies (相依性) 宣告套件相依的其他套件,以完成其軟體。

範例

<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」

規格需求

Item
virtualization http://schemas.microsoft.com/appx/manifest/externaldependencies