Skip to content

Commit c8694da

Browse files
authored
clearing up which types of app caps apply to (#3729)
1 parent 65b2ff8 commit c8694da

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

uwp/packaging/app-capability-declarations.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,53 @@
11
---
22
title: App capability declarations
3-
description: Capabilities must be declared in your Windows app's package manifest to access certain API or resources like pictures, music, or devices like the camera or the microphone.
4-
ms.date: 12/16/2022
3+
description: To access certain APIs or resources (such as pictures or music), or devices (such as the camera or the microphone), you must declare app capabilities in your Windows app's package manifest.
4+
ms.date: 08/18/2023
55
ms.topic: article
6-
keywords: windows 10, uwp
6+
keywords: windows 11, windows 10, uwp
77
ms.localizationpriority: medium
88
ms.custom: 19H1
99
ms.assetid: 25B18BA5-E584-4537-9F19-BB2C8C52DFE1
1010
---
1111

1212
# App capability declarations
1313

14-
Capabilities must be declared in your Windows app's [package manifest](/uwp/schemas/appxpackage/appx-package-manifest) to access certain Windows APIs or resources, such as pictures, music, or devices such as the camera or the microphone. Capabilities are used by UWP apps as well as other types of desktop apps that are packaged in an MSIX or AppX package for Windows.
14+
## Which kinds of apps do app capabilities apply to?
1515

16-
You request access to specific resources or API by declaring capabilities in your app's [package manifest](/uwp/schemas/appxpackage/appx-package-manifest). You can declare general capabilities by using the [Manifest Designer](/windows/msix/package/packaging-uwp-apps#configure-your-project) in Visual Studio, or you can add them manually. For more information, see [How to specify capabilities in a package manifest](/uwp/schemas/appxpackage/how-to-specify-capabilities-in-a-package-manifest). It is important to know that when customers get your app from the Store, they're notified of all the capabilities that the app declares. Avoid declaring capabilities that your app doesn't need.
16+
*Most* scenarios for app capabilities are relevant only to apps that have package identity, and that run in an AppContainer. All UWP apps meet those criteria; so capabilities apply to them. But you can also give a desktop app package identity, and configure it as an AppContainer app. So capabilities apply to some desktop apps, too.
1717

18-
Some capabilities provide apps with access to a *sensitive resource*. These resources are considered sensitive because they can access the user's personal data or cost the user money. Privacy settings, managed by the Settings app, let the user dynamically control access to sensitive resources. Thus, it's important that your app doesn't assume a sensitive resource is always available. For more info about accessing sensitive resources, see [Security](../security/index.md). Capabilities that provide apps with access to a *sensitive resource* are annotated by an asterisk (\*) next to the capability scenario.
18+
* For more info about packaging and *package identity*, see [Deployment overview](/windows/apps/package-and-deploy/).
19+
* For more info about AppContainer apps, see [AppContainer for legacy apps](/windows/win32/secauthz/appcontainer-for-legacy-applications-).
1920

20-
There are several types of capabilities.
21+
A desktop app that's an AppContainer app can be identified by `uap10:TrustLevel="appContainer"` in its app package manifest (for more info, see [Application (Windows 10)](/uwp/schemas/appxpackage/uapmanifestschema/element-application)). Similarly, a desktop app with *mediumIL* (an integrity level of medium) has `uap10:TrustLevel="mediumIL"`. Medium IL apps—which are also known as *full trust apps*—don't run in an AppContainer.
22+
23+
The **internetClient** and **enterpriseAuthentication** capabilities grant an application the ability to perform certain operations that the user can already do. So those are examples of capabilities that apply only to AppContainer apps. Conversely, a Medium IL app is already running as the user; so an app like that can already perform those operations without requiring those capabilities.
24+
25+
But there are some scenarios where a Medium IL app should declare a capability, too. In fact, a Medium IL app *needs* to declare the **runFullTrust** restricted capability. And, to be able to register out-of-process COM servers for inter-process communication (IPC), a packaged app needs **runFullTrust**. That feature is known as *Packaged COM* (for more info, see the blog post [COM Server and OLE Document support for the Desktop Bridge](https://blogs.windows.com/windowsdeveloper/2017/04/13/com-server-ole-document-support-desktop-bridge/)).
26+
27+
For info about another scenario that applies even to Medium IL apps, see [Privacy-sensitive capabilities](#privacy-sensitive-capabilities) in this topic.
28+
29+
You can determine whether your app package manifest needs **runFullTrust** simply by building your package. `Makeappx.exe` will validate the schema, and if **runFullTrust** isn't declared but something needs it, then you'll see a detailed error message including what the problem is, together with line and column numbers.
30+
31+
## Declaring capabilities
32+
33+
If you want to access certain APIs or resources (such as pictures or music), or devices (such as the camera or the microphone), then you must declare the appropriate app capabilities in your Windows app's [package manifest](/uwp/schemas/appxpackage/appx-package-manifest)
34+
35+
You can declare general capabilities by using the [Manifest Designer](/windows/msix/package/packaging-uwp-apps#configure-your-project) in Visual Studio; or you can add them manually. For more info, see [How to specify capabilities in a package manifest](/uwp/schemas/appxpackage/how-to-specify-capabilities-in-a-package-manifest). It's important to know that when customers get your app from the Microsoft Store, they're notified of all the capabilities that the app declares. So be sure to declare only the capabilities that your app needs.
36+
37+
## Privacy-sensitive capabilities
38+
39+
A *sensitive resource* is a resource that can access the user's personal data, or cost the user money. In this topic, capabilities that provide apps with access to a *sensitive resource* are annotated by an asterisk (\*) in the **Capability scenario** column.
40+
41+
Privacy-sensitive capabilities signal to the operating system (OS)—and to the user—what the app intends to do. Since it's good to send this signal to the users of your app, we recommend that you declare privacy-sensitive capabilities *even for Medium IL apps* (where the application identity is used to provide individual privacy toggles). Doing so allows those apps to be managed in the privacy settings pages (managed by the Windows **Settings** app) as soon as they're installed; as opposed to later, when they access privacy-sensitive resources.
42+
43+
Those privacy settings let the user dynamically control access to sensitive resources. Thus, it's important that your app doesn't assume that a sensitive resource is always available. For more info about accessing sensitive resources, see [Security](../security/index.md).
44+
45+
## Different kinds of capabilities
46+
47+
There are several kinds of capabilities.
2148

2249
- [General-use capabilities](#general-use-capabilities), which apply to most common app scenarios.
23-
- [Device capabilities](#device-capabilities), which allow your app to access peripheral and internal devices.
50+
- [Device capabilities](#device-capabilities), which allow your app to access internal and peripheral devices.
2451
- [Restricted capabilities](#restricted-capabilities), which require approval for Microsoft Store submission and/or are generally only available to Microsoft and certain partners.
2552
- [Custom capabilities](#custom-capabilities).
2653

0 commit comments

Comments
 (0)