提供向应用包外部客户端公开 COM 注册的功能。
元素层次结构
<Package>
└─ <Extensions>
└─ <com2:Extension>
└─ <Applications>
└─ <Application>
└─ <Extensions>
└─ <com2:Extension>
语法
<com2:Extension
Category = 'A required string that can have one of the following values: "windows.comServer", or "windows.comInterface".'
Executable = 'An optional string between 1 and 256 characters in length that must end with ".exe" and cannot contain these characters: <, >, :, ", |, ?, or *.'
EntryPoint = 'An optional string between 1 and 256 characters in length that cannot start or end with a whitespace character.'
RuntimeType = 'An optional string between 1 and 255 characters in length that cannot start or end with a period or contain these characters: <, >, :, ", /, \, |, ?, or *.'
StartPage = 'An optional string between 1 and 256 characters in length that cannot contain these characters: <, >, :, ", |, ?, or *.'
ResourceGroup = 'An optional alphanumeric string between 1 and 255 characters in length. Must begin with an alphabetic character.'
uap10:TrustLevel = 'An optional string that can have one of the following values: "appContainer", or "mediumIL".'
uap10:RuntimeBehavior = 'An optional string that can have one of the following values: "windowsApp", "packagedClassicApp", or "win32App".'
uap10:HostId = 'An optional alphanumeric string between 1 and 255 characters in length. Must begin with an alphabetic character.'
uap10:Parameters = 'An optional string between 1 and 32767 characters in length with a non-whitespace character at its beginning and end.'
uap11:Id = 'An optional string 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 between 1 and 255 characters in length. Must begin with an alphabetic character.'
uap11:CurrentDirectoryPath = 'An optional string that cannot contain these characters: <, >, |, ?, or *.'
uap11:Parameters = 'An optional string between 1 and 32767 characters in length with a non-whitespace character at its beginning and end.'
desktop7:CompatMode = 'An optional string that 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 -->
com2:ComServer?
com2:ComInterface?
</com2:Extension>
Key
? 可选(零或一)
属性
| 属性 |
描述 |
数据类型 |
必填 |
默认值 |
|
类别 |
扩展的类型。 |
必须是下列值之一的字符串:windows.comServer、windows.comInterface(in );Applicationwindows.comServer, windows.comInterface (in Package) 。 |
是的 |
|
|
可执行文件 |
默认启动可执行文件。 |
长度为 1 到 256 个字符的可选字符串,必须以“.exe”结尾,不能包含以下字符: <、、:、、 >|、?或 *。 |
不 |
|
|
EntryPoint |
可激活的类 ID。 |
长度介于 1 到 256 个字符之间的可选字符串,不能以空格字符开头或结尾。 |
不 |
|
|
RuntimeType |
运行时提供程序。 通常在应用中存在混合框架时使用。 |
长度为 1 到 255 个字符的可选字符串,长度不能以句点开头或结尾,或者包含以下字符: <、、:、、 >“、/、|、?或 *。 |
不 |
|
|
StartPage |
负责处理扩展点的网页。 |
长度为 1 到 256 个字符的可选字符串,不能包含以下字符: <、、:、: >、、“、|、?或 *。 |
不 |
|
|
ResourceGroup |
一个标记,可用于将扩展激活组合在一起以进行资源管理(例如 CPU 和内存)。 |
长度介于 1 到 255 个字符之间的可选字母数字字符串。 必须以字母字符开头。 |
不 |
|
|
uap10:TrustLevel |
指定扩展的信任级别。 |
可以具有以下值之一的可选字符串: appContainer、 mediumIL。 |
不 |
|
|
uap10:RuntimeBehavior |
指定扩展的运行时行为。 |
一个可选字符串,可以具有以下值之一: windowsApp、 packagedClassicApp、 win32App。 |
不 |
|
|
uap10:HostId |
指定扩展的主机运行时的 ID。 |
长度介于 1 到 255 个字符之间的可选字母数字字符串。 必须以字母字符开头。 |
不 |
|
|
uap10:Parameters |
包含要传递给扩展的命令行参数。 仅支持具有包标识的桌面应用。 |
长度为 1 到 32767 个字符的可选字符串,其开头和结尾为非空格字符。 |
不 |
|
|
uap11:Id |
扩展的标识符。 ID 对于包中的所有扩展必须是唯一的。 |
长度为 1 到 255 个字符的可选字符串,其开头和结尾有非空格字符。 |
不 |
|
|
uap11:Subsystem |
此属性对于需要使用特定子系统启动的非 UWP 进程非常有用。 在大多数情况下,这应保留为默认值。 |
一个可选字符串,可以具有以下值之一: 控制台、 窗口。 |
不 |
|
|
uap11:SupportsMultipleInstances |
指定扩展是否支持多个实例。 |
可选的布尔值。 |
不 |
|
|
uap11:ResourceGroup |
一个标记,可用于将扩展激活组合在一起以进行资源管理(例如 CPU 和内存)。 |
长度介于 1 到 255 个字符之间的可选字母数字字符串。 必须以字母字符开头。 |
不 |
|
|
uap11:CurrentDirectoryPath |
指定启动进程时的初始目录。 |
不能包含以下字符的可选字符串: <、、| >、?或 *。 |
不 |
|
|
uap11:Parameters |
包含要传递给扩展的命令行参数。 |
长度为 1 到 32767 个字符的可选字符串,其开头和结尾为非空格字符。 |
不 |
|
|
desktop7:CompatMode |
指定扩展的兼容性模式。 |
一个可选字符串,可以具有以下值之一: 经典、 新式。 |
不 |
|
|
desktop7:范围 |
指定扩展是按用户还是每台计算机。 |
一个可选字符串,可以具有以下值之一: 计算机、 用户。 |
不 |
|
子元素
| 子元素 |
描述 |
|
com2:ComServer |
声明 windows.comServer 类型的包扩展点。
comServer 扩展可能包括以下类型的注册:ServiceServer、ExeServer、SurrogateServer、ProgId 或 TreatAsClass。 |
|
com2:ComInterface |
声明 windows.comInterface 类型的包扩展点。 comInterface 扩展可能包括三种类型的注册: Interface、 ProxyStub 或 TypeLib。 |
父元素
要求
| 项目 |
价值 |
|
命名空间 |
http://schemas.microsoft.com/appx/manifest/com/windows10/2 |
|
desktop7 |
http://schemas.microsoft.com/appx/manifest/desktop/windows10/7 |
|
uap10 |
http://schemas.microsoft.com/appx/manifest/uap/windows10/10 |
|
uap11 |
http://schemas.microsoft.com/appx/manifest/uap/windows10/11 |
|
最低 OS 版本 |
Windows 10版本 1709 (内部版本 16299) |
示例