Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c616694
feat(windows): add support for windows uwp/appx capabilities
regnete Dec 9, 2025
34a5131
Merge remote-tracking branch 'electron-userland/master' into feat/win…
regnete Dec 9, 2025
53e4933
Merge branch 'electron-userland:master' into feat/windows-capabilities
regnete Dec 9, 2025
e0b77de
Merge branch 'master' into feat/windows-capabilities
regnete Dec 12, 2025
61dde96
Merge branch 'master' into feat/windows-capabilities
regnete Jan 19, 2026
e47eae4
Merge branch 'feat/windows-capabilities' of https://github.com/sitewa…
regnete Jan 19, 2026
bb7762e
optimization suggested by mmaietta
regnete Jan 19, 2026
b6aaaec
optimization suggested by mmaietta
regnete Jan 19, 2026
a44f0ca
removed unused namespaces
regnete Jan 19, 2026
377689c
updated
regnete Jan 19, 2026
6e8f22b
Create serious-doors-retire.md
regnete Jan 19, 2026
13caa27
code layout
regnete Jan 20, 2026
2ec9711
avoid double space in generated xml fragment
regnete Jan 20, 2026
8c1fa66
Merge branch 'electron-userland:master' into feat/windows-capabilities
regnete Jan 20, 2026
3fbebf3
validate capability names (https://github.com/electron-userland/elect…
regnete Jan 20, 2026
372e00b
tests for capability feature (https://github.com/electron-userland/el…
regnete Jan 20, 2026
83c0a75
fixed typo
regnete Jan 21, 2026
0ed5d58
fixed order of capabilities
regnete Jan 26, 2026
84d9613
fixed capability related test
regnete Jan 26, 2026
f65eb81
fixed compile errors
regnete Jan 27, 2026
f0c27b1
Merge branch 'electron-userland:master' into feat/windows-capabilities
regnete Jan 28, 2026
653db19
prettier
regnete Jan 28, 2026
7a8217d
Merge remote-tracking branch 'origin/feat/windows-capabilities' into …
regnete Jan 28, 2026
4849551
fixed appx capabilities order, removed uap11 namespace as not support…
regnete Jan 28, 2026
dca9e38
removed uap11 namespace as not supported by MakeAppx.exe
regnete Jan 28, 2026
5654d24
removed uap11 namespace as not supported by MakeAppx.exe
regnete Jan 28, 2026
2f9a5fb
fixed code style
regnete Jan 29, 2026
92b748c
Merge branch 'master' into feat/windows-capabilities
regnete Jan 29, 2026
2ca7e45
Merge branch 'master' into feat/windows-capabilities
regnete Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,15 @@
"description": "Relative path to custom extensions xml to be included in an `appmanifest.xml`.",
"type": "string"
},
"capabilities": {
"description": "windows uwp capabilities",
"type": "array",
"items": {
"type": "string"
}
},
"customManifestPath": {
"description": "(Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.\nSupports the following template macros:\n\n- ${publisher}\n- ${publisherDisplayName}\n- ${version}\n- ${applicationId}\n- ${identityName}\n- ${executable}\n- ${displayName}\n- ${description}\n- ${backgroundColor}\n- ${logo}\n- ${square150x150Logo}\n- ${square44x44Logo}\n- ${lockScreen}\n- ${defaultTile}\n- ${splashScreen}\n- ${arch}\n- ${resourceLanguages}\n- ${extensions}\n- ${minVersion}\n- ${maxVersionTested}",
"description": "(Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.\nSupports the following template macros:\n\n- ${publisher}\n- ${publisherDisplayName}\n- ${version}\n- ${applicationId}\n- ${identityName}\n- ${executable}\n- ${displayName}\n- ${description}\n- ${backgroundColor}\n- ${logo}\n- ${square150x150Logo}\n- ${square44x44Logo}\n- ${lockScreen}\n- ${defaultTile}\n- ${splashScreen}\n- ${arch}\n- ${resourceLanguages}\n- ${capabilities}\n- ${extensions}\n- ${minVersion}\n- ${maxVersionTested}",
"type": "string"
},
"displayName": {
Expand Down Expand Up @@ -7918,4 +7925,4 @@
}
},
"type": "object"
}
}
9 changes: 9 additions & 0 deletions packages/app-builder-lib/src/options/AppXOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export interface AppXOptions extends TargetSpecificOptions {
*/
readonly customExtensionsPath?: string

/**
* The list of [capabilities](https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations) to be added to an `appmanifest.xml`.
* The `runFullTrust` capability is obligatory for electron apps and will be auto added if not specified here.
* Defaults to `['runFullTrust']` if omitted
* Example: `['runFullTrust', 'privateNetworkClientServer', 'webcam']`
*/
readonly capabilities?: Array<string> | null

/**
* (Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.
* Supports the following template macros:
Expand All @@ -72,6 +80,7 @@ export interface AppXOptions extends TargetSpecificOptions {
* - ${splashScreen}
* - ${arch}
* - ${resourceLanguages}
* - ${capabilities}
* - ${extensions}
* - ${minVersion}
* - ${maxVersionTested}
Expand Down
286 changes: 286 additions & 0 deletions packages/app-builder-lib/src/targets/AppxCapabilities.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
export interface Capability {

Check warning on line 2 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Replace `⏎··readonly·nsAlias:string|` with `··readonly·nsAlias:·string·|·`
readonly nsAlias:string|null

/**
* see https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-capabilities
*/
readonly nsURI:string|null

Check warning on line 8 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Replace `string|` with `·string·|·`

readonly name:string

Check warning on line 10 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Insert `·`

toXMLString():string

Check warning on line 12 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Insert `·`
}

