app-builder-lib 26.0.0-alpha.8 → 26.0.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.
Files changed (53) hide show
  1. package/out/asar/asarUtil.js +14 -3
  2. package/out/asar/asarUtil.js.map +1 -1
  3. package/out/asar/integrity.d.ts +4 -1
  4. package/out/asar/integrity.js +37 -8
  5. package/out/asar/integrity.js.map +1 -1
  6. package/out/codeSign/windowsCodeSign.d.ts +0 -2
  7. package/out/codeSign/windowsCodeSign.js +1 -33
  8. package/out/codeSign/windowsCodeSign.js.map +1 -1
  9. package/out/codeSign/windowsSignAzureManager.js +2 -3
  10. package/out/codeSign/windowsSignAzureManager.js.map +1 -1
  11. package/out/codeSign/windowsSignToolManager.js +13 -17
  12. package/out/codeSign/windowsSignToolManager.js.map +1 -1
  13. package/out/index.d.ts +1 -1
  14. package/out/index.js.map +1 -1
  15. package/out/macPackager.d.ts +3 -3
  16. package/out/macPackager.js +24 -13
  17. package/out/macPackager.js.map +1 -1
  18. package/out/options/AppXOptions.d.ts +26 -0
  19. package/out/options/AppXOptions.js.map +1 -1
  20. package/out/options/FileAssociation.d.ts +1 -1
  21. package/out/options/FileAssociation.js.map +1 -1
  22. package/out/options/macOptions.d.ts +3 -10
  23. package/out/options/macOptions.js.map +1 -1
  24. package/out/options/winOptions.d.ts +2 -62
  25. package/out/options/winOptions.js.map +1 -1
  26. package/out/platformPackager.d.ts +15 -1
  27. package/out/platformPackager.js +27 -8
  28. package/out/platformPackager.js.map +1 -1
  29. package/out/targets/AppxTarget.js +6 -1
  30. package/out/targets/AppxTarget.js.map +1 -1
  31. package/out/targets/FpmTarget.js +1 -1
  32. package/out/targets/FpmTarget.js.map +1 -1
  33. package/out/targets/nsis/NsisTarget.d.ts +4 -3
  34. package/out/targets/nsis/NsisTarget.js +23 -10
  35. package/out/targets/nsis/NsisTarget.js.map +1 -1
  36. package/out/targets/nsis/WebInstallerTarget.d.ts +3 -1
  37. package/out/targets/nsis/WebInstallerTarget.js +8 -2
  38. package/out/targets/nsis/WebInstallerTarget.js.map +1 -1
  39. package/out/targets/nsis/nsisOptions.d.ts +6 -0
  40. package/out/targets/nsis/nsisOptions.js.map +1 -1
  41. package/out/version.d.ts +1 -1
  42. package/out/version.js +1 -1
  43. package/out/version.js.map +1 -1
  44. package/out/vm/PwshVm.d.ts +6 -0
  45. package/out/vm/PwshVm.js +25 -0
  46. package/out/vm/PwshVm.js.map +1 -0
  47. package/out/vm/vm.d.ts +4 -0
  48. package/out/vm/vm.js +42 -3
  49. package/out/vm/vm.js.map +1 -1
  50. package/out/winPackager.js +4 -5
  51. package/out/winPackager.js.map +1 -1
  52. package/package.json +9 -9
  53. package/scheme.json +21 -142
