uap:Extension (Windows 10)

宣告應用程式的擴充點。

元素階層

<套件>

    <應用程式>

         <應用程式>

              <擴充功能>

                   <uap:Extension>

Syntax

<uap:Extension
  Category = 'A string that can have one of the following values: "windows.fileTypeAssociation", "windows.protocol", "windows.autoPlayContent", "windows.autoPlayDevice", "windows.shareTarget", "windows.search", "windows.fileOpenPicker", "windows.fileSavePicker", "windows.cachedFileUpdater", "windows.cameraSettings", "windows.accountPictureProvider", "windows.printTaskSettings", "windows.lockScreenCall", "windows.appointmentsProvider", "windows.alarm", "windows.webAccountProvider", "windows.dialProtocol", "windows.appService", "windows.mediaPlayback", "windows.print3DWorkflow", "windows.lockScreen", "windows.aboveLockScreen", "windows.personalAssistantLaunch", or "windows.voipCall".'
  Executable = 'A string with an optional value between 1 and 256 characters in length, that must end with ".exe", and cannot contain the following characters: <, >, :, ", |, ?, or *. Specifies the default executable for the extension. If not specified, the executable defined for the app is used.  If specified, the EntryPoint property is also used. If the EntryPoint property is not specified, the EntryPoint defined for the app is used.'
  EntryPoint = 'A string with an optional value between 1 and 256 characters in length. Represents the task handling the extension (normally the fully namespace-qualified name of a Windows Runtime type). If EntryPoint is not specified, the EntryPoint defined for the app is used instead.'
  RuntimeType = 'A string with an optional value between 1 and 255 characters in length that cannot start or end with a period or contain these characters: <, >, :, ", /, \, |, ?, or *.'
  StartPage = 'A string with an optional value between 1 and 256 characters in length that cannot contain these characters: <, >, :, ", |, ?, or *.'
  ResourceGroup = 'An alphanumeric string with an optional value between 1 and 255 characters in length. Must begin with a letter.'
  uap10:TrustLevel = 'An optional string value. If specified, it must be either "appContainer" or "mediumIL".'
  uap10:RuntimeBehavior  = 'An optional string value. If specified, it must be one of the following values:  "windowsApp", "packagedClassicApp", or "win32App".'
  uap10:HostId = 'An alphanumeric string with an optional value between 1 and 255 characters in length. Must begin with an letter.'
  uap10:Parameters = 'A string with an optional value between 1 and 32767 characters in length with a non-whitespace character at its beginning and end.'
  uap11:Id = 'An optional string with a value between 1 and 255 characters in length with a non-whitespace character at its beginning and end.'
  uap11:Subsystem = 'An optional string that can have one of the following values: "console" or "windows".'
  uap11:SupportsMultipleInstances = 'An optional boolean value.'
  uap11:ResourceGroup = 'An optional alphanumeric string with a value between 1 and 255 characters in length. Must begin with a letter.'
  uap11:CurrentDirectoryPath = 'An optional string that cannot contain these characters: <, >, |, ?, or *. >'
  uap11:Parameters = 'An optional string with a value between 1 and 32767 characters in length with a non-whitespace character at its beginning and end.'
  desktop7:CompatMode = 'An optional string the can have one of the following values: "classic" or "modern".'
  desktop7:Scope = 'An optional string that can have one of the following values: "machine" or "user".' >

  <!-- Child elements -->
  uap:FileTypeAssociation?
  uap:Protocol?
  uap:AutoPlayContent?
  uap:AutoPlayDevice?
  uap:ShareTarget?
  uap:FileOpenPicker?
  uap:FileSavePicker?
  uap:AppointmentsProvider?
  uap:WebAccountProvider?
  uap:DialProtocol?
  uap:AppService?
  uap:MediaPlayback?
  uap:VoipCall?

</uap:Extension>

答案

? 選擇性 (零或一個)

屬性和元素

屬性

