Skip to content

Explain when the packageManagement capability is required - #482

Open
Roy (RDMacLachlan) wants to merge 2 commits into
MicrosoftDocs:mainfrom
RDMacLachlan:users/romaclac/docbug-25739271
Open

Explain when the packageManagement capability is required#482
Roy (RDMacLachlan) wants to merge 2 commits into
MicrosoftDocs:mainfrom
RDMacLachlan:users/romaclac/docbug-25739271

Conversation

@RDMacLachlan

Copy link
Copy Markdown
Collaborator

Resolves the doc bug reporting that the PackageManager documentation doesn't reference the packageManagement capability or explain when the capability is required (AB#25739271).

Problem

non-store-developer-updates.md referenced the capability but was self-contradictory about when it's needed:

  • The intro said the app "must declare" packageManagement, yet also that "managing your own app should work without having to declare the capability."
  • The manifest section made a blanket claim: "To use the PackageManager APIs, your app must declare the packageManagement capability" — with no "when."

That ambiguity is exactly what the bug reports.

Fix

Add a clear "When is the packageManagement capability required?" section that distinguishes:

The intro and manifest section now link to this explanation and no longer contradict each other. ms.date bumped.

Related

Complements #481 (AB#25736442), which added packageManagement / packageQuery capability references to other conceptual pages; this PR supplies the authoritative when-required explanation on the primary page.

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-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 5dcc290:

✅ Validation status: passed

File Status Preview URL Details
msix-src/non-store-developer-updates.md ✅Succeeded

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-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit fe98238:

✅ Validation status: passed

File Status Preview URL Details
msix-src/non-store-developer-updates.md ✅Succeeded

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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants