Explain when the packageManagement capability is required - #482
Explain when the packageManagement capability is required#482Roy (RDMacLachlan) wants to merge 2 commits into
Conversation
The PackageManager guidance in non-store-developer-updates.md referenced the packageManagement capability but was self-contradictory about when it's needed: the intro said it "must" be declared yet also that managing your own app works without it, and the manifest section made a blanket "to use the PackageManager APIs you must declare" statement. Replace that with a clear "When is the packageManagement capability required?" section that distinguishes: - Required for silent, non-interactive APIs (AddPackageAsync, AddPackageByAppInstallerFileAsync) and any cross-publisher operation. - Not required when updating your own app interactively via the Request* APIs (RequestAddPackageAsync, RequestAddPackageByAppInstallerFileAsync), which prompt the user for consent. Rework the intro and the manifest section to link to the new explanation and remove the contradiction. Bump ms.date. Resolves AB#25739271 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Learn Build status updates of commit 5dcc290: ✅ Validation status: passed
For more details, please refer to the build report. |
…FileAsync RequestAddPackageByAppInstallerFileAsync requires the packageManagement capability per its API reference, the same as AddPackageByAppInstallerFileAsync. Only RequestAddPackageAsync is capability-free. Correct the 'Not required' grouping that incorrectly listed both Request* APIs together. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3f91f4ac-92c5-4012-bacf-5f63908b8716
|
Learn Build status updates of commit fe98238: ✅ Validation status: passed
For more details, please refer to the build report. |
|
|
||
| The `packageManagement` capability is a [restricted capability](/windows/uwp/packaging/app-capability-declarations#restricted-capabilities), so declare it only when your scenario actually needs it: | ||
|
|
||
| - **Required** when your app silently adds, updates, stages, or removes packages by using the non-interactive [PackageManager](/uwp/api/windows.management.deployment.packagemanager) APIs, such as [AddPackageAsync](/uwp/api/windows.management.deployment.packagemanager.addpackageasync) or [AddPackageByAppInstallerFileAsync](/uwp/api/windows.management.deployment.packagemanager.addpackagebyappinstallerfileasync). |
There was a problem hiding this comment.
Remove 'silently'
Your app doesn't have to be quiet about it, just the fact you're using PackageManager (directly or indirectly) is the relevant factor
|
|
||
| The `packageManagement` capability is a [restricted capability](/windows/uwp/packaging/app-capability-declarations#restricted-capabilities), so declare it only when your scenario actually needs it: | ||
|
|
||
| - **Required** when your app silently adds, updates, stages, or removes packages by using the non-interactive [PackageManager](/uwp/api/windows.management.deployment.packagemanager) APIs, such as [AddPackageAsync](/uwp/api/windows.management.deployment.packagemanager.addpackageasync) or [AddPackageByAppInstallerFileAsync](/uwp/api/windows.management.deployment.packagemanager.addpackagebyappinstallerfileasync). |
There was a problem hiding this comment.
Only required if you're in an AppContainer
N/A if IntegrityLevel >= Medium AND Interaction user profile? Interactive session?
That means most unpackaged processes, most Centennial processes, all Win32alacarte (doesn't support AppContainer at all), anything running Elevated, ...
packageManagement (and packageQuery) capabilities are irrelevant if you're NOT in an AppContainer. The docs here seem old as if written in days of yore when only UWPs (running in AppContainers) roamed the earth...
This chapter and methinks the whole doc is in need of more radical surgery/rewrite
Resolves the doc bug reporting that the PackageManager documentation doesn't reference the
packageManagementcapability or explain when the capability is required (AB#25739271).Problem
non-store-developer-updates.mdreferenced the capability but was self-contradictory about when it's needed:packageManagement, yet also that "managing your own app should work without having to declare the capability."PackageManagerAPIs, your app must declare thepackageManagementcapability" — with no "when."That ambiguity is exactly what the bug reports.
Fix
Add a clear "When is the
packageManagementcapability required?" section that distinguishes:Request*APIs (RequestAddPackageAsync, RequestAddPackageByAppInstallerFileAsync), which prompt the user for consent.The intro and manifest section now link to this explanation and no longer contradict each other.
ms.datebumped.Related
Complements #481 (AB#25736442), which added
packageManagement/packageQuerycapability references to other conceptual pages; this PR supplies the authoritative when-required explanation on the primary page.