屬性 描述 資料類型 必要 預設值
類別 套件擴充點的類型。 可具有下列其中一個值的字串:windows.fileTypeAssociationwindows.protocolwindows.autoPlayContentwindows.autoPlayDevicewindows.shareTargetwindows.searchwindows.fileOpenPicker、windows.fileSavePickerwindows.cachedFileUpdaterwindows.cameraSettingswindows.accountPictureProvider、windows.printTaskSettingswindows.lockScreenCallwindows.appointmentsProviderwindows.alarmwindows.webAccountProviderwindows.dialProtocolwindows.appServicewindows.mediaPlaybackwindows.print3DWorkflowwindows.lockScreenwindows.aboveLockScreenwindows.personalAssistantLaunchwindows.voipCall Yes
EntryPoint 可啟用的類別識別碼。 長度介於 1 到 256 個字元之間的字串。 表示處理延伸模組的工作 (通常是 Windows 執行階段 類型的完整命名空間限定名稱) 。 如果未指定 EntryPoint,則會改用為應用程式定義的 EntryPoint。 No
可執行檔 默認啟動可執行檔。 長度介於 1 到 256 個字元之間的字串,必須以 .exe結尾,且不能包含下列字元:<、、、>、、:?"|或 。 * 指定延伸模組的預設可執行檔。 如果未指定,則會使用為應用程式定義的可執行檔。 如果指定,也會使用 EntryPoint 屬性。 如果未指定 EntryPoint 屬性,則會使用為應用程式定義的 EntryPoint。 No
RuntimeType 運行時間提供者。 通常會在應用程式中混合架構時使用。 長度介於 1 到 255 個字元之間的字串,長度不能以 . 或 包含 字元開頭或結尾:<、、、>、、:"|?* No
StartPage 處理擴充點的網頁 長度介於 1 到 256 個字元之間的字串,不能包含下列字元:<、、、:>"|?* No
ResourceGroup 選擇性標記,用來將擴充功能啟用分組在一起,以供資源管理之用 (,例如 CPU 和記憶體) 。 請參閱Application@ResourceGroup中的一節。 長度介於 1 到 255 個字元之間的英數位元。 必須以字母開頭。 No
uap10:TrustLevel 指定延伸模組的信任層級。 選擇性字串值。 如果指定,它可以是下列其中一個值: appContainermediumIL No
uap10:RuntimeBehavior 指定延伸模組的運行時間行為。 選擇性字串值。 如果指定,它可以是下列其中一個值: windowsApppackagedClassicAppwin32App No
uap10:HostId 指定擴充功能的主機運行時間標識碼。 長度介於 1 到 255 個字元之間的選擇性值英數位元。 必須以字母開頭。 No
uap10:Parameters 包含要傳遞至延伸模組的命令行參數。 僅支援傳統型應用程式。 長度介於 1 到 32767 個字元之間的字串,其開頭和結尾具有非空格符。 No
uap11:Id 延伸模組的標識碼。 套件中所有延伸模組的標識碼都必須是唯一的。 長度介於 1 到 255 個字元的選擇性字串,其開頭和結尾具有非空格符。 No
uap11:子系統 此屬性繼承自基底延伸模組語法,不適用於 com4 延伸模組。 除了語法驗證之外,也會忽略此值。 可具有下列其中一個值的選擇性字串: 控制台視窗 No
uap11:SupportsMultipleInstances 指定實例是否應該在不同的進程中執行。 預設值為 false。 選擇性布爾值。 No
uap11:ResourceGroup 標記,可用來將擴充功能啟用群組在一起,以供資源管理之用 (,例如 CPU 和記憶體) 。 您可以設定 ResourceGroup 的值是自由格式且有彈性。 請參閱 Application@ResourceGroup 長度介於 1 到 255 個字元之間的選擇性英數位元字串。 必須以字母開頭。 No
uap11:CurrentDirectoryPath 指定應用程式進程啟動時的初始目錄。 此屬性支持宏。 如需詳細資訊,請參閱 套件指令清單架構中的宏 無法包含下列字元的選擇性字串:<、、、>|?*。 > No
uap11:Parameters 此屬性繼承自基底延伸模組語法,不適用於 com4 延伸模組。 除了語法驗證之外,也會忽略此值。 此屬性支持宏。 如需詳細資訊,請參閱 套件指令清單架構中的宏 長度介於 1 到 32767 個字元的選擇性字串,其開頭和結尾為非空格符。 No
desktop7:CompatMode 指定此延伸模組的資訊是以傳統方式向 Windows 註冊, (例如,透過登錄) 或以更具範圍的方式向 COM 註冊未封裝的應用程式註冊類型。 預設值為 「modern」。 CompatMode=“classic” 需要 Microsoft.classicAppCompat_8wekyb3d8bbwe 功能。 的選擇性字串可以有下列其中一個值: 傳統新式 No
desktop7:Scope 指定註冊是否只有以使用者身分註冊 (使用者) 執行的其他應用程式,或是否對 (計算機上的所有使用者和服務顯示註冊) 。 預設值為 「user」。 Scope=“machine” 需要 Microsoft.classicAppCompatElevated_8wekyb3d8bbwe 功能。 可具有下列其中一個值的選擇性字串: 計算機使用者 No

