Skip to content

feat(windows): capabilities#9437

Merged
mmaietta merged 29 commits intoelectron-userland:masterfrom
sitewaerts:feat/windows-capabilities
Jan 31, 2026
Merged

feat(windows): capabilities#9437
mmaietta merged 29 commits intoelectron-userland:masterfrom
sitewaerts:feat/windows-capabilities

Conversation

@regnete
Copy link
Contributor

@regnete regnete commented Dec 9, 2025

This pull request adresses issue #9436.

It adds the optional config property capabilities to AppxOptions. Docs, schema and template are modified according to that.

Should be easy to take this over into the next release.

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 2ca7e45

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Major
dmg-builder Major
electron-builder-squirrel-windows Major
electron-builder Major
electron-forge-maker-appimage Major
electron-forge-maker-nsis-web Major
electron-forge-maker-nsis Major
electron-forge-maker-snap Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@regnete regnete changed the title Feat/windows capabilities feat/windows capabilities Dec 9, 2025
@regnete regnete changed the title feat/windows capabilities feat(windows): capabilities Dec 9, 2025
Copy link
Collaborator

@mmaietta mmaietta left a comment

Choose a reason for hiding this comment

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

Please also generate a changeset for the CHANGELOG and CI/CD to pick it up. You can use pnpm generate-changeset for CLI

@mmaietta mmaietta linked an issue Dec 12, 2025 that may be closed by this pull request
@regnete
Copy link
Contributor Author

regnete commented Dec 12, 2025

Thanks for the quick response to this pr. I will continue to work on this in the next week.

@regnete
Copy link
Contributor Author

regnete commented Jan 19, 2026

I followed your suggestions and fullfilled the posted requirements. Ready for merge now?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for configuring Windows UWP/APPX capabilities through the build configuration, addressing issue #9436. It introduces an optional capabilities array property to AppxOptions that allows developers to specify which Windows capabilities their application needs, with runFullTrust automatically included as it's required for Electron apps.

Changes:

  • Added new AppxCapabilities.ts module defining all supported Windows UWP capabilities with proper namespace handling and XML generation
  • Modified AppxTarget.ts to generate capabilities XML from configuration and ensure runFullTrust is always included
  • Updated documentation, TypeScript types, and JSON schema to include the new capabilities configuration option

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/app-builder-lib/src/targets/AppxCapabilities.ts New file defining capability types, namespace configurations, and XML generation logic for all supported Windows UWP capabilities
packages/app-builder-lib/src/targets/AppxTarget.ts Added getCapabilities() method to generate capabilities XML, imported CAPABILITIES constant, improved error messages, added trim() to language processing
packages/app-builder-lib/src/options/AppXOptions.ts Added capabilities property with documentation explaining usage and default behavior
packages/app-builder-lib/scheme.json Added JSON schema definition for capabilities array property
packages/app-builder-lib/templates/appx/appxmanifest.xml Replaced hardcoded Capabilities section with ${capabilities} template variable
.changeset/serious-doors-retire.md Added changeset documenting the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mmaietta
Copy link
Collaborator

Looks like there's some compiler errors:

Error: test/src/windows/appxTest.ts(2,9): error TS6133: 'outputFile' is declared but its value is never read.
Error: test/src/windows/appxTest.ts(5,40): error TS6133: 'linuxDirTarget' is declared but its value is never read.
Error: test/src/windows/appxTest.ts(6,1): error TS6133: 'fs' is declared but its value is never read.

@mmaietta
Copy link
Collaborator

Error:   32:7   error    Expected { after 'if' condition  curly

Please validate code with pnpm compile and pnpm generate-all to make sure prettier also runs.

@mmaietta
Copy link
Collaborator

removed uap11 namespace as not supported by MakeAppx.exe

I saw your commit. Is this due to an outdated MakeAppx.exe?

I'm currently updating the toolsets in electron-builder, including makeappx, but those updates are targeting v27 release cut.

@regnete
Copy link
Contributor Author

regnete commented Jan 28, 2026

I don't know if current or future versions of makeappx support that.

I think that namespace is not relevant for electron apps. So I decided to skip support.

I want to get this PR done now.

@mmaietta
Copy link
Collaborator

> eslint packages test/src --ext .ts,.js


/Users/runner/work/electron-builder/electron-builder/packages/app-builder-lib/src/targets/AppxCapabilities.ts
Error:   31:25  error  Expected { after 'if' condition             curly
Error:   31:25  error  Expected a linebreak before this statement  nonblock-statement-body-position

@regnete
Copy link
Contributor Author

regnete commented Jan 29, 2026

> eslint packages test/src --ext .ts,.js


/Users/runner/work/electron-builder/electron-builder/packages/app-builder-lib/src/targets/AppxCapabilities.ts
Error:   31:25  error  Expected { after 'if' condition             curly
Error:   31:25  error  Expected a linebreak before this statement  nonblock-statement-body-position

Sorry for that regression, but pnpm generate-all did'n't fix that.

What about adding a special script for contributors to validate code before commit/push?
That script should then be mentioned in CONTRIBUTING.md / Pull Requests.

package.json

{
"scripts": {
    "validate": "pnpm compile && pnpm generate-all && pnpm lint"
  }
}

@regnete regnete closed this Jan 29, 2026
@regnete regnete reopened this Jan 29, 2026
@mmaietta
Copy link
Collaborator

What about adding a special script for contributors to validate code before commit/push?

I like this idea. The project used to use husky, but the pre-commit hook would take a minute to run on my windows VM, so I got rid of it. At least a generic command in package.json would help with development. Can add a reminder to the PR template as well?

@regnete
Copy link
Contributor Author

regnete commented Jan 30, 2026

What about adding a special script for contributors to validate code before commit/push?

I like this idea. The project used to use husky, but the pre-commit hook would take a minute to run on my windows VM, so I got rid of it. At least a generic command in package.json would help with development. Can add a reminder to the PR template as well?

Reminder sounds good.

I work on windows too. I found out, tthat I have to add endOfLine: crlf to .prettierrc.yaml. Git performs line ending conversion during checkout/commit. But without this settings prettier converst all line endings to LF, which is a hassle when finding out what to commit. A note on that in the docs would be cool too.

The currently failing checks are MAC only. I didn't change code for MAC so those issues are not related to this PR.

@mmaietta mmaietta merged commit 3fa2d89 into electron-userland:master Jan 31, 2026
53 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Windows UWP/APPX Capabilities

3 participants