app-builder-lib 26.6.0 → 26.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/codeSign/windowsSignToolManager.d.ts +4 -5
- package/out/codeSign/windowsSignToolManager.js +76 -86
- package/out/codeSign/windowsSignToolManager.js.map +1 -1
- package/out/configuration.d.ts +34 -0
- package/out/configuration.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js.map +1 -1
- package/out/linuxPackager.js +1 -1
- package/out/linuxPackager.js.map +1 -1
- package/out/macPackager.js +0 -1
- package/out/macPackager.js.map +1 -1
- package/out/node-module-collector/index.d.ts +1 -2
- package/out/node-module-collector/nodeModulesCollector.d.ts +2 -18
- package/out/node-module-collector/nodeModulesCollector.js +38 -73
- package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/npmNodeModulesCollector.js +11 -7
- package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/types.d.ts +0 -4
- package/out/node-module-collector/types.js.map +1 -1
- package/out/node-module-collector/yarnNodeModulesCollector.d.ts +4 -10
- package/out/node-module-collector/yarnNodeModulesCollector.js +7 -197
- package/out/node-module-collector/yarnNodeModulesCollector.js.map +1 -1
- package/out/options/AppXOptions.d.ts +8 -0
- package/out/options/AppXOptions.js.map +1 -1
- package/out/options/macOptions.d.ts +12 -0
- package/out/options/macOptions.js.map +1 -1
- package/out/targets/AppxCapabilities.d.ts +8 -0
- package/out/targets/AppxCapabilities.js +258 -0
- package/out/targets/AppxCapabilities.js.map +1 -0
- package/out/targets/AppxTarget.d.ts +1 -0
- package/out/targets/AppxTarget.js +32 -14
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/FpmTarget.js +3 -3
- package/out/targets/FpmTarget.js.map +1 -1
- package/out/targets/MsiWrappedTarget.js +4 -3
- package/out/targets/MsiWrappedTarget.js.map +1 -1
- package/out/targets/appimage/AppImageTarget.d.ts +16 -0
- package/out/targets/{AppImageTarget.js → appimage/AppImageTarget.js} +65 -28
- package/out/targets/appimage/AppImageTarget.js.map +1 -0
- package/out/targets/appimage/appImageUtil.d.ts +23 -0
- package/out/targets/appimage/appImageUtil.js +266 -0
- package/out/targets/appimage/appImageUtil.js.map +1 -0
- package/out/targets/appimage/appLauncher.d.ts +3 -0
- package/out/targets/appimage/appLauncher.js +91 -0
- package/out/targets/appimage/appLauncher.js.map +1 -0
- package/out/targets/archive.js +2 -2
- package/out/targets/archive.js.map +1 -1
- package/out/toolsets/linux.d.ts +9 -0
- package/out/toolsets/linux.js +68 -0
- package/out/toolsets/linux.js.map +1 -0
- package/out/toolsets/windows.d.ts +42 -0
- package/out/toolsets/windows.js +143 -0
- package/out/toolsets/windows.js.map +1 -0
- package/out/util/packageMetadata.js +9 -5
- package/out/util/packageMetadata.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/out/winPackager.js +4 -3
- package/out/winPackager.js.map +1 -1
- package/package.json +9 -9
- package/scheme.json +78 -1
- package/templates/appx/appxmanifest.xml +1 -3
- package/templates/linux/after-install.tpl +1 -1
- package/out/targets/AppImageTarget.d.ts +0 -14
- package/out/targets/AppImageTarget.js.map +0 -1
- package/out/targets/tools.d.ts +0 -2
- package/out/targets/tools.js +0 -46
- package/out/targets/tools.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppXOptions.js","sourceRoot":"","sources":["../../src/options/AppXOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\nexport interface AppXOptions extends TargetSpecificOptions {\n /**\n * The application id. Defaults to `identityName`. This string contains alpha-numeric fields separated by periods. Each field must begin with an ASCII alphabetic character.\n */\n readonly applicationId?: string\n\n /**\n * The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).\n * @default #464646\n */\n readonly backgroundColor?: string | null\n\n /**\n * A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\n * Defaults to the application product name.\n */\n readonly displayName?: string | null\n\n /**\n * The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](./configuration.md#metadata).\n */\n readonly identityName?: string | null\n\n /**\n * The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.\n */\n readonly publisher?: string | null\n\n /**\n * A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).\n * Defaults to company name from the application metadata.\n */\n readonly publisherDisplayName?: string | null\n\n /**\n * The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.\n * The first entry (index 0) will be the default language.\n * Defaults to en-US if omitted.\n */\n readonly languages?: Array<string> | string | null\n\n /**\n * Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.\n */\n readonly addAutoLaunchExtension?: boolean\n\n /**\n * Relative path to custom extensions xml to be included in an `appmanifest.xml`.\n */\n readonly customExtensionsPath?: string\n\n /**\n * (Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.\n * Supports 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}\n */\n readonly customManifestPath?: string\n\n /**\n * Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.\n * @default false\n */\n readonly showNameOnTiles?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly electronUpdaterAware?: boolean\n\n /**\n * Whether to set build number. See https://github.com/electron-userland/electron-builder/issues/3875\n * @default false\n */\n readonly setBuildNumber?: boolean\n\n /**\n * Set the MinVersion field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly minVersion?: string | null\n\n /**\n * Set the `MaxVersionTested` field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly maxVersionTested?: string | null\n\n /** @private */\n readonly makeappxArgs?: Array<string> | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AppXOptions.js","sourceRoot":"","sources":["../../src/options/AppXOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\nexport interface AppXOptions extends TargetSpecificOptions {\n /**\n * The application id. Defaults to `identityName`. This string contains alpha-numeric fields separated by periods. Each field must begin with an ASCII alphabetic character.\n */\n readonly applicationId?: string\n\n /**\n * The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).\n * @default #464646\n */\n readonly backgroundColor?: string | null\n\n /**\n * A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\n * Defaults to the application product name.\n */\n readonly displayName?: string | null\n\n /**\n * The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](./configuration.md#metadata).\n */\n readonly identityName?: string | null\n\n /**\n * The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.\n */\n readonly publisher?: string | null\n\n /**\n * A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).\n * Defaults to company name from the application metadata.\n */\n readonly publisherDisplayName?: string | null\n\n /**\n * The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.\n * The first entry (index 0) will be the default language.\n * Defaults to en-US if omitted.\n */\n readonly languages?: Array<string> | string | null\n\n /**\n * Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.\n */\n readonly addAutoLaunchExtension?: boolean\n\n /**\n * Relative path to custom extensions xml to be included in an `appmanifest.xml`.\n */\n readonly customExtensionsPath?: string\n\n /**\n * The list of [capabilities](https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations) to be added to an `appmanifest.xml`.\n * The `runFullTrust` capability is obligatory for electron apps and will be auto added if not specified here.\n * Defaults to `['runFullTrust']` if omitted\n * Example: `['runFullTrust', 'privateNetworkClientServer', 'webcam']`\n */\n readonly capabilities?: Array<string> | null\n\n /**\n * (Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.\n * Supports 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}\n */\n readonly customManifestPath?: string\n\n /**\n * Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.\n * @default false\n */\n readonly showNameOnTiles?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly electronUpdaterAware?: boolean\n\n /**\n * Whether to set build number. See https://github.com/electron-userland/electron-builder/issues/3875\n * @default false\n */\n readonly setBuildNumber?: boolean\n\n /**\n * Set the MinVersion field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly minVersion?: string | null\n\n /**\n * Set the `MaxVersionTested` field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly maxVersionTested?: string | null\n\n /** @private */\n readonly makeappxArgs?: Array<string> | null\n}\n"]}
|
|
@@ -246,6 +246,18 @@ export interface DmgOptions extends TargetSpecificOptions {
|
|
|
246
246
|
* @default UDZO
|
|
247
247
|
*/
|
|
248
248
|
format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
|
|
249
|
+
/**
|
|
250
|
+
* The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `"150m"`, `"4g"`.
|
|
251
|
+
* If not specified, the size is calculated automatically.
|
|
252
|
+
* Set this explicitly for large apps or apps with sparse files to avoid "No space left on device" errors.
|
|
253
|
+
*/
|
|
254
|
+
readonly size?: string | null;
|
|
255
|
+
/**
|
|
256
|
+
* Whether to shrink the DMG filesystem to the minimum size after copying files.
|
|
257
|
+
* Set to `false` to preserve the explicit `size` you specified.
|
|
258
|
+
* @default true
|
|
259
|
+
*/
|
|
260
|
+
readonly shrink?: boolean;
|
|
249
261
|
/**
|
|
250
262
|
* The DMG window position and size. With y co-ordinates running from bottom to top.
|
|
251
263
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `\"150m\"`, `\"4g\"`.\n * If not specified, the size is calculated automatically.\n * Set this explicitly for large apps or apps with sparse files to avoid \"No space left on device\" errors.\n */\n readonly size?: string | null\n\n /**\n * Whether to shrink the DMG filesystem to the minimum size after copying files.\n * Set to `false` to preserve the explicit `size` you specified.\n * @default true\n */\n readonly shrink?: boolean\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface Capability {
|
|
2
|
+
readonly nsAlias: string | null;
|
|
3
|
+
readonly nsURI: string | null;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
toXMLString(): string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CAPABILITIES: Capability[];
|
|
8
|
+
export declare function isValidCapabilityName(name: string | null | undefined): boolean;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CAPABILITIES = void 0;
|
|
4
|
+
exports.isValidCapabilityName = isValidCapabilityName;
|
|
5
|
+
class AppxCapability {
|
|
6
|
+
constructor(nsAlias, nsURI, declareNS, elementName, name) {
|
|
7
|
+
this.nsAlias = nsAlias;
|
|
8
|
+
this.nsURI = nsURI;
|
|
9
|
+
this.declareNS = declareNS;
|
|
10
|
+
this.elementName = elementName;
|
|
11
|
+
this.name = name;
|
|
12
|
+
if (!this.nsAlias && this.declareNS) {
|
|
13
|
+
throw new Error("local declaration of namespace without prefix is not supported");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
toXMLString() {
|
|
17
|
+
const tagName = this.nsAlias ? `${this.nsAlias}:${this.elementName}` : this.elementName;
|
|
18
|
+
if (this.declareNS) {
|
|
19
|
+
return `<${tagName} xmlns:${this.nsAlias}="${this.nsURI}" Name="${this.name}"/>`;
|
|
20
|
+
}
|
|
21
|
+
return `<${tagName} Name="${this.name}"/>`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Capability type configurations
|
|
25
|
+
const CAPABILITY_TYPES = {
|
|
26
|
+
common: {
|
|
27
|
+
nsAlias: null,
|
|
28
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/foundation/windows10",
|
|
29
|
+
declareNS: false,
|
|
30
|
+
elementName: "Capability",
|
|
31
|
+
},
|
|
32
|
+
uap: {
|
|
33
|
+
nsAlias: "uap",
|
|
34
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/uap/windows10",
|
|
35
|
+
declareNS: false, // ns already declared in template
|
|
36
|
+
elementName: "Capability",
|
|
37
|
+
},
|
|
38
|
+
device: {
|
|
39
|
+
nsAlias: null,
|
|
40
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/foundation/windows10",
|
|
41
|
+
declareNS: false,
|
|
42
|
+
elementName: "DeviceCapability",
|
|
43
|
+
},
|
|
44
|
+
uap6: {
|
|
45
|
+
nsAlias: "uap6",
|
|
46
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/uap/windows10/6",
|
|
47
|
+
declareNS: true,
|
|
48
|
+
elementName: "Capability",
|
|
49
|
+
},
|
|
50
|
+
uap7: {
|
|
51
|
+
nsAlias: "uap7",
|
|
52
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/uap/windows10/7",
|
|
53
|
+
declareNS: true,
|
|
54
|
+
elementName: "Capability",
|
|
55
|
+
},
|
|
56
|
+
mobile: {
|
|
57
|
+
nsAlias: "mobile",
|
|
58
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/mobile/windows10",
|
|
59
|
+
declareNS: true,
|
|
60
|
+
elementName: "Capability",
|
|
61
|
+
},
|
|
62
|
+
rescap: {
|
|
63
|
+
nsAlias: "rescap",
|
|
64
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities",
|
|
65
|
+
declareNS: false, // ns already declared in template
|
|
66
|
+
elementName: "Capability",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
// Map of capability types to their capability names (grouped by type)
|
|
70
|
+
const CAPABILITY_MAP = new Map([
|
|
71
|
+
// Common capabilities
|
|
72
|
+
[
|
|
73
|
+
"common",
|
|
74
|
+
[
|
|
75
|
+
"internetClient",
|
|
76
|
+
"internetClientServer",
|
|
77
|
+
"privateNetworkClientServer",
|
|
78
|
+
"codeGeneration",
|
|
79
|
+
"allJoyn",
|
|
80
|
+
"backgroundMediaPlayback",
|
|
81
|
+
"remoteSystem",
|
|
82
|
+
"spatialPerception",
|
|
83
|
+
"userDataTasks",
|
|
84
|
+
"userNotificationListener",
|
|
85
|
+
],
|
|
86
|
+
],
|
|
87
|
+
// UAP capabilities
|
|
88
|
+
[
|
|
89
|
+
"uap",
|
|
90
|
+
[
|
|
91
|
+
"musicLibrary",
|
|
92
|
+
"picturesLibrary",
|
|
93
|
+
"videosLibrary",
|
|
94
|
+
"removableStorage",
|
|
95
|
+
"appointments",
|
|
96
|
+
"contacts",
|
|
97
|
+
"phoneCall",
|
|
98
|
+
"phoneCallHistoryPublic",
|
|
99
|
+
"userAccountInformation",
|
|
100
|
+
"voipCall",
|
|
101
|
+
"objects3D",
|
|
102
|
+
"chat",
|
|
103
|
+
"blockedChatMessages",
|
|
104
|
+
"enterpriseAuthentication",
|
|
105
|
+
"sharedUserCertificates",
|
|
106
|
+
"documentsLibrary",
|
|
107
|
+
],
|
|
108
|
+
],
|
|
109
|
+
// Mobile capabilities
|
|
110
|
+
["mobile", ["recordedCallsFolder"]],
|
|
111
|
+
// Restricted capabilities
|
|
112
|
+
[
|
|
113
|
+
"rescap",
|
|
114
|
+
[
|
|
115
|
+
"enterpriseDataPolicy",
|
|
116
|
+
"appCaptureSettings",
|
|
117
|
+
"cellularDeviceControl",
|
|
118
|
+
"cellularDeviceIdentity",
|
|
119
|
+
"cellularMessaging",
|
|
120
|
+
"deviceUnlock",
|
|
121
|
+
"dualSimTiles",
|
|
122
|
+
"enterpriseDeviceLockdown",
|
|
123
|
+
"inputInjectionBrokered",
|
|
124
|
+
"inputObservation",
|
|
125
|
+
"inputSuppression",
|
|
126
|
+
"networkingVpnProvider",
|
|
127
|
+
"packageManagement",
|
|
128
|
+
"screenDuplication",
|
|
129
|
+
"userPrincipalName",
|
|
130
|
+
"walletSystem",
|
|
131
|
+
"locationHistory",
|
|
132
|
+
"confirmAppClose",
|
|
133
|
+
"phoneCallHistory",
|
|
134
|
+
"appointmentsSystem",
|
|
135
|
+
"chatSystem",
|
|
136
|
+
"contactsSystem",
|
|
137
|
+
"email",
|
|
138
|
+
"emailSystem",
|
|
139
|
+
"phoneCallHistorySystem",
|
|
140
|
+
"smsSend",
|
|
141
|
+
"userDataSystem",
|
|
142
|
+
"previewStore",
|
|
143
|
+
"firstSignInSettings",
|
|
144
|
+
"teamEditionExperience",
|
|
145
|
+
"remotePassportAuthentication",
|
|
146
|
+
"previewUiComposition",
|
|
147
|
+
"secureAssessment",
|
|
148
|
+
"networkConnectionManagerProvisioning",
|
|
149
|
+
"networkDataPlanProvisioning",
|
|
150
|
+
"slapiQueryLicenseValue",
|
|
151
|
+
"extendedBackgroundTaskTime",
|
|
152
|
+
"extendedExecutionBackgroundAudio",
|
|
153
|
+
"extendedExecutionCritical",
|
|
154
|
+
"extendedExecutionUnconstrained",
|
|
155
|
+
"deviceManagementDmAccount",
|
|
156
|
+
"deviceManagementFoundation",
|
|
157
|
+
"deviceManagementWapSecurityPolicies",
|
|
158
|
+
"deviceManagementEmailAccount",
|
|
159
|
+
"packagePolicySystem",
|
|
160
|
+
"gameList",
|
|
161
|
+
"xboxAccessoryManagement",
|
|
162
|
+
"cortanaSpeechAccessory",
|
|
163
|
+
"accessoryManager",
|
|
164
|
+
"interopServices",
|
|
165
|
+
"inputForegroundObservation",
|
|
166
|
+
"oemDeployment",
|
|
167
|
+
"oemPublicDirectory",
|
|
168
|
+
"appLicensing",
|
|
169
|
+
"locationSystem",
|
|
170
|
+
"userDataAccountsProvider",
|
|
171
|
+
"previewPenWorkspace",
|
|
172
|
+
"secondaryAuthenticationFactor",
|
|
173
|
+
"storeLicenseManagement",
|
|
174
|
+
"userSystemId",
|
|
175
|
+
"targetedContent",
|
|
176
|
+
"uiAutomation",
|
|
177
|
+
"gameBarServices",
|
|
178
|
+
"appCaptureServices",
|
|
179
|
+
"appBroadcastServices",
|
|
180
|
+
"audioDeviceConfiguration",
|
|
181
|
+
"backgroundMediaRecording",
|
|
182
|
+
"previewInkWorkspace",
|
|
183
|
+
"startScreenManagement",
|
|
184
|
+
"cortanaPermissions",
|
|
185
|
+
"allAppMods",
|
|
186
|
+
"expandedResources",
|
|
187
|
+
"protectedApp",
|
|
188
|
+
"gameMonitor",
|
|
189
|
+
"appDiagnostics",
|
|
190
|
+
"devicePortalProvider",
|
|
191
|
+
"enterpriseCloudSSO",
|
|
192
|
+
"backgroundVoIP",
|
|
193
|
+
"oneProcessVoIP",
|
|
194
|
+
"developmentModeNetwork",
|
|
195
|
+
"broadFileSystemAccess",
|
|
196
|
+
"smbios",
|
|
197
|
+
"runFullTrust",
|
|
198
|
+
"allowElevation",
|
|
199
|
+
"teamEditionDeviceCredential",
|
|
200
|
+
"teamEditionView",
|
|
201
|
+
"cameraProcessingExtension",
|
|
202
|
+
"networkDataUsageManagement",
|
|
203
|
+
"phoneLineTransportManagement",
|
|
204
|
+
"unvirtualizedResources",
|
|
205
|
+
"modifiableApp",
|
|
206
|
+
"packageWriteRedirectionCompatibilityShim",
|
|
207
|
+
"customInstallActions",
|
|
208
|
+
"packagedServices",
|
|
209
|
+
"localSystemServices",
|
|
210
|
+
"backgroundSpatialPerception",
|
|
211
|
+
"uiAccess",
|
|
212
|
+
],
|
|
213
|
+
],
|
|
214
|
+
// UAP6 capabilities
|
|
215
|
+
["uap6", ["graphicsCapture"]],
|
|
216
|
+
// UAP7 capabilities
|
|
217
|
+
["uap7", ["globalMediaControl"]],
|
|
218
|
+
// Device capabilities
|
|
219
|
+
[
|
|
220
|
+
"device",
|
|
221
|
+
[
|
|
222
|
+
"location",
|
|
223
|
+
"microphone",
|
|
224
|
+
"webcam",
|
|
225
|
+
"proximity",
|
|
226
|
+
"pointOfService",
|
|
227
|
+
"wiFiControl",
|
|
228
|
+
"radios",
|
|
229
|
+
"optical",
|
|
230
|
+
"activity",
|
|
231
|
+
"humanPresence",
|
|
232
|
+
"serialcommunication",
|
|
233
|
+
"gazeInput",
|
|
234
|
+
"lowLevel",
|
|
235
|
+
"packageQuery",
|
|
236
|
+
],
|
|
237
|
+
],
|
|
238
|
+
]);
|
|
239
|
+
// Factory function to create capabilities
|
|
240
|
+
function createCapability(type, name) {
|
|
241
|
+
const config = CAPABILITY_TYPES[type];
|
|
242
|
+
if (!config) {
|
|
243
|
+
throw new Error(`unknown capability type '${type}'`);
|
|
244
|
+
}
|
|
245
|
+
return new AppxCapability(config.nsAlias, config.nsURI, config.declareNS, config.elementName, name);
|
|
246
|
+
}
|
|
247
|
+
// Export ordered list of all capabilities (order matters per Microsoft docs)
|
|
248
|
+
// Schema: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/schema-root
|
|
249
|
+
// Packaging: https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
|
|
250
|
+
// !! the docs are not clear in which order is correct. the schema doc specifies an order that differs from the order described in packaging doc !!
|
|
251
|
+
// https://learn.microsoft.com/en-us/answers/questions/92754/why-does-the-order-of-items-in-(capabilities)-of-p
|
|
252
|
+
// as stated in the above post the packaging docs is the one to follow as MakeAppx.exe is following this specification when it checks the manifests validity
|
|
253
|
+
exports.CAPABILITIES = Array.from(CAPABILITY_MAP.entries()).flatMap(([type, names]) => names.map(name => createCapability(type, name)));
|
|
254
|
+
const CAPABILITY_NAMES = new Set(Array.from(CAPABILITY_MAP.values()).flat());
|
|
255
|
+
function isValidCapabilityName(name) {
|
|
256
|
+
return !!name && CAPABILITY_NAMES.has(name);
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=AppxCapabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppxCapabilities.js","sourceRoot":"","sources":["../../src/targets/AppxCapabilities.ts"],"names":[],"mappings":"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","sourcesContent":["export interface Capability {\n readonly nsAlias: string | null\n readonly nsURI: string | null\n readonly name: string\n\n toXMLString(): string\n}\n\ntype CapabilityConfig = {\n nsAlias: string | null\n nsURI: string | null\n declareNS: boolean\n elementName: string\n}\n\nclass AppxCapability implements Capability {\n constructor(\n public readonly nsAlias: string | null,\n public readonly nsURI: string | null,\n private readonly declareNS: boolean,\n private readonly elementName: string,\n public readonly name: string\n ) {\n if (!this.nsAlias && this.declareNS) {\n throw new Error(\"local declaration of namespace without prefix is not supported\")\n }\n }\n\n toXMLString(): string {\n const tagName = this.nsAlias ? `${this.nsAlias}:${this.elementName}` : this.elementName\n if (this.declareNS) {\n return `<${tagName} xmlns:${this.nsAlias}=\"${this.nsURI}\" Name=\"${this.name}\"/>`\n }\n return `<${tagName} Name=\"${this.name}\"/>`\n }\n}\n\n// Capability type configurations\nconst CAPABILITY_TYPES: Record<string, CapabilityConfig> = {\n common: {\n nsAlias: null,\n nsURI: \"http://schemas.microsoft.com/appx/manifest/foundation/windows10\",\n declareNS: false,\n elementName: \"Capability\",\n },\n uap: {\n nsAlias: \"uap\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/uap/windows10\",\n declareNS: false, // ns already declared in template\n elementName: \"Capability\",\n },\n device: {\n nsAlias: null,\n nsURI: \"http://schemas.microsoft.com/appx/manifest/foundation/windows10\",\n declareNS: false,\n elementName: \"DeviceCapability\",\n },\n uap6: {\n nsAlias: \"uap6\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/uap/windows10/6\",\n declareNS: true,\n elementName: \"Capability\",\n },\n uap7: {\n nsAlias: \"uap7\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/uap/windows10/7\",\n declareNS: true,\n elementName: \"Capability\",\n },\n mobile: {\n nsAlias: \"mobile\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/mobile/windows10\",\n declareNS: true,\n elementName: \"Capability\",\n },\n rescap: {\n nsAlias: \"rescap\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities\",\n declareNS: false, // ns already declared in template\n elementName: \"Capability\",\n },\n} as const\n\ntype CapabilityType = keyof typeof CAPABILITY_TYPES\n\n// Map of capability types to their capability names (grouped by type)\nconst CAPABILITY_MAP = new Map<CapabilityType, string[]>([\n // Common capabilities\n [\n \"common\",\n [\n \"internetClient\",\n \"internetClientServer\",\n \"privateNetworkClientServer\",\n \"codeGeneration\",\n \"allJoyn\",\n \"backgroundMediaPlayback\",\n \"remoteSystem\",\n \"spatialPerception\",\n \"userDataTasks\",\n \"userNotificationListener\",\n ],\n ],\n\n // UAP capabilities\n [\n \"uap\",\n [\n \"musicLibrary\",\n \"picturesLibrary\",\n \"videosLibrary\",\n \"removableStorage\",\n \"appointments\",\n \"contacts\",\n \"phoneCall\",\n \"phoneCallHistoryPublic\",\n \"userAccountInformation\",\n \"voipCall\",\n \"objects3D\",\n \"chat\",\n \"blockedChatMessages\",\n \"enterpriseAuthentication\",\n \"sharedUserCertificates\",\n \"documentsLibrary\",\n ],\n ],\n\n // Mobile capabilities\n [\"mobile\", [\"recordedCallsFolder\"]],\n\n // Restricted capabilities\n [\n \"rescap\",\n [\n \"enterpriseDataPolicy\",\n \"appCaptureSettings\",\n \"cellularDeviceControl\",\n \"cellularDeviceIdentity\",\n \"cellularMessaging\",\n \"deviceUnlock\",\n \"dualSimTiles\",\n \"enterpriseDeviceLockdown\",\n \"inputInjectionBrokered\",\n \"inputObservation\",\n \"inputSuppression\",\n \"networkingVpnProvider\",\n \"packageManagement\",\n \"screenDuplication\",\n \"userPrincipalName\",\n \"walletSystem\",\n \"locationHistory\",\n \"confirmAppClose\",\n \"phoneCallHistory\",\n \"appointmentsSystem\",\n \"chatSystem\",\n \"contactsSystem\",\n \"email\",\n \"emailSystem\",\n \"phoneCallHistorySystem\",\n \"smsSend\",\n \"userDataSystem\",\n \"previewStore\",\n \"firstSignInSettings\",\n \"teamEditionExperience\",\n \"remotePassportAuthentication\",\n \"previewUiComposition\",\n \"secureAssessment\",\n \"networkConnectionManagerProvisioning\",\n \"networkDataPlanProvisioning\",\n \"slapiQueryLicenseValue\",\n \"extendedBackgroundTaskTime\",\n \"extendedExecutionBackgroundAudio\",\n \"extendedExecutionCritical\",\n \"extendedExecutionUnconstrained\",\n \"deviceManagementDmAccount\",\n \"deviceManagementFoundation\",\n \"deviceManagementWapSecurityPolicies\",\n \"deviceManagementEmailAccount\",\n \"packagePolicySystem\",\n \"gameList\",\n \"xboxAccessoryManagement\",\n \"cortanaSpeechAccessory\",\n \"accessoryManager\",\n \"interopServices\",\n \"inputForegroundObservation\",\n \"oemDeployment\",\n \"oemPublicDirectory\",\n \"appLicensing\",\n \"locationSystem\",\n \"userDataAccountsProvider\",\n \"previewPenWorkspace\",\n \"secondaryAuthenticationFactor\",\n \"storeLicenseManagement\",\n \"userSystemId\",\n \"targetedContent\",\n \"uiAutomation\",\n \"gameBarServices\",\n \"appCaptureServices\",\n \"appBroadcastServices\",\n \"audioDeviceConfiguration\",\n \"backgroundMediaRecording\",\n \"previewInkWorkspace\",\n \"startScreenManagement\",\n \"cortanaPermissions\",\n \"allAppMods\",\n \"expandedResources\",\n \"protectedApp\",\n \"gameMonitor\",\n \"appDiagnostics\",\n \"devicePortalProvider\",\n \"enterpriseCloudSSO\",\n \"backgroundVoIP\",\n \"oneProcessVoIP\",\n \"developmentModeNetwork\",\n \"broadFileSystemAccess\",\n \"smbios\",\n \"runFullTrust\",\n \"allowElevation\",\n \"teamEditionDeviceCredential\",\n \"teamEditionView\",\n \"cameraProcessingExtension\",\n \"networkDataUsageManagement\",\n \"phoneLineTransportManagement\",\n \"unvirtualizedResources\",\n \"modifiableApp\",\n \"packageWriteRedirectionCompatibilityShim\",\n \"customInstallActions\",\n \"packagedServices\",\n \"localSystemServices\",\n \"backgroundSpatialPerception\",\n \"uiAccess\",\n ],\n ],\n\n // UAP6 capabilities\n [\"uap6\", [\"graphicsCapture\"]],\n\n // UAP7 capabilities\n [\"uap7\", [\"globalMediaControl\"]],\n\n // Device capabilities\n [\n \"device\",\n [\n \"location\",\n \"microphone\",\n \"webcam\",\n \"proximity\",\n \"pointOfService\",\n \"wiFiControl\",\n \"radios\",\n \"optical\",\n \"activity\",\n \"humanPresence\",\n \"serialcommunication\",\n \"gazeInput\",\n \"lowLevel\",\n \"packageQuery\",\n ],\n ],\n])\n\n// Factory function to create capabilities\nfunction createCapability(type: CapabilityType, name: string): Capability {\n const config = CAPABILITY_TYPES[type]\n if (!config) {\n throw new Error(`unknown capability type '${type}'`)\n }\n return new AppxCapability(config.nsAlias, config.nsURI, config.declareNS, config.elementName, name)\n}\n\n// Export ordered list of all capabilities (order matters per Microsoft docs)\n// Schema: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/schema-root\n// Packaging: https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations\n// !! the docs are not clear in which order is correct. the schema doc specifies an order that differs from the order described in packaging doc !!\n// https://learn.microsoft.com/en-us/answers/questions/92754/why-does-the-order-of-items-in-(capabilities)-of-p\n// as stated in the above post the packaging docs is the one to follow as MakeAppx.exe is following this specification when it checks the manifests validity\nexport const CAPABILITIES: Capability[] = Array.from(CAPABILITY_MAP.entries()).flatMap(([type, names]) => names.map(name => createCapability(type, name)))\n\nconst CAPABILITY_NAMES: Set<string> = new Set<string>(Array.from(CAPABILITY_MAP.values()).flat())\n\nexport function isValidCapabilityName(name: string | null | undefined): boolean {\n return !!name && CAPABILITY_NAMES.has(name)\n}\n"]}
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const builder_util_1 = require("builder-util");
|
|
4
4
|
const fs_extra_1 = require("fs-extra");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const windows_1 = require("../toolsets/windows");
|
|
7
7
|
const core_1 = require("../core");
|
|
8
8
|
const pathManager_1 = require("../util/pathManager");
|
|
9
9
|
const targetUtil_1 = require("./targetUtil");
|
|
10
|
+
const windows_2 = require("../toolsets/windows");
|
|
11
|
+
const AppxCapabilities_1 = require("./AppxCapabilities");
|
|
10
12
|
const APPX_ASSETS_DIR_NAME = "appx";
|
|
11
13
|
const vendorAssetsForDefaultAssets = {
|
|
12
14
|
"StoreLogo.png": "SampleAppx.50x50.png",
|
|
@@ -46,12 +48,13 @@ class AppXTarget extends core_1.Target {
|
|
|
46
48
|
this.outDir = outDir;
|
|
47
49
|
this.options = (0, builder_util_1.deepAssign)({}, this.packager.platformSpecificBuildOptions, this.packager.config.appx);
|
|
48
50
|
this.isAsyncSupported = false;
|
|
49
|
-
if (process.platform !== "darwin" && (process.platform !== "win32" || (0,
|
|
51
|
+
if (process.platform !== "darwin" && (process.platform !== "win32" || (0, windows_2.isOldWin6)())) {
|
|
50
52
|
throw new Error("AppX is supported only on Windows 10 or Windows Server 2012 R2 (version number 6.3+)");
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
// https://docs.microsoft.com/en-us/windows/uwp/packaging/create-app-package-with-makeappx-tool#mapping-files
|
|
54
56
|
async build(appOutDir, arch) {
|
|
57
|
+
var _a;
|
|
55
58
|
const packager = this.packager;
|
|
56
59
|
const artifactName = packager.expandArtifactBeautyNamePattern(this.options, "appx", arch);
|
|
57
60
|
const artifactPath = path.join(this.outDir, artifactName);
|
|
@@ -60,7 +63,7 @@ class AppXTarget extends core_1.Target {
|
|
|
60
63
|
file: artifactPath,
|
|
61
64
|
arch,
|
|
62
65
|
});
|
|
63
|
-
const vendorPath = await (0,
|
|
66
|
+
const vendorPath = await (0, windows_1.getWindowsKitsBundle)({ winCodeSign: (_a = this.packager.config.toolsets) === null || _a === void 0 ? void 0 : _a.winCodeSign, arch: arch });
|
|
64
67
|
const vm = await packager.vm.value;
|
|
65
68
|
const stageDir = await (0, targetUtil_1.createStageDir)(this, packager, arch);
|
|
66
69
|
const mappingFile = stageDir.getTempFile("mapping.txt");
|
|
@@ -77,17 +80,16 @@ class AppXTarget extends core_1.Target {
|
|
|
77
80
|
return `"${vm.toVmFile(file)}" "app\\${appxPath}"`;
|
|
78
81
|
})));
|
|
79
82
|
const userAssetDir = await this.packager.getResource(undefined, APPX_ASSETS_DIR_NAME);
|
|
80
|
-
const assetInfo = await AppXTarget.computeUserAssets(vm, vendorPath, userAssetDir);
|
|
83
|
+
const assetInfo = await AppXTarget.computeUserAssets(vm, vendorPath.appxAssets, userAssetDir);
|
|
81
84
|
const userAssets = assetInfo.userAssets;
|
|
82
85
|
const manifestFile = stageDir.getTempFile("AppxManifest.xml");
|
|
83
86
|
await this.writeManifest(manifestFile, arch, await this.computePublisherName(), userAssets);
|
|
84
87
|
await packager.info.emitAppxManifestCreated(manifestFile);
|
|
85
88
|
mappingList.push(assetInfo.mappings);
|
|
86
89
|
mappingList.push([`"${vm.toVmFile(manifestFile)}" "AppxManifest.xml"`]);
|
|
87
|
-
const signToolArch = arch === builder_util_1.Arch.arm64 ? "x64" : builder_util_1.Arch[arch];
|
|
88
90
|
if (isScaledAssetsProvided(userAssets)) {
|
|
89
91
|
const outFile = vm.toVmFile(stageDir.getTempFile("resources.pri"));
|
|
90
|
-
const makePriPath = vm.toVmFile(path.join(vendorPath, "
|
|
92
|
+
const makePriPath = vm.toVmFile(path.join(vendorPath.kit, "makepri.exe"));
|
|
91
93
|
const assetRoot = stageDir.getTempFile("appx/assets");
|
|
92
94
|
await (0, fs_extra_1.emptyDir)(assetRoot);
|
|
93
95
|
await Promise.all(assetInfo.allAssets.map(it => (0, builder_util_1.copyOrLinkFile)(it, path.join(assetRoot, path.basename(it)))));
|
|
@@ -119,7 +121,7 @@ class AppXTarget extends core_1.Target {
|
|
|
119
121
|
makeAppXArgs.push(...this.options.makeappxArgs);
|
|
120
122
|
}
|
|
121
123
|
this.buildQueueManager.add(async () => {
|
|
122
|
-
await vm.exec(vm.toVmFile(path.join(vendorPath, "
|
|
124
|
+
await vm.exec(vm.toVmFile(path.join(vendorPath.kit, "makeappx.exe")), makeAppXArgs);
|
|
123
125
|
await packager.signIf(artifactPath);
|
|
124
126
|
await stageDir.cleanup();
|
|
125
127
|
await packager.info.emitArtifactBuildCompleted({
|
|
@@ -166,6 +168,7 @@ class AppXTarget extends core_1.Target {
|
|
|
166
168
|
const options = this.options;
|
|
167
169
|
const executable = `app\\${appInfo.productFilename}.exe`;
|
|
168
170
|
const displayName = options.displayName || appInfo.productName;
|
|
171
|
+
const capabilities = this.getCapabilities();
|
|
169
172
|
const extensions = await this.getExtensions(executable, displayName);
|
|
170
173
|
const archSpecificMinVersion = arch === builder_util_1.Arch.arm64 ? "10.0.16299.0" : "10.0.14316.0";
|
|
171
174
|
const customManifestPath = await this.packager.getResource(this.options.customManifestPath);
|
|
@@ -207,15 +210,15 @@ class AppXTarget extends core_1.Target {
|
|
|
207
210
|
result = options.identityName || appInfo.name;
|
|
208
211
|
}
|
|
209
212
|
if (result.length < 1 || result.length > 64) {
|
|
210
|
-
const message = `Appx Application.Id
|
|
213
|
+
const message = `Appx Application.Id must be between 1 and 64 characters in length: ${result}`;
|
|
211
214
|
throw new builder_util_1.InvalidConfigurationError(message);
|
|
212
215
|
}
|
|
213
216
|
else if (!validCharactersRegex.test(result)) {
|
|
214
|
-
const message = `AppX Application.Id
|
|
217
|
+
const message = `AppX Application.Id cannot contain alpha-numeric, period, and dash characters: ${result}"`;
|
|
215
218
|
throw new builder_util_1.InvalidConfigurationError(message);
|
|
216
219
|
}
|
|
217
220
|
else if (restrictedApplicationIdValues.includes(result.toUpperCase())) {
|
|
218
|
-
const message = `AppX
|
|
221
|
+
const message = `AppX Application.Id cannot contain restricted values ${JSON.stringify(restrictedApplicationIdValues)}: ${result}`;
|
|
219
222
|
throw new builder_util_1.InvalidConfigurationError(message);
|
|
220
223
|
}
|
|
221
224
|
else if (result == null && options.applicationId == null) {
|
|
@@ -228,15 +231,15 @@ class AppXTarget extends core_1.Target {
|
|
|
228
231
|
const result = options.identityName || appInfo.name;
|
|
229
232
|
const validCharactersRegex = /^[a-zA-Z0-9.-]+$/;
|
|
230
233
|
if (result.length < 3 || result.length > 50) {
|
|
231
|
-
const message = `Appx identityName.Id
|
|
234
|
+
const message = `Appx identityName.Id must be between 3 and 50 characters in length: ${result}`;
|
|
232
235
|
throw new builder_util_1.InvalidConfigurationError(message);
|
|
233
236
|
}
|
|
234
237
|
else if (!validCharactersRegex.test(result)) {
|
|
235
|
-
const message = `AppX identityName.Id
|
|
238
|
+
const message = `AppX identityName.Id cannot contain of alpha-numeric, period, and dash characters: ${result}`;
|
|
236
239
|
throw new builder_util_1.InvalidConfigurationError(message);
|
|
237
240
|
}
|
|
238
241
|
else if (restrictedApplicationIdValues.includes(result.toUpperCase())) {
|
|
239
|
-
const message = `AppX identityName.Id
|
|
242
|
+
const message = `AppX identityName.Id cannot contain restricted values ${JSON.stringify(restrictedApplicationIdValues)}: ${result}`;
|
|
240
243
|
throw new builder_util_1.InvalidConfigurationError(message);
|
|
241
244
|
}
|
|
242
245
|
else if (result == null && options.identityName == null) {
|
|
@@ -269,6 +272,8 @@ class AppXTarget extends core_1.Target {
|
|
|
269
272
|
return arch === builder_util_1.Arch.ia32 ? "x86" : arch === builder_util_1.Arch.arm64 ? "arm64" : "x64";
|
|
270
273
|
case "resourceLanguages":
|
|
271
274
|
return resourceLanguageTag((0, builder_util_1.asArray)(options.languages));
|
|
275
|
+
case "capabilities":
|
|
276
|
+
return capabilities;
|
|
272
277
|
case "extensions":
|
|
273
278
|
return extensions;
|
|
274
279
|
case "minVersion":
|
|
@@ -281,6 +286,19 @@ class AppXTarget extends core_1.Target {
|
|
|
281
286
|
});
|
|
282
287
|
await (0, fs_extra_1.writeFile)(outFile, manifest);
|
|
283
288
|
}
|
|
289
|
+
getCapabilities() {
|
|
290
|
+
const caps = (0, builder_util_1.asArray)(this.options.capabilities);
|
|
291
|
+
const capSet = new Set(caps);
|
|
292
|
+
const invalid = Array.from(capSet).filter(cap => !(0, AppxCapabilities_1.isValidCapabilityName)(cap));
|
|
293
|
+
if (invalid.length > 0) {
|
|
294
|
+
throw new Error(`invalid windows capabilit${invalid.length === 1 ? "y" : "ies"} specified: ${invalid.join(", ")}`);
|
|
295
|
+
}
|
|
296
|
+
// Ensure runFullTrust is always included
|
|
297
|
+
capSet.add("runFullTrust");
|
|
298
|
+
// Filter and map in one pass
|
|
299
|
+
const capabilityStrings = AppxCapabilities_1.CAPABILITIES.filter(cap => capSet.has(cap.name)).map(cap => ` ${cap.toXMLString()}`);
|
|
300
|
+
return `<Capabilities>\n${capabilityStrings.join("\n")}\n</Capabilities>`;
|
|
301
|
+
}
|
|
284
302
|
async getExtensions(executable, displayName) {
|
|
285
303
|
const uriSchemes = (0, builder_util_1.asArray)(this.packager.config.protocols).concat((0, builder_util_1.asArray)(this.packager.platformSpecificBuildOptions.protocols));
|
|
286
304
|
const fileAssociations = (0, builder_util_1.asArray)(this.packager.config.fileAssociations).concat((0, builder_util_1.asArray)(this.packager.platformSpecificBuildOptions.fileAssociations));
|
|
@@ -335,7 +353,7 @@ function resourceLanguageTag(userLanguages) {
|
|
|
335
353
|
if (userLanguages == null || userLanguages.length === 0) {
|
|
336
354
|
userLanguages = [DEFAULT_RESOURCE_LANG];
|
|
337
355
|
}
|
|
338
|
-
return userLanguages.map(it => `<Resource Language="${it.replace(/_/g, "-")}" />`).join("\n");
|
|
356
|
+
return userLanguages.map(it => `<Resource Language="${it.trim().replace(/_/g, "-")}" />`).join("\n");
|
|
339
357
|
}
|
|
340
358
|
function lockScreenTag(userAssets) {
|
|
341
359
|
if (isDefaultAssetIncluded(userAssets, "BadgeLogo.png")) {
|