子元素

子項目 描述
uap:AppService 宣告 windows.appService 類型的應用程式擴充點。 應用程式合約是應用程式叫用屬於另一個應用程式的背景工作的方法;或,用於叫用背景工作來服務應用程式合約,以便與其呼叫端通訊。
uap:AppointmentsProvider 宣告 windows.appointmentsProvider 類型的應用程式擴充點。
uap:AutoPlayContent 宣告 windows.autoPlayContent 類型的應用程式擴充點。 應用程式會提供指定的自動播放內容動作。
uap:AutoPlayDevice 宣告類型為 *windows.autoPlayDevice 的應用程式擴充點。 應用程式會提供指定的自動播放裝置動作。
uap:DialProtocol 宣告 windows.dialProtocol*類型的應用程式擴充點。
uap:FileOpenPicker 宣告 windows.fileOpenPicker 類型的應用程式擴充點。 應用程式可讓使用者選擇並開啟指定的檔案類型。
uap:FileSavePicker 宣告 windows.fileSavePicker 類型的應用程式擴充點。 應用程式可讓使用者為指定的檔案類型選擇檔名、擴展名和儲存位置。
uap:FileTypeAssociation 宣告 windows.fileTypeAssociation 類型的應用程式擴充點。 檔類型關聯表示應用程式已註冊來處理指定類型的檔案。
uap:MediaPlayback 宣告 mediaPlayback 類型的應用程式擴充點,讓您的 app 可以宣告它執行視訊轉碼。
uap:Protocol 宣告 windows.protocol 類型的應用程式擴充點。 URI 關聯表示應用程式已註冊,以使用指定的配置來處理 URI。
uap:ShareTarget 宣告 windows.shareTarget 類型的應用程式擴充點。 應用程式可以共用指定的檔案類型。
uap:VoipCall 宣告 windows.voipCall 類型的應用程式擴充點,讓您的 app 可以宣告它可以執行從行動電話通話升級至 VoIP 視訊通話,以及/或它是否為支援直接撥打電話號碼的 VoIP 應用程式。
uap:WebAccountProvider 宣告 windows.webAccountProvider 類型的應用程式擴充點。

父元素

父元素 描述
延伸模組 (type:CT_ApplicationExtensions) 定義應用程式的一或多個擴充點。

備註

對於大部分的延伸模組類型,如果省略Application@ResourceGroup,Extension@ResourceGroup必須符合Application@ResourceGroup (,則也應該) 省略Extension@ResourceGroup。

針對UI型合約:如果未指定Extension@ResourceGroup,則會以應用程式隱含方式分組;如果Extension@ResourceGroup不符合Application@ResourceGroup則指令清單將會失敗架構驗證。

如果未針對背景工作或根據背景工作的合約指定Extension@ResourceGroup,則會與所有背景工作的預設群組相關聯。 背景工作合約允許指定與Application@ResourceGroup相同的值。

針對下列延伸模組,Extension@ResourceGroup允許執行的背景工作分組到不同的進程,這些進程將獨立於其他群組的資源和生命週期管理:windows.backgroundTasks、windows.appServiceswindows.preinstalledConfigTaskwindows.updateTask

例如,如果指令清單有這三個專案。

<Extension Category="windows.backgroundTasks" EntryPoint="Fabrikam.BackgroundTask" ResourceGroup="Group1">
  <BackgroundTasks>
    <Task Type="timer"/>
  </BackgroundTasks>
</Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Fabrikam.BackgroundTask2" ResourceGroup="Group2">
  <BackgroundTasks>
    <Task Type="controlChannel"/>
  </BackgroundTasks>
</Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Fabrikam.BackgroundTask3" ResourceGroup="Group2">
  <BackgroundTasks>
    <Task Type="pushNotification"/>
  </BackgroundTasks>
</Extension>

然後,如果同時啟用,最後兩個背景工作就會啟動到的相同實例 backgroundtaskhost.exe 中。 不過,backgroundtaskhost.exe 的個別實例會針對第一個專案啟動,因為它有不同的 ResourceGroup。

如果未為延伸模組指定任何 ResourceGroup,則會將所有背景工作啟動至相同的 實例 backgroundtaskhost.exe

此外,如果其中一個延伸模組 (windows.backgroundTasks、windows.appServiceswindows.preinstalledConfigTaskwindows.updateTask) 會指定父 Application 元素的 ResourceGroup 屬性值,它們將會在與 UI 相同的進程中啟動。

您可以在套件設計工具 UI 的 [宣告] 索引標籤中找到下列延伸模組 - 請參閱每個元素的描述:

  • 搜尋:將應用程式註冊為搜尋提供者。 應用程式的索引內容可能會以搜尋結果的形式出現在透過 搜尋 常用鍵啟動的 全域搜尋 體驗中。 每個應用程式只允許一個此宣告的執行個體。
  • CachedFileUpdater:將應用程式註冊為快取的檔案更新程式,允許應用程式提供其他 Microsoft Store 應用程式所存取之檔案的更新。 每個應用程式只允許一個此宣告的執行個體。
  • 相機設定:可讓應用程式提供 Web 相機裝置的自定義控制面板。 每個應用程式只允許一個此宣告的執行個體。
  • AccountPictureProvider:將應用程式註冊為帳戶圖片提供者,使其可在帳戶圖片模式中啟動,並設定用戶的圖片,而不需其他提示。 每個應用程式只允許一個此宣告的執行個體。
  • PrintTaskSettings:可讓應用程式取代基本列印設定體驗。 每個應用程式只允許一個此宣告的執行個體。
  • LockScreen:如果手機已鎖定,用戶可執行的互動量有限。 在某些情況下,使用者想要能夠在不解除鎖定電話的情況下接聽 VoIP 通話。 此合約可達成此動作。 每個應用程式只允許一個此宣告的執行個體。
  • 警示:應用程式可以將本身宣告為系統警示應用程式。 當使用者瀏覽選取 UI 來設定其系統警示時,只能選取宣告為系統警示應用程式的應用程式。 每個應用程式只允許一個此宣告的執行個體。
  • BackgroundTasks:背景工作可讓應用程式彼此通訊,並讓一個應用程式呼叫另一個應用程式。 若要使用合約來提供或啟動這些背景工作,必須將應用程式宣告為應用程式服務。 每個應用程式中允許有多個此宣告的執行個體。
  • Print3DWorkFlow:3D 印表機的製造商可以提供通用 Windows 應用程式,在 3D 列印對話框中提供獨特的體驗。 如果沒有,Windows 會提供預設的 3D 列印體驗。 每個應用程式只允許一個此宣告的執行個體。
  • PersonalAssistantLaunch:允許應用程式與 Cortana 整合。 每個應用程式只允許一個此宣告的執行個體。

規格需求

Item
rescap4 http://schemas.microsoft.com/appx/manifest/uap/windows10
uap10 http://schemas.microsoft.com/appx/manifest/uap/windows10/10
OS 最低版本 Windows 10 版本 1511 (組建 10586)