update electron to v43

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View file

@ -1,5 +1,6 @@
import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from "../index";
export declare type MacOsTargetName = "default" | "dmg" | "mas" | "mas-dev" | "pkg" | "7z" | "zip" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "dir";
import { CustomMacSign } from "../macPackager";
export type MacOsTargetName = "default" | "dmg" | "mas" | "mas-dev" | "pkg" | "7z" | "zip" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "dir";
export interface MacConfiguration extends PlatformSpecificBuildOptions {
/**
* The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.
@ -10,22 +11,32 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
*/
readonly category?: string | null;
/**
* 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).
* The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
* 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.
* @default default (dmg and zip for Squirrel.Mac)
*/
readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null;
/**
* The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.
* MAS installer identity is specified in the [mas](/configuration/mas).
* The signing identity (certificate name) to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](https://www.electron.build/code-signing) instead of specifying this option.
* MAS installer identity is specified in the [mas](https://www.electron.build/mas).
*
* - **Not set** (default): electron-builder searches the keychain for a valid signing certificate. If none is found, signing is skipped for all architectures there is no automatic ad-hoc fallback.
* - **`null`**: skip signing entirely.
* - **`"-"`**: opt in to ad-hoc signing explicitly. Note that `hardenedRuntime: true` (the default) combined with ad-hoc signing requires
* the [`com.apple.security.cs.disable-library-validation`](https://developer.apple.com/documentation/BundleResources/Entitlements/com.apple.security.cs.disable-library-validation)
* entitlement to prevent app launch failures; otherwise set `hardenedRuntime: false`.
*/
readonly identity?: string | null;
/**
* The path to application icon.
* Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).
* If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.
* @default build/icon.icns
*/
readonly icon?: string | null;
/**
* 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).
* MAS entitlements is specified in the [mas](/configuration/mas).
* MAS entitlements is specified in the [mas](https://www.electron.build/mas).
* See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.
* 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+.
* 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.
@ -112,10 +123,6 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
* Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.
*/
readonly requirements?: string | null;
/**
* The electron locales. By default Electron locales used as is.
*/
readonly electronLanguages?: Array<string> | string;
/** @private */
readonly cscInstallerLink?: string | null;
/** @private */
@ -126,23 +133,38 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
readonly extraDistFiles?: Array<string> | string | null;
/**
* Whether your app has to be signed with hardened runtime.
*
* When using ad-hoc signing (`identity: "-"`), hardened runtime enforces library validation which
* will reject pre-signed Electron frameworks that carry a different Team ID. To resolve this either
* set `hardenedRuntime: false` or add the
* [`com.apple.security.cs.disable-library-validation`](https://developer.apple.com/documentation/BundleResources/Entitlements/com.apple.security.cs.disable-library-validation)
* entitlement to your entitlements file.
* @default true
*/
readonly hardenedRuntime?: boolean;
/**
* Whether to let electron-osx-sign validate the signing or not.
* Whether to let `@electron/osx-sign` validate the signing or not.
* @default false
*/
readonly gatekeeperAssess?: boolean;
/**
* Whether to let electron-osx-sign verify the contents or not.
* Whether to let `@electron/osx-sign` verify the contents or not.
* @default true
*/
readonly strictVerify?: Array<string> | string | boolean;
readonly strictVerify?: boolean;
/**
* Whether to enable entitlements automation from `@electron/osx-sign`.
* @default true
*/
readonly preAutoEntitlements?: boolean;
/**
* Regex or an array of regex's that signal skipping signing a file.
*/
readonly signIgnore?: Array<string> | string | null;
/**
* The custom function (or path to file or module id) to sign an app bundle.
*/
readonly sign?: CustomMacSign | string | null;
/**
* Specify the URL of the timestamp authority server
*/
@ -161,7 +183,7 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
* This option has no effect unless building for "universal" arch and applies
* only if `mergeASARs` is `true`.
*/
readonly singleArchFiles?: string;
readonly singleArchFiles?: string | null;
/**
* Minimatch pattern of paths that are allowed to be x64 binaries in both
* ASAR files
@ -169,7 +191,26 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
* This option has no effect unless building for "universal" arch and applies
* only if `mergeASARs` is `true`.
*/
readonly x64ArchFiles?: string;
readonly x64ArchFiles?: string | null;
/**
* Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.
*
* 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.
* Usage Example: `['--deep']`
*/
readonly additionalArguments?: Array<string> | null;
/**
* Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.
*
* Note: In order to activate the notarization step You MUST specify one of the following via environment variables:
*
* 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.
* 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`
* 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`
*
* For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)
*/
readonly notarize?: boolean;
}
export interface DmgOptions extends TargetSpecificOptions {
/**
@ -179,11 +220,16 @@ export interface DmgOptions extends TargetSpecificOptions {
*/
background?: string | null;
/**
* The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.
* The background color (accepts css colors). Used when no background image is set.
* @default #ffffff
*/
backgroundColor?: string | null;
/**
* The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.
* The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.
*/
badgeIcon?: string | null;
/**
* The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.
* Defaults to the application icon (`build/icon.icns`).
*/
icon?: string | null;
@ -213,6 +259,24 @@ export interface DmgOptions extends TargetSpecificOptions {
* @default UDZO
*/
format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
/**
* The filesystem for the DMG volume (e.g. `"APFS"` or `"HFS+"`)
* This will be changed to APFS in the next major release, so it is recommended to set it explicitly to HFS+ if you want to keep using HFS+ (e.g. for better compatibility with older macOS versions).
* @default HFS+
*/
readonly filesystem?: "HFS+" | "APFS" | null;
/**
* The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `"150m"`, `"4g"`.
* If not specified, the size is calculated automatically.
* Set this explicitly for large apps or apps with sparse files to avoid "No space left on device" errors.
*/
readonly size?: string | null;
/**
* Whether to shrink the DMG filesystem to the minimum size after copying files.
* Set to `false` to preserve the explicit `size` you specified.
* @default true
*/
readonly shrink?: boolean;
/**
* The DMG window position and size. With y co-ordinates running from bottom to top.
*
@ -230,6 +294,35 @@ export interface DmgOptions extends TargetSpecificOptions {
* @default false
*/
readonly sign?: boolean;
/**
* License agreement to display when the DMG is mounted.
*
* Accepts a single file path (`.rtf`, `.txt`, or `.html`) used as the English/default license,
* or a language-code file-path map for multi-language builds.
*
* When set, this takes precedence over the file-naming convention
* (`license_en.txt`, etc. in the build resources directory).
* Paths are resolved relative to the build resources directory or project root.
*
* @example Single language
* ```yaml
* dmg:
* license: "build/license.rtf"
* ```
*
* @example Multi-language
* ```yaml
* dmg:
* license:
* en_US: "build/license.rtf"
* de_DE: "build/license_de.txt"
* ja_JP: "build/license_ja.txt"
* ```
*
* If not set, electron-builder scans the build resources directory for
* `license_LANG.{rtf,txt,html}` files automatically.
*/
license?: string | Record<string, string> | null;
/**
* @private
* @default true