uap:Extension (Windows 10)

声明应用的扩展点。

元素层次结构

<包>

    <应用程序>

         <应用程序>

              <扩展>

                   <uap:Extension>

语法

<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.fileOpenPickerwindows.fileSavePickerwindows.cachedFileUpdaterwindows.cameraSettingswindows.accountPictureProviderwindows.printTaskSettingswindows.lockScreenCallwindows.appointmentsProviderwindows.alarmwindows.webAccountProviderwindows.dialProtocolwindows.appServicewindows.mediaPlaybackwindows.print3DWorkflowwindows.lockScreenwindows.aboveLockScreenwindows.personalAssistantLaunchwindows.voipCall
EntryPoint 可激活的类 ID。 值长度介于 1 到 256 个字符之间的字符串。 表示处理扩展的任务,通常 (Windows 运行时类型) 的完全命名空间限定名称。 如果未指定 EntryPoint,则改用为应用定义的 EntryPoint。
可执行文件 默认启动可执行文件。 值长度介于 1 到 256 个字符之间的字符串,必须以 .exe结尾,并且不能包含以下字符:<>:"|?、 或 *。 指定扩展的默认可执行文件。 如果未指定,则使用为应用定义的可执行文件。 如果指定,则还使用 EntryPoint 属性。 如果未指定该 EntryPoint 属性,则使用为应用定义的 EntryPoint。
RuntimeType 运行时提供程序。 通常在应用中存在混合框架时使用。 长度介于 1 到 255 个字符之间的值的字符串,不能以 . 开头或结尾,或包含字符:<>:"|?、 或 *
StartPage 处理扩展点的网页。 值长度介于 1 到 256 个字符之间的字符串,不能包含以下字符:<>:"|?、 或 *
ResourceGroup 一个可选标记,用于将扩展激活组合在一起以进行资源管理 (例如 CPU 和内存) 。 请参阅 Application@ResourceGroup 中的“备注”部分。 长度介于 1 到 255 个字符之间的字母数字字符串。 必须以字母开头。
uap10:TrustLevel 指定扩展的信任级别。 可选的字符串值。 如果指定,它可以是以下值之一: appContainermediumIL
uap10:RuntimeBehavior 指定扩展的运行时行为。 可选的字符串值。 如果指定,它可以是以下值之一: windowsApppackagedClassicAppwin32App
uap10:HostId 指定扩展的主机运行时的 ID。 一个字母数字字符串,其可选值长度介于 1 到 255 个字符之间。 必须以字母开头。
uap10:Parameters 包含要传递给扩展的命令行参数。 仅桌面应用支持。 值长度介于 1 到 32767 个字符之间的字符串,开头和结尾处有一个非空格字符。
uap11:Id 扩展的标识符。 对于包中的所有扩展,ID 必须是唯一的。 值长度介于 1 到 255 个字符之间的可选字符串,开头和结尾处有一个非空格字符。
uap11:Subsystem 此属性继承自基本扩展语法,不适用于 com4 扩展。 除语法验证外,此值将被忽略。 可具有以下值之一的可选字符串: consolewindows
uap11:SupportsMultipleInstances 指定实例是否应在不同的进程中运行。 默认值为 false。 可选的布尔值。
uap11:ResourceGroup 一个标记,可用于将扩展激活组合在一起以进行资源管理, (例如 CPU 和内存) 。 可以设置的 ResourceGroup 值是自由格式且灵活的。 请参阅 Application@ResourceGroup 值长度介于 1 到 255 个字符之间的可选字母数字字符串。 必须以字母开头。
uap11:CurrentDirectoryPath 指定启动应用程序进程时的初始目录。 此属性支持宏。 有关详细信息,请参阅 包清单架构中的宏 不能包含以下字符的可选字符串:<>|?、 或 *。 >
uap11:Parameters 此属性继承自基本扩展语法,不适用于 com4 扩展。 除语法验证外,此值将被忽略。 此属性支持宏。 有关详细信息,请参阅 包清单架构中的宏 一个可选字符串,其值长度在 1 到 32767 个字符之间,开头和结尾处有一个非空格字符。
desktop7:CompatMode 指定是否以经典方式向 Windows 注册此扩展的信息, (例如,未打包的应用通过注册表) 向 COM 注册类型,还是以范围更广的新方式注册类型。 默认值为“modern”。 CompatMode=“classic” 需要 Microsoft.classicAppCompat_8wekyb3d8bbwe 功能。 可选的字符串 可以具有以下值之一: 经典新式
desktop7:Scope 指定注册是否仅对以用户 (用户) 注册此包的用户身份运行的其他应用程序可见,或者它们是否对计算机上的所有用户和服务可见, (计算机) 。 默认值为“user”。 Scope=“machine”需要 Microsoft.classicAppCompatElevated_8wekyb3d8bbwe 功能。 可具有以下值之一的可选字符串: machineuser

子元素

子元素 描述
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 类型的应用扩展点,以便应用可以声明它执行视频转码。
uap:Protocol 声明 windows.protocol 类型的应用扩展点。 URI 关联指示应用已注册以使用指定方案处理 URI。
uap:ShareTarget 声明 类型为 windows.shareTarget 的应用扩展点。 应用可以共享指定类型的文件。
uap:VoipCall 声明 windows.voipCall 类型的应用扩展点,以便你的应用可以声明它可以执行从手机网络呼叫到 VoIP 视频呼叫的升级,以及/或它是否是支持直接拨打电话号码的 VoIP 应用。
uap:WebAccountProvider 声明 类型为 windows.webAccountProvider 的应用扩展点。

父元素

父元素 描述
扩展 (类型:CT_ApplicationExtensions) 定义应用的一个或多个扩展点。

注解

对于大多数扩展类型,Extension@ResourceGroup必须与Application@ResourceGroup (如果省略Application@ResourceGroup,则) 还应省略Extension@ResourceGroup。

对于基于 UI 的协定:如果未指定Extension@ResourceGroup,则它将与应用程序隐式分组;如果Extension@ResourceGroup不匹配Application@ResourceGroup则清单将无法通过架构验证。

如果未为后台任务或基于后台任务的协定指定Extension@ResourceGroup,则它将与所有后台任务的默认组相关联。 允许后台任务协定指定与Application@ResourceGroup相同的值。

对于以下扩展,Extension@ResourceGroup允许将运行的后台任务分组到不同的进程中,这些进程独立于其他组进行资源和生命周期管理: windows.backgroundTaskswindows.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.backgroundTaskswindows.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 集成。 每个应用程序只允许有一个此声明的实例。

要求

rescap4 http://schemas.microsoft.com/appx/manifest/uap/windows10
uap10 http://schemas.microsoft.com/appx/manifest/uap/windows10/10
Minimum OS Version Windows 10版本 1511 (内部版本 10586)