abstract class BaseCapability implements Capability{

Check warning on line 15 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Insert `·`

Check warning on line 16 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Replace `⏎··protected·constructor(public·readonly·nsAlias:` with `··protected·constructor(⏎····public·readonly·nsAlias:·`
protected constructor(public readonly nsAlias:string | null,
public readonly nsURI:string | null,

Check warning on line 18 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Replace `························public·readonly·nsURI:` with `····public·readonly·nsURI:·`
protected readonly elementName:string,

Check warning on line 19 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Replace `····················protected·readonly·elementName:` with `protected·readonly·elementName:·`
public readonly name:string) {

Check warning on line 20 in packages/app-builder-lib/src/targets/AppxCapabilities.ts

View workflow job for this annotation

GitHub Actions / test-mac-old (differentialUpdateTest,blackboxUpdateTest)

Replace `····················public·readonly·name:string)·{⏎··` with `public·readonly·name:·string⏎··)·{`
}

toXMLString(){
if(this.nsAlias)
return `<${this.nsAlias}:${this.elementName} Name="${this.name}"/>`;
return `<${this.elementName} Name="${this.name}"/>`;
}
}

abstract class NSBaseCapability extends BaseCapability{

protected constructor(nsAlias:string|null, nsURI:string, elementName:string, name:string) {
super(nsAlias, nsURI, elementName, name);
}

}

abstract class FoundationCapability extends NSBaseCapability{

protected constructor(elementName:string, name:string) {
// http://schemas.microsoft.com/appx/manifest/foundation/windows10
super(null, "http://schemas.microsoft.com/appx/manifest/foundation/windows10", elementName, name);
}
}

class CommonCapability extends FoundationCapability{

constructor(name:string) {
super("Capability", name);
}
}

/**
* https://learn.microsoft.com/de-de/uwp/schemas/appxpackage/how-to-specify-device-capabilities-in-a-package-manifest
*/
class DeviceCapability extends FoundationCapability{

constructor(name:string) {
super("DeviceCapability", name);
}
}



class UAPCapability extends NSBaseCapability{

constructor(name:string) {
super("uap", "http://schemas.microsoft.com/appx/manifest/uap/windows10", "Capability", name);
}
}

class UAP6Capability extends NSBaseCapability{

constructor(name:string) {
super("uap6", "http://schemas.microsoft.com/appx/manifest/uap/windows10/6", "Capability", name);
}
}

class UAP7Capability extends NSBaseCapability{

constructor(name:string) {
super("uap7", "http://schemas.microsoft.com/appx/manifest/uap/windows10/7", "Capability", name);
}
}

class UAP11Capability extends NSBaseCapability{

constructor(name:string) {
super("uap11", "http://schemas.microsoft.com/appx/manifest/uap/windows10/11", "Capability", name);
}
}

class MobileCapability extends NSBaseCapability{

constructor(name:string) {
super("mobile", "http://schemas.microsoft.com/appx/manifest/mobile/windows10", "Capability", name);
}
}

// class IOTCapability extends NSBaseCapability{
//
// constructor(name:string) {
// super('iot', '?????', 'Capability', name);
// }
// }

class ResCapCapability extends NSBaseCapability{

constructor(name:string) {
super("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities", "Capability", name);
}
}

// order matters
// see https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-capabilities

export const CAPABILITIES = [


new CommonCapability("internetClient"),
new CommonCapability("internetClientServer"),
new CommonCapability("privateNetworkClientServer"),
new CommonCapability("codeGeneration"), // ???
new CommonCapability("allJoyn"), // ???
new CommonCapability("backgroundMediaPlayback"),
new CommonCapability("remoteSystem"),
new CommonCapability("spatialPerception"),
new CommonCapability("userDataTasks"),
new CommonCapability("userNotificationListener"),


new UAPCapability("musicLibrary"),
new UAPCapability("picturesLibrary"),
new UAPCapability("videosLibrary"),
new UAPCapability("removableStorage"),
new UAPCapability("appointments"),
new UAPCapability("contacts"),
new UAPCapability("phoneCall"),
new UAPCapability("phoneCallHistoryPublic"),
new UAPCapability("userAccountInformation"),
new UAPCapability("voipCall"),
new UAPCapability("objects3D"),
new UAPCapability("chat"),
new UAPCapability("blockedChatMessages"),

new UAPCapability("enterpriseAuthentication"),
new UAPCapability("sharedUserCertificates"),

new UAPCapability("documentsLibrary"),



new DeviceCapability("location"),
new DeviceCapability("microphone"),
new DeviceCapability("webcam"),

new DeviceCapability("proximity"),

// new DeviceCapability("usb"), // not supported, needs nested elements
// new DeviceCapability("humaninterfacedevice"), // not supported, needs nested elements
new DeviceCapability("pointOfService"),
// new DeviceCapability("bluetooth"), // not supported, needs nested elements
new DeviceCapability("wiFiControl"),
new DeviceCapability("radios"),
new DeviceCapability("optical"),
new DeviceCapability("activity"),
new DeviceCapability("humanPresence"),
new DeviceCapability("serialcommunication"),
new DeviceCapability("gazeInput"),
new DeviceCapability("lowLevel"),

new DeviceCapability("packageQuery"), // correct namespace??


new MobileCapability("recordedCallsFolder"),

new ResCapCapability("enterpriseDataPolicy"),
new ResCapCapability("appCaptureSettings"),
new ResCapCapability("cellularDeviceControl"),
new ResCapCapability("cellularDeviceIdentity"),
new ResCapCapability("cellularMessaging"),
new ResCapCapability("deviceUnlock"),
new ResCapCapability("dualSimTiles"),
new ResCapCapability("enterpriseDeviceLockdown"),
new ResCapCapability("inputInjectionBrokered"),
new ResCapCapability("inputObservation"),
new ResCapCapability("inputSuppression"),
new ResCapCapability("networkingVpnProvider"),
new ResCapCapability("packageManagement"),
new ResCapCapability("screenDuplication"),
new ResCapCapability("userPrincipalName"),
new ResCapCapability("walletSystem"),
new ResCapCapability("locationHistory"),
new ResCapCapability("confirmAppClose"),
new ResCapCapability("phoneCallHistory"),
new ResCapCapability("appointmentsSystem"),
new ResCapCapability("chatSystem"),
new ResCapCapability("contactsSystem"),
new ResCapCapability("email"),
new ResCapCapability("emailSystem"),
new ResCapCapability("phoneCallHistorySystem"),
new ResCapCapability("smsSend"),
new ResCapCapability("userDataSystem"),
new ResCapCapability("previewStore"),
new ResCapCapability("firstSignInSettings"),
new ResCapCapability("teamEditionExperience"),
new ResCapCapability("remotePassportAuthentication"),
new ResCapCapability("previewUiComposition"),
new ResCapCapability("secureAssessment"),
new ResCapCapability("networkConnectionManagerProvisioning"),
new ResCapCapability("networkDataPlanProvisioning"),
new ResCapCapability("slapiQueryLicenseValue"),
new ResCapCapability("extendedBackgroundTaskTime"),
new ResCapCapability("extendedExecutionBackgroundAudio"),
new ResCapCapability("extendedExecutionCritical"),
new ResCapCapability("extendedExecutionUnconstrained"),
new ResCapCapability("deviceManagementDmAccount"),
new ResCapCapability("deviceManagementFoundation"),
new ResCapCapability("deviceManagementWapSecurityPolicies"),
new ResCapCapability("deviceManagementEmailAccount"),
new ResCapCapability("packagePolicySystem"),
new ResCapCapability("gameList"),
new ResCapCapability("xboxAccessoryManagement"),
new ResCapCapability("cortanaSpeechAccessory"),
new ResCapCapability("accessoryManager"),
new ResCapCapability("interopServices"),
new ResCapCapability("inputForegroundObservation"),
new ResCapCapability("oemDeployment"),
new ResCapCapability("oemPublicDirectory"),
new ResCapCapability("appLicensing"),
new ResCapCapability("locationSystem"),
new ResCapCapability("userDataAccountsProvider"),
new ResCapCapability("previewPenWorkspace"), // correct namespace??
new ResCapCapability("secondaryAuthenticationFactor"), // correct namespace??
new ResCapCapability("storeLicenseManagement"), // correct namespace??
new ResCapCapability("userSystemId"), // correct namespace??
new ResCapCapability("targetedContent"), // correct namespace??
new ResCapCapability("targetedContent"), // correct namespace??
new ResCapCapability("uiAutomation"), // correct namespace??
new ResCapCapability("gameBarServices"), // correct namespace??
new ResCapCapability("appCaptureServices"), // correct namespace??
new ResCapCapability("appBroadcastServices"), // correct namespace??
new ResCapCapability("audioDeviceConfiguration"), // correct namespace??
new ResCapCapability("backgroundMediaRecording"), // correct namespace??
new ResCapCapability("previewInkWorkspace"), // correct namespace??
new ResCapCapability("startScreenManagement"), // correct namespace??
new ResCapCapability("cortanaPermissions"), // correct namespace??
new ResCapCapability("allAppMods"), // correct namespace??
new ResCapCapability("expandedResources"), // correct namespace??
new ResCapCapability("protectedApp"), // correct namespace??
new ResCapCapability("gameMonitor"), // correct namespace??
new ResCapCapability("appDiagnostics"), // correct namespace??
new ResCapCapability("devicePortalProvider"), // correct namespace??
new ResCapCapability("enterpriseCloudSSO"), // correct namespace??
new ResCapCapability("backgroundVoIP"), // correct namespace??
new ResCapCapability("oneProcessVoIP"), // correct namespace??
new ResCapCapability("developmentModeNetwork"), // correct namespace??
new ResCapCapability("broadFileSystemAccess"), // correct namespace??
new ResCapCapability("smbios"), // correct namespace??
new ResCapCapability("runFullTrust"),
new ResCapCapability("allowElevation"),
new ResCapCapability("teamEditionDeviceCredential"),
new ResCapCapability("teamEditionView"),
new ResCapCapability("cameraProcessingExtension"),
new ResCapCapability("networkDataUsageManagement"),
new ResCapCapability("phoneLineTransportManagement"),
new ResCapCapability("unvirtualizedResources"),
new ResCapCapability("modifiableApp"),
new ResCapCapability("packageWriteRedirectionCompatibilityShim"),
new ResCapCapability("customInstallActions"),
new ResCapCapability("packagedServices"),
new ResCapCapability("localSystemServices"),
new ResCapCapability("backgroundSpatialPerception"),
new ResCapCapability("uiAccess"),

new UAP6Capability("graphicsCapture"),

new UAP7Capability("globalMediaControl"),

new UAP11Capability("graphicsCaptureWithoutBorder"),
new UAP11Capability("graphicsCaptureProgrammatic"),

];



Loading
Loading