@@ -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 * 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 * (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"]}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)), NSIS, and MSI only.
5
5
  *
6
- * On Windows (NSIS) works only if [nsis.perMachine](https://electron.build./configuration.md#NsisOptions-perMachine) is set to `true`.
6
+ * On Windows (NSIS) works only if [nsis.perMachine](https://www.electron.build/nsis) is set to `true`.
7
7
  */
8
8
  export interface FileAssociation {
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FileAssociation.js","sourceRoot":"","sources":["../../src/options/FileAssociation.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * File associations.\n *\n * macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)), NSIS, and MSI only.\n *\n * On Windows (NSIS) works only if [nsis.perMachine](https://electron.build./configuration.md#NsisOptions-perMachine) is set to `true`.\n */\nexport interface FileAssociation {\n /**\n * The extension (minus the leading period). e.g. `png`.\n */\n readonly ext: string | Array<string>\n\n /**\n * The name. e.g. `PNG`. Defaults to `ext`.\n */\n readonly name?: string | null\n\n /**\n * *windows-only.* The description.\n */\n readonly description?: string | null\n\n /**\n * *linux-only.* The mime-type.\n */\n readonly mimeType?: string | null\n\n /**\n * The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon.\n *\n * Not supported on Linux, file issue if need (default icon will be `x-office-document`). Not supported on MSI.\n */\n readonly icon?: string | null\n\n /**\n * *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.\n * @default Editor\n */\n readonly role?: string\n\n /**\n * *macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.\n */\n readonly isPackage?: boolean\n\n /**\n * *macOS-only* The app’s rank with respect to the type. The value can be `Owner`, `Default`, `Alternate`, or `None`. Corresponds to `LSHandlerRank`.\n * @default Default\n */\n readonly rank?: string\n}\n"]}
1
+ {"version":3,"file":"FileAssociation.js","sourceRoot":"","sources":["../../src/options/FileAssociation.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * File associations.\n *\n * macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)), NSIS, and MSI only.\n *\n * On Windows (NSIS) works only if [nsis.perMachine](https://www.electron.build/nsis) is set to `true`.\n */\nexport interface FileAssociation {\n /**\n * The extension (minus the leading period). e.g. `png`.\n */\n readonly ext: string | Array<string>\n\n /**\n * The name. e.g. `PNG`. Defaults to `ext`.\n */\n readonly name?: string | null\n\n /**\n * *windows-only.* The description.\n */\n readonly description?: string | null\n\n /**\n * *linux-only.* The mime-type.\n */\n readonly mimeType?: string | null\n\n /**\n * The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon.\n *\n * Not supported on Linux, file issue if need (default icon will be `x-office-document`). Not supported on MSI.\n */\n readonly icon?: string | null\n\n /**\n * *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.\n * @default Editor\n */\n readonly role?: string\n\n /**\n * *macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.\n */\n readonly isPackage?: boolean\n\n /**\n * *macOS-only* The app’s rank with respect to the type. The value can be `Owner`, `Default`, `Alternate`, or `None`. Corresponds to `LSHandlerRank`.\n * @default Default\n */\n readonly rank?: string\n}\n"]}
@@ -184,24 +184,17 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
184
184
  */
185
185
  readonly additionalArguments?: Array<string> | null;
186
186
  /**
187
- * Options to use for @electron/notarize (ref: https://github.com/electron/notarize).
188
- * Use `false` to explicitly disable
187
+ * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.
189
188
  *
190
189
  * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:
190
+ *
191
191
  * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.
192
192
  * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`
193
193
  * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`
194
194
  *
195
195
  * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)
196
196
  */
197
- readonly notarize?: NotarizeNotaryOptions | boolean | null;
198
- }
199
- export interface NotarizeNotaryOptions {
200
- /**
201
- * The team ID you want to notarize under for when using `notarytool`
202
- * @deprecated Set the `APPLE_TEAM_ID` environment variable instead
203
- */
204
- readonly teamId?: string;
197
+ readonly notarize?: boolean;
205
198
  }
206
199
  export interface DmgOptions extends TargetSpecificOptions {
207
200
  /**
@@ -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 readonly identity?: string | null\n\n /**\n * The path to application icon.\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 * Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\n * Use `false` to explicitly disable\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\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?: NotarizeNotaryOptions | boolean | null\n}\n\nexport interface NotarizeNotaryOptions {\n /**\n * The team ID you want to notarize under for when using `notarytool`\n * @deprecated Set the `APPLE_TEAM_ID` environment variable instead\n */\n readonly teamId?: string\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 (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 readonly identity?: string | null\n\n /**\n * The path to application icon.\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 (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"]}
@@ -19,67 +19,14 @@ export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
19
19
  * The trademarks and registered trademarks.
20
20
  */
21
21
  readonly legalTrademarks?: string | null;
22
- /**
23
- * Array of signing algorithms used. For AppX `sha256` is always used.
24
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.signingHashAlgorithms}
25
- */
26
- readonly signingHashAlgorithms?: Array<"sha1" | "sha256"> | null;
27
- /**
28
- * The custom function (or path to file or module id) to sign Windows executables
29
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.sign}
30
- */
31
- readonly sign?: CustomWindowsSign | string | null;
32
- /**
33
- * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.
34
- * Please see [Code Signing](./code-signing.md).
35
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificateFile}
36
- */
37
- readonly certificateFile?: string | null;
38
- /**
39
- * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.
40
- * Please see [Code Signing](./code-signing.md).
41
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificatePassword}
42
- */
43
- readonly certificatePassword?: string | null;
44
- /**
45
- * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
46
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificateSubjectName}
47
- */
48
- readonly certificateSubjectName?: string | null;
49
- /**
50
- * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
51
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificateSha1}
52
- */
53
- readonly certificateSha1?: string | null;
54
- /**
55
- * The path to an additional certificate file you want to add to the signature block.
56
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.additionalCertificateFile}
57
- */
58
- readonly additionalCertificateFile?: string | null;
59
- /**
60
- * The URL of the RFC 3161 time stamp server.
61
- * @default http://timestamp.digicert.com
62
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.rfc3161TimeStampServer}
63
- */
64
- readonly rfc3161TimeStampServer?: string | null;
65
- /**
66
- * The URL of the time stamp server.
67
- * @default http://timestamp.digicert.com
68
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.timeStampServer}
69
- */
70
- readonly timeStampServer?: string | null;
71
- /**
72
- * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.
73
- * Defaults to common name from your code signing certificate.
74
- * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.publisherName}
75
- */
76
- readonly publisherName?: string | Array<string> | null;
77
22
  /**
78
23
  * Options for usage with signtool.exe
24
+ * Cannot be used in conjunction with `azureSignOptions`, signing will default to Azure Trusted Signing
79
25
  */
80
26
  readonly signtoolOptions?: WindowsSigntoolConfiguration | null;
81
27
  /**
82
28
  * Options for usage of Azure Trusted Signing (beta)
29
+ * Cannot be used in conjunction with `signtoolOptions`, signing will default to Azure Trusted Signing
83
30
  */
84
31
  readonly azureSignOptions?: WindowsAzureSigningConfiguration | null;
85
32
  /**
@@ -100,13 +47,6 @@ export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
100
47
  * @default true
101
48
  */
102
49
  readonly signAndEditExecutable?: boolean;
103
- /**
104
- * Whether to sign DLL files. Advanced option.
105
- * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384
106
- * @default false
107
- * @deprecated Use {@link signExts} instead for more explicit control
108
- */
109
- readonly signDlls?: boolean;
110
50
  /**
111
51
  * Explicit file extensions to also sign. Advanced option.
112
52
  * @see https://github.com/electron-userland/electron-builder/issues/7329
@@ -1 +1 @@
1
- {"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType } from \"../index\"\nimport { CustomWindowsSign } from \"../codeSign/windowsSignToolManager\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable]./nsis.md#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX package can be built only on Windows 10.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.signingHashAlgorithms}\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.sign}\n */\n readonly sign?: CustomWindowsSign | string | null\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificateFile}\n */\n readonly certificateFile?: string | null\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificatePassword}\n */\n readonly certificatePassword?: string | null\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificateSubjectName}\n */\n readonly certificateSubjectName?: string | null\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.certificateSha1}\n */\n readonly certificateSha1?: string | null\n /**\n * The path to an additional certificate file you want to add to the signature block.\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.additionalCertificateFile}\n */\n readonly additionalCertificateFile?: string | null\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.rfc3161TimeStampServer}\n */\n readonly rfc3161TimeStampServer?: string | null\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.timeStampServer}\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n * @deprecated Please use {@link signtoolOptions}: {@link WindowsSigntoolConfiguration.publisherName}\n */\n readonly publisherName?: string | Array<string> | null\n\n /**\n * Options for usage with signtool.exe\n */\n readonly signtoolOptions?: WindowsSigntoolConfiguration | null\n\n /**\n * Options for usage of Azure Trusted Signing (beta)\n */\n readonly azureSignOptions?: WindowsAzureSigningConfiguration | null\n\n /**\n * Whether to verify the signature of an available update before installation.\n * The [publisher name](#publisherName) will be used for the signature verification.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Whether to sign and add metadata to executable. Advanced option.\n * @default true\n */\n readonly signAndEditExecutable?: boolean\n\n /**\n * Whether to sign DLL files. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384\n * @default false\n * @deprecated Use {@link signExts} instead for more explicit control\n */\n readonly signDlls?: boolean\n\n /**\n * Explicit file extensions to also sign. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\nexport interface WindowsSigntoolConfiguration {\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n */\n readonly sign?: CustomWindowsSign | string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n */\n readonly certificatePassword?: string | null\n\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSha1?: string | null\n\n /**\n * The path to an additional certificate file you want to add to the signature block.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n */\n readonly publisherName?: string | Array<string> | null\n}\n\n// https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations\nexport interface WindowsAzureSigningConfiguration {\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n */\n readonly publisherName: string\n /**\n * The Trusted Signing Account endpoint. The URI value must have a URI that aligns to the\n * region your Trusted Signing Account and Certificate Profile you are specifying were created\n * in during the setup of these resources.\n *\n * Translates to field: Endpoint\n *\n * Requires one of environment variable configurations for authenticating to Microsoft Entra ID per [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)\n */\n readonly endpoint: string\n /**\n * The Certificate Profile name. Translates to field: CertificateProfileName\n */\n readonly certificateProfileName: string\n /**\n * The Code Signing Signing Account name. Translates to field: CodeSigningAccountName\n */\n readonly codeSigningAccountName: string\n /**\n * The File Digest for signing each file. Translates to field: FileDigest\n * @default SHA256\n */\n readonly fileDigest?: string\n /**\n * The Timestamp rfc3161 server. Translates to field: TimestampRfc3161\n * @default http://timestamp.acs.microsoft.com\n */\n readonly timestampRfc3161?: string\n /**\n * The Timestamp Digest. Translates to field: TimestampDigest\n * @default SHA256\n */\n readonly timestampDigest?: string\n /**\n * Allow other CLI parameters (verbatim case-sensitive) to `Invoke-TrustedSigning`\n * Note: Key-Value pairs with `undefined`/`null` value are filtered out of the command.\n */\n [k: string]: string | undefined | null\n}\n"]}
1
+ {"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType } from \"../index\"\nimport { CustomWindowsSign } from \"../codeSign/windowsSignToolManager\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable]./nsis.md#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX package can be built only on Windows 10.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Options for usage with signtool.exe\n * Cannot be used in conjunction with `azureSignOptions`, signing will default to Azure Trusted Signing\n */\n readonly signtoolOptions?: WindowsSigntoolConfiguration | null\n\n /**\n * Options for usage of Azure Trusted Signing (beta)\n * Cannot be used in conjunction with `signtoolOptions`, signing will default to Azure Trusted Signing\n */\n readonly azureSignOptions?: WindowsAzureSigningConfiguration | null\n\n /**\n * Whether to verify the signature of an available update before installation.\n * The [publisher name](#publisherName) will be used for the signature verification.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Whether to sign and add metadata to executable. Advanced option.\n * @default true\n */\n readonly signAndEditExecutable?: boolean\n\n /**\n * Explicit file extensions to also sign. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\nexport interface WindowsSigntoolConfiguration {\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n */\n readonly sign?: CustomWindowsSign | string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n */\n readonly certificatePassword?: string | null\n\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSha1?: string | null\n\n /**\n * The path to an additional certificate file you want to add to the signature block.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n */\n readonly publisherName?: string | Array<string> | null\n}\n\n// https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations\nexport interface WindowsAzureSigningConfiguration {\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n */\n readonly publisherName: string\n /**\n * The Trusted Signing Account endpoint. The URI value must have a URI that aligns to the\n * region your Trusted Signing Account and Certificate Profile you are specifying were created\n * in during the setup of these resources.\n *\n * Translates to field: Endpoint\n *\n * Requires one of environment variable configurations for authenticating to Microsoft Entra ID per [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)\n */\n readonly endpoint: string\n /**\n * The Certificate Profile name. Translates to field: CertificateProfileName\n */\n readonly certificateProfileName: string\n /**\n * The Code Signing Signing Account name. Translates to field: CodeSigningAccountName\n */\n readonly codeSigningAccountName: string\n /**\n * The File Digest for signing each file. Translates to field: FileDigest\n * @default SHA256\n */\n readonly fileDigest?: string\n /**\n * The Timestamp rfc3161 server. Translates to field: TimestampRfc3161\n * @default http://timestamp.acs.microsoft.com\n */\n readonly timestampRfc3161?: string\n /**\n * The Timestamp Digest. Translates to field: TimestampDigest\n * @default SHA256\n */\n readonly timestampDigest?: string\n /**\n * Allow other CLI parameters (verbatim case-sensitive) to `Invoke-TrustedSigning`\n * Note: Key-Value pairs with `undefined`/`null` value are filtered out of the command.\n */\n [k: string]: string | undefined | null\n}\n"]}
@@ -4,6 +4,19 @@ import { AppInfo } from "./appInfo";
4
4
  import { GetFileMatchersOptions } from "./fileMatcher";
5
5
  import { AfterPackContext, CompressionLevel, Configuration, ElectronPlatformName, FileAssociation, Packager, PackagerOptions, Platform, PlatformSpecificBuildOptions, Target, TargetSpecificOptions } from "./index";
6
6
  import { FuseConfig } from "@electron/fuses";
7
+ export type DoPackOptions<DC extends PlatformSpecificBuildOptions> = {
8
+ outDir: string;
9
+ appOutDir: string;
10
+ platformName: ElectronPlatformName;
11
+ arch: Arch;
12
+ platformSpecificBuildOptions: DC;
13
+ targets: Array<Target>;
14
+ options?: {
15
+ sign?: boolean;
16
+ disableAsarIntegrity?: boolean;
17
+ disableFuses?: boolean;
18
+ };
19
+ };
7
20
  export declare abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions> {
8
21
  readonly info: Packager;
9
22
  readonly platform: Platform;
@@ -32,7 +45,8 @@ export declare abstract class PlatformPackager<DC extends PlatformSpecificBuildO
32
45
  private static buildAsyncTargets;
33
46
  private getExtraFileMatchers;
34
47
  createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions;
35
- protected doPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array<Target>, sign?: boolean, disableAsarIntegrity?: boolean): Promise<void>;
48
+ protected doPack(packOptions: DoPackOptions<DC>): Promise<void>;
49
+ protected doAddElectronFuses(packContext: AfterPackContext): Promise<void>;
36
50
  private generateFuseConfig;
37
51
  /**
38
52
  * Use `AfterPackContext` here to keep available for public API
@@ -99,7 +99,14 @@ class PlatformPackager {
99
99
  }
100
100
  async pack(outDir, arch, targets, taskManager) {
101
101
  const appOutDir = this.computeAppOutDir(outDir, arch);
102
- await this.doPack(outDir, appOutDir, this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets);
102
+ await this.doPack({
103
+ outDir,
104
+ appOutDir,
105
+ platformName: this.platform.nodeName,
106
+ arch,
107
+ platformSpecificBuildOptions: this.platformSpecificBuildOptions,
108
+ targets,
109
+ });
103
110
  this.packageInDistributableFormat(appOutDir, arch, targets, taskManager);
104
111
  }
105
112
  packageInDistributableFormat(appOutDir, arch, targets, taskManager) {
@@ -142,7 +149,8 @@ class PlatformPackager {
142
149
  defaultSrc: this.projectDir,
143
150
  };
144
151
  }
145
- async doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets, sign = true, disableAsarIntegrity = false) {
152
+ async doPack(packOptions) {
153
+ var _a;
146
154
  if (this.packagerOptions.prepackaged != null) {
147
155
  return;
148
156
  }
@@ -151,6 +159,7 @@ class PlatformPackager {
151
159
  }
152
160
  // Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256
153
161
  delete process.env.GYP_MSVS_VERSION;
162
+ const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets, options } = packOptions;
154
163
  const beforePack = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.beforePack, "beforePack");
155
164
  if (beforePack != null) {
156
165
  await beforePack({
@@ -227,10 +236,14 @@ class PlatformPackager {
227
236
  }
228
237
  if (framework.beforeCopyExtraFiles != null) {
229
238
  const resourcesRelativePath = this.platform === index_1.Platform.MAC ? "Resources" : (0, Framework_1.isElectronBased)(framework) ? "resources" : "";
239
+ let asarIntegrity = null;
240
+ if (!(asarOptions == null || (options === null || options === void 0 ? void 0 : options.disableAsarIntegrity))) {
241
+ asarIntegrity = await (0, integrity_1.computeData)({ resourcesPath, resourcesRelativePath, resourcesDestinationPath: this.getResourcesDir(appOutDir), extraResourceMatchers });
242
+ }
230
243
  await framework.beforeCopyExtraFiles({
231
244
  packager: this,
232
245
  appOutDir,
233
- asarIntegrity: asarOptions == null || disableAsarIntegrity ? null : await (0, integrity_1.computeData)({ resourcesPath, resourcesRelativePath }),
246
+ asarIntegrity,
234
247
  platformName,
235
248
  });
236
249
  }
@@ -249,15 +262,21 @@ class PlatformPackager {
249
262
  }
250
263
  const isAsar = asarOptions != null;
251
264
  await this.sanityCheckPackage(appOutDir, isAsar, framework, !!this.config.disableSanityCheckAsar);
252
- // the fuses MUST be flipped right before signing
253
- if (this.config.electronFuses != null) {
254
- const fuseConfig = this.generateFuseConfig(this.config.electronFuses);
255
- await this.addElectronFuses(packContext, fuseConfig);
265
+ if (!(options === null || options === void 0 ? void 0 : options.disableFuses)) {
266
+ await this.doAddElectronFuses(packContext);
256
267
  }
257
- if (sign) {
268
+ if ((_a = options === null || options === void 0 ? void 0 : options.sign) !== null && _a !== void 0 ? _a : true) {
258
269
  await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets);
259
270
  }
260
271
  }
272
+ // the fuses MUST be flipped right before signing
273
+ async doAddElectronFuses(packContext) {
274
+ if (this.config.electronFuses == null) {
275
+ return;
276
+ }
277
+ const fuseConfig = this.generateFuseConfig(this.config.electronFuses);
278
+ await this.addElectronFuses(packContext, fuseConfig);
279
+ }
261
280
  generateFuseConfig(fuses) {
262
281
  const config = {
263
282
  version: fuses_1.FuseVersion.V1,