app-builder-lib 27.0.0-alpha.12 → 27.0.0-alpha.14

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 (259) hide show
  1. package/dist/asar/asarUtil.js +1 -1
  2. package/dist/asar/asarUtil.js.map +1 -1
  3. package/dist/codeSign/certInfo.d.ts +4 -1
  4. package/dist/codeSign/certInfo.d.ts.map +1 -1
  5. package/dist/codeSign/certInfo.js +5 -3
  6. package/dist/codeSign/certInfo.js.map +1 -1
  7. package/dist/codeSign/forceCodeSigning.d.ts +22 -0
  8. package/dist/codeSign/forceCodeSigning.d.ts.map +1 -0
  9. package/dist/codeSign/forceCodeSigning.js +18 -0
  10. package/dist/codeSign/forceCodeSigning.js.map +1 -0
  11. package/dist/codeSign/mac/macCodeSign.d.ts +13 -1
  12. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  13. package/dist/codeSign/mac/macCodeSign.js +29 -2
  14. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  15. package/dist/codeSign/mac/macSignatureVerifier.d.ts +23 -0
  16. package/dist/codeSign/mac/macSignatureVerifier.d.ts.map +1 -0
  17. package/dist/codeSign/mac/macSignatureVerifier.js +96 -0
  18. package/dist/codeSign/mac/macSignatureVerifier.js.map +1 -0
  19. package/dist/codeSign/win/authenticodeSignature.d.ts +14 -2
  20. package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -1
  21. package/dist/codeSign/win/authenticodeSignature.js +78 -30
  22. package/dist/codeSign/win/authenticodeSignature.js.map +1 -1
  23. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -1
  24. package/dist/codeSign/win/pkcs11SignManager.js +4 -3
  25. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -1
  26. package/dist/codeSign/win/publisherName.d.ts +31 -0
  27. package/dist/codeSign/win/publisherName.d.ts.map +1 -0
  28. package/dist/codeSign/win/publisherName.js +78 -0
  29. package/dist/codeSign/win/publisherName.js.map +1 -0
  30. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +16 -9
  31. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  32. package/dist/codeSign/win/signtoolBaseSignManager.js +46 -35
  33. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  34. package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -1
  35. package/dist/codeSign/win/verifyUpdatePublisher.js +7 -4
  36. package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -1
  37. package/dist/codeSign/win/windowsSignAzureManager.d.ts +1 -1
  38. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  39. package/dist/codeSign/win/windowsSignAzureManager.js +24 -6
  40. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  41. package/dist/configuration.d.ts +93 -4
  42. package/dist/configuration.d.ts.map +1 -1
  43. package/dist/configuration.js.map +1 -1
  44. package/dist/electron/mac/asarIntegrityDigest.js +2 -2
  45. package/dist/electron/mac/asarIntegrityDigest.js.map +1 -1
  46. package/dist/electron/mac/electronMacUtils.d.ts +3 -2
  47. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
  48. package/dist/electron/mac/electronMacUtils.js +3 -2
  49. package/dist/electron/mac/electronMacUtils.js.map +1 -1
  50. package/dist/fileMatcher.d.ts.map +1 -1
  51. package/dist/fileMatcher.js +4 -2
  52. package/dist/fileMatcher.js.map +1 -1
  53. package/dist/index.d.ts +1 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +4 -3
  56. package/dist/index.js.map +1 -1
  57. package/dist/indexInternal.d.ts +7 -2
  58. package/dist/indexInternal.d.ts.map +1 -1
  59. package/dist/indexInternal.js +6 -2
  60. package/dist/indexInternal.js.map +1 -1
  61. package/dist/linuxPackager.js +1 -1
  62. package/dist/linuxPackager.js.map +1 -1
  63. package/dist/macPackager.d.ts +26 -0
  64. package/dist/macPackager.d.ts.map +1 -1
  65. package/dist/macPackager.js +168 -12
  66. package/dist/macPackager.js.map +1 -1
  67. package/dist/options/PlatformSpecificBuildOptions.d.ts +19 -13
  68. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  69. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  70. package/dist/options/SquirrelWindowsOptions.d.ts +3 -0
  71. package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
  72. package/dist/options/SquirrelWindowsOptions.js.map +1 -1
  73. package/dist/options/macOptions.d.ts +7 -2
  74. package/dist/options/macOptions.d.ts.map +1 -1
  75. package/dist/options/macOptions.js.map +1 -1
  76. package/dist/options/winOptions.d.ts +61 -15
  77. package/dist/options/winOptions.d.ts.map +1 -1
  78. package/dist/options/winOptions.js +20 -0
  79. package/dist/options/winOptions.js.map +1 -1
  80. package/dist/packager.d.ts +7 -0
  81. package/dist/packager.d.ts.map +1 -1
  82. package/dist/packager.js +21 -5
  83. package/dist/packager.js.map +1 -1
  84. package/dist/platformPackager.d.ts +14 -5
  85. package/dist/platformPackager.d.ts.map +1 -1
  86. package/dist/platformPackager.js +44 -13
  87. package/dist/platformPackager.js.map +1 -1
  88. package/dist/publish/PublishManager.d.ts +3 -0
  89. package/dist/publish/PublishManager.d.ts.map +1 -1
  90. package/dist/publish/PublishManager.js +50 -16
  91. package/dist/publish/PublishManager.js.map +1 -1
  92. package/dist/publish/manifestUploadCheck.d.ts +10 -0
  93. package/dist/publish/manifestUploadCheck.d.ts.map +1 -0
  94. package/dist/publish/manifestUploadCheck.js +75 -0
  95. package/dist/publish/manifestUploadCheck.js.map +1 -0
  96. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  97. package/dist/publish/updateInfoBuilder.js +58 -22
  98. package/dist/publish/updateInfoBuilder.js.map +1 -1
  99. package/dist/publish/updateManifestVerifier.d.ts +22 -0
  100. package/dist/publish/updateManifestVerifier.d.ts.map +1 -0
  101. package/dist/publish/updateManifestVerifier.js +65 -0
  102. package/dist/publish/updateManifestVerifier.js.map +1 -0
  103. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  104. package/dist/targets/ArchiveTarget.js +6 -2
  105. package/dist/targets/ArchiveTarget.js.map +1 -1
  106. package/dist/targets/archive.d.ts.map +1 -1
  107. package/dist/targets/archive.js +3 -3
  108. package/dist/targets/archive.js.map +1 -1
  109. package/dist/targets/blockmap/blockmap.d.ts +30 -0
  110. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  111. package/dist/targets/blockmap/blockmap.js +99 -31
  112. package/dist/targets/blockmap/blockmap.js.map +1 -1
  113. package/dist/targets/blockmap/blockmapV3.d.ts +36 -0
  114. package/dist/targets/blockmap/blockmapV3.d.ts.map +1 -0
  115. package/dist/targets/blockmap/blockmapV3.js +41 -0
  116. package/dist/targets/blockmap/blockmapV3.js.map +1 -0
  117. package/dist/targets/blockmap/verbatimRange.d.ts +6 -0
  118. package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -1
  119. package/dist/targets/blockmap/verbatimRange.js +11 -0
  120. package/dist/targets/blockmap/verbatimRange.js.map +1 -1
  121. package/dist/targets/differentialUpdateInfoBuilder.d.ts +92 -4
  122. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  123. package/dist/targets/differentialUpdateInfoBuilder.js +266 -10
  124. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  125. package/dist/targets/linux/FlatpakTarget.js +5 -5
  126. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  127. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  128. package/dist/targets/linux/FpmTarget.js +25 -8
  129. package/dist/targets/linux/FpmTarget.js.map +1 -1
  130. package/dist/targets/linux/LinuxTargetHelper.js +1 -1
  131. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  132. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  133. package/dist/targets/linux/appimage/AppImageTarget.js +6 -1
  134. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  135. package/dist/targets/linux/appimage/appImageUtil.js +9 -9
  136. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  137. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -1
  138. package/dist/targets/linux/flatpakBundle.js +25 -20
  139. package/dist/targets/linux/flatpakBundle.js.map +1 -1
  140. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  141. package/dist/targets/linux/snap/coreLegacy.js +22 -6
  142. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  143. package/dist/targets/linux/snap/snapPlugs.d.ts +2 -2
  144. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -1
  145. package/dist/targets/linux/snap/snapPlugs.js +1 -1
  146. package/dist/targets/linux/snap/snapPlugs.js.map +1 -1
  147. package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
  148. package/dist/targets/linux/snap/snapcraftBuilder.js +19 -17
  149. package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
  150. package/dist/targets/mac/MacTargetHelper.d.ts +15 -3
  151. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  152. package/dist/targets/mac/MacTargetHelper.js +96 -13
  153. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  154. package/dist/targets/mac/pkg.d.ts.map +1 -1
  155. package/dist/targets/mac/pkg.js +7 -5
  156. package/dist/targets/mac/pkg.js.map +1 -1
  157. package/dist/targets/targetFactory.d.ts +1 -1
  158. package/dist/targets/targetFactory.d.ts.map +1 -1
  159. package/dist/targets/targetFactory.js +22 -0
  160. package/dist/targets/targetFactory.js.map +1 -1
  161. package/dist/targets/win/MsiTarget.d.ts +7 -0
  162. package/dist/targets/win/MsiTarget.d.ts.map +1 -1
  163. package/dist/targets/win/MsiTarget.js +140 -21
  164. package/dist/targets/win/MsiTarget.js.map +1 -1
  165. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  166. package/dist/targets/win/nsis/NsisTarget.js +22 -8
  167. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  168. package/dist/targets/win/nsis/nsisOptions.d.ts +1 -1
  169. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  170. package/dist/toolsets/appimage.d.ts +3 -0
  171. package/dist/toolsets/appimage.d.ts.map +1 -1
  172. package/dist/toolsets/appimage.js +4 -1
  173. package/dist/toolsets/appimage.js.map +1 -1
  174. package/dist/toolsets/nsis.js +1 -1
  175. package/dist/toolsets/nsis.js.map +1 -1
  176. package/dist/toolsets/wine.d.ts +3 -0
  177. package/dist/toolsets/wine.d.ts.map +1 -1
  178. package/dist/toolsets/wine.js +14 -5
  179. package/dist/toolsets/wine.js.map +1 -1
  180. package/dist/toolsets/wix.d.ts +44 -0
  181. package/dist/toolsets/wix.d.ts.map +1 -0
  182. package/dist/toolsets/wix.js +91 -0
  183. package/dist/toolsets/wix.js.map +1 -0
  184. package/dist/util/appFileCopier.d.ts.map +1 -1
  185. package/dist/util/appFileCopier.js +9 -3
  186. package/dist/util/appFileCopier.js.map +1 -1
  187. package/dist/util/buildOutputVerifier.d.ts +40 -0
  188. package/dist/util/buildOutputVerifier.d.ts.map +1 -0
  189. package/dist/util/buildOutputVerifier.js +420 -0
  190. package/dist/util/buildOutputVerifier.js.map +1 -0
  191. package/dist/util/config/fileOptions.js +2 -2
  192. package/dist/util/config/fileOptions.js.map +1 -1
  193. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
  194. package/dist/util/config/legacyConfigGuard.js +2 -2
  195. package/dist/util/config/legacyConfigGuard.js.map +1 -1
  196. package/dist/util/config/legacyOptions.d.ts +9 -2
  197. package/dist/util/config/legacyOptions.d.ts.map +1 -1
  198. package/dist/util/config/legacyOptions.js +8 -2
  199. package/dist/util/config/legacyOptions.js.map +1 -1
  200. package/dist/util/electronGet.d.ts.map +1 -1
  201. package/dist/util/electronGet.js +3 -1
  202. package/dist/util/electronGet.js.map +1 -1
  203. package/dist/util/electronUpdaterCompatibility.d.ts +43 -0
  204. package/dist/util/electronUpdaterCompatibility.d.ts.map +1 -0
  205. package/dist/util/electronUpdaterCompatibility.js +53 -0
  206. package/dist/util/electronUpdaterCompatibility.js.map +1 -0
  207. package/dist/util/flags.d.ts.map +1 -1
  208. package/dist/util/flags.js +3 -9
  209. package/dist/util/flags.js.map +1 -1
  210. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  211. package/dist/util/mac/macosIconComposer.js +6 -5
  212. package/dist/util/mac/macosIconComposer.js.map +1 -1
  213. package/dist/util/macroExpander.js +1 -1
  214. package/dist/util/macroExpander.js.map +1 -1
  215. package/dist/util/nativeBinaryVerifier.d.ts.map +1 -1
  216. package/dist/util/nativeBinaryVerifier.js +3 -1
  217. package/dist/util/nativeBinaryVerifier.js.map +1 -1
  218. package/dist/util/packageMetadata.js +116 -52
  219. package/dist/util/packageMetadata.js.map +1 -1
  220. package/dist/util/removedEnvVars.d.ts +2 -0
  221. package/dist/util/removedEnvVars.d.ts.map +1 -1
  222. package/dist/util/removedEnvVars.js +15 -1
  223. package/dist/util/removedEnvVars.js.map +1 -1
  224. package/dist/util/streamSpawnToFile.d.ts +3 -1
  225. package/dist/util/streamSpawnToFile.d.ts.map +1 -1
  226. package/dist/util/streamSpawnToFile.js +6 -2
  227. package/dist/util/streamSpawnToFile.js.map +1 -1
  228. package/dist/version.d.ts +1 -1
  229. package/dist/version.js +1 -1
  230. package/dist/version.js.map +1 -1
  231. package/dist/vm/ParallelsVm.d.ts +10 -0
  232. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  233. package/dist/vm/ParallelsVm.js +22 -8
  234. package/dist/vm/ParallelsVm.js.map +1 -1
  235. package/dist/vm/PwshVm.d.ts +0 -1
  236. package/dist/vm/PwshVm.d.ts.map +1 -1
  237. package/dist/vm/PwshVm.js +10 -15
  238. package/dist/vm/PwshVm.js.map +1 -1
  239. package/dist/vm/WineVm.d.ts.map +1 -1
  240. package/dist/vm/WineVm.js +4 -4
  241. package/dist/vm/WineVm.js.map +1 -1
  242. package/dist/vm/vm.d.ts +9 -3
  243. package/dist/vm/vm.d.ts.map +1 -1
  244. package/dist/vm/vm.js +40 -32
  245. package/dist/vm/vm.js.map +1 -1
  246. package/dist/winPackager.d.ts +16 -1
  247. package/dist/winPackager.d.ts.map +1 -1
  248. package/dist/winPackager.js +77 -19
  249. package/dist/winPackager.js.map +1 -1
  250. package/package.json +9 -9
  251. package/scheme.json +542 -29
  252. package/templates/msi/template.xml +5 -5
  253. package/templates/msiWrapped/template.xml +1 -1
  254. package/templates/nsis/assistedInstaller.nsh +32 -1
  255. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +14 -9
  256. package/dist/vm/MonoVm.d.ts +0 -9
  257. package/dist/vm/MonoVm.d.ts.map +0 -1
  258. package/dist/vm/MonoVm.js +0 -16
  259. package/dist/vm/MonoVm.js.map +0 -1
@@ -18,6 +18,8 @@ import { ArtifactBuildStarted, ArtifactCreated } from "./packagerApi.js";
18
18
  import { PlatformPackager } from "./platformPackager.js";
19
19
  import { NsisOptions, NsisWebOptions, PortableOptions } from "./targets/win/nsis/nsisOptions.js";
20
20
  import { ElectronGetOptions } from "./util/electronGet.js";
21
+ import type { ExecutablesConfig } from "builder-util";
22
+ export type { ExecutableLocation, ExecutableName, ExecutablesConfig } from "builder-util";
21
23
  import { FuseOptionsV1 } from "./options/FuseOptionsV1.js";
22
24
  /**
23
25
  * Production dependencies that are excluded from the copied `node_modules` by default. These are
@@ -92,6 +94,28 @@ export interface CommonConfiguration {
92
94
  * @see {@link ToolsetConfig}
93
95
  */
94
96
  readonly toolsets?: ToolsetConfig | null;
97
+ /**
98
+ * Format of the `<artifact>.blockmap` file published next to installers and update archives, which electron-updater reads for
99
+ * differential downloads. The map is read by the updater already installed in your users' apps, so the format follows
100
+ * `electronUpdaterCompatibility` (default `">=7"`):
101
+ *
102
+ * - unset: `"v3"` when `electronUpdaterCompatibility` includes only electron-updater 7 and later, else `"v2"`, with a build
103
+ * warning.
104
+ * - `"v3"`: a binary block map that electron-updater fetches in parts with HTTP `Range` requests (only the parts that changed
105
+ * since the installed version), with finer blocks for stored members such as an uncompressed `app.asar`. Needs electron-updater
106
+ * 7 or later: with an `electronUpdaterCompatibility` that includes earlier versions, the build fails.
107
+ * - `"v2"`: the gzipped JSON block map every electron-updater version reads, downloaded in full on every update; the package and
108
+ * block map are the same as electron-builder 26 wrote.
109
+ * - `"latest"`: the newest format the `electronUpdaterCompatibility` range supports (currently the same as unset). A future
110
+ * format then costs one full download per user, as below.
111
+ *
112
+ * Apps whose electron-updater cannot read a release's format, or whose cached map is in another format, download that update
113
+ * in full once; the next one is differential again, or with an artifact name without `${version}` the one after it.
114
+ *
115
+ * Block maps embedded in an artifact (AppImage, the NSIS web installer's app package) are always `"v2"`.
116
+ * See [the v27 notes](https://www.electron.build/docs/migration/v27-build-changes#block-map-format-follows-electronupdatercompatibility).
117
+ */
118
+ readonly blockmap?: "v2" | "v3" | "latest" | null;
95
119
  /**
96
120
  * macOS-specific build options (signing, entitlements, notarization, target categories, etc.).
97
121
  * @see {@link MacConfiguration}
@@ -405,12 +429,26 @@ export interface CommonConfiguration {
405
429
  */
406
430
  readonly extraMetadata?: any;
407
431
  /**
408
- * Whether to throw an error and abort the build if the app could not be code-signed.
432
+ * Whether to throw an error and abort the build if the app could not be code-signed, notarized, or have its
433
+ * auto-update manifests signed - and to verify the signatures the build produces.
409
434
  *
410
435
  * Set to `true` in release pipelines to catch missing or misconfigured signing credentials
411
436
  * before producing unsigned artifacts. When `false` (the default), missing signing credentials
412
437
  * produce a warning and the build continues unsigned.
413
438
  *
439
+ * With `true`:
440
+ * - macOS: the app must be signed, which needs a macOS host, also in pull-request builds (set `CSC_FOR_PULL_REQUEST=true` to sign
441
+ * them, or pass `-c.forceCodeSigning=false` there), and notarized: notarization credentials must be set when the build starts.
442
+ * The output of a custom `mac.sign` signer is checked with `codesign --verify --deep --strict`, the stapled ticket with
443
+ * `stapler validate`, a signed pkg with `pkgutil --check-signature`, and a DMG with `dmg.sign: true` must be signed.
444
+ * - Windows: every signed file is read back and must carry a valid Authenticode signature.
445
+ * - Every platform (the only effect on Linux): auto-update manifests must be signed, also by a build that does not publish.
446
+ * - A prepackaged app, which electron-builder does not sign, must already be signed (and, on macOS, notarized).
447
+ *
448
+ * Explicit opt-outs are honored with a warning: `mac.notarize: false`, `updateManifest: false`, `win.signExts` exclusions and a
449
+ * custom `nsis.script` (whose uninstaller electron-builder does not sign). `win.sign: false` and `mac.sign: null` contradict it
450
+ * and fail the build. `electron-builder verify` checks the build output afterwards.
451
+ *
414
452
  * @default false
415
453
  */
416
454
  readonly forceCodeSigning?: boolean;
@@ -661,6 +699,7 @@ export interface ToolsetConfig {
661
699
  * | `"0.0.0"` | Legacy | FUSE2-based AppImage runtime (pre-v27) |
662
700
  * | `"1.0.3"` | 20251108 | Introduces static AppImage runtime |
663
701
  * | `"1.1.0"` | 20251108 | Adds `unsquashfs` support |
702
+ * | `"1.2.0"` | 20251108 | squashfs-tools 4.7.5 with a statically linked zstd 1.5.7, so Linux and macOS hosts produce identical images |
664
703
  *
665
704
  * An explicit version pin always selects exactly that release.
666
705
  *
@@ -668,7 +707,7 @@ export interface ToolsetConfig {
668
707
  *
669
708
  * @default "latest"
670
709
  */
671
- readonly appimage?: "0.0.0" | "1.0.3" | "1.1.0" | ToolsetCustom | "latest";
710
+ readonly appimage?: "0.0.0" | "1.0.3" | "1.1.0" | "1.2.0" | ToolsetCustom | "latest";
672
711
  /**
673
712
  * Version of the NSIS toolset bundle used to compile Windows installers.
674
713
  *
@@ -692,6 +731,29 @@ export interface ToolsetConfig {
692
731
  * @default "latest"
693
732
  */
694
733
  readonly nsis?: "0.0.0" | "1.2.1" | ToolsetCustom | "latest";
734
+ /**
735
+ * Version of the WiX Toolset bundle used to build `msi` and `msiWrapped` installers.
736
+ *
737
+ * The bundle ships **`candle.exe`** and **`light.exe`** (compile and link the generated `.wxs` project) and the WiX
738
+ * extensions (`WixUIExtension` for assisted installers). On macOS and Linux they run under Wine with wine-mono.
739
+ *
740
+ * Available versions:
741
+ * | Version | WiX version | Notes |
742
+ * |---------|-------------|-------|
743
+ * | `"0.0.0"` | 4.0.0.5512 (preview) | Legacy bundle (pre-v27). An `arm64` app is packaged in an `x64` MSI, because this toolset has no `arm64` |
744
+ * | `"2.0.0"` | 3.14.1 | Builds a native `arm64` MSI for `arm64` |
745
+ *
746
+ * The `.wxs` project uses the WiX 3 schema with `"2.0.0"`: an `msiProjectCreated` hook that inserts elements of a WiX 4
747
+ * extension namespace must use the WiX 3 one (for example `http://schemas.microsoft.com/wix/UtilExtension`), or pin `"0.0.0"`.
748
+ *
749
+ * A custom bundle (a {@link ToolsetCustom} object) must have the WiX v3 layout: `candle.exe`, `light.exe` and the
750
+ * extensions at its root.
751
+ *
752
+ * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wix/CHANGELOG.md
753
+ *
754
+ * @default "latest"
755
+ */
756
+ readonly wix?: "0.0.0" | "2.0.0" | ToolsetCustom | "latest";
695
757
  /**
696
758
  * Version of the Wine bundle used to run Windows tools (NSIS, rcedit, signtool) on
697
759
  * non-Windows hosts (macOS and Linux).
@@ -704,14 +766,19 @@ export interface ToolsetConfig {
704
766
  * |---------|-------------|-----------------|-------|
705
767
  * | `"0.0.0"` | 4.0.1 | macOS | Legacy portable bundle (pre-v27) |
706
768
  * | `"1.0.1"` | 11.0 | macOS | Supports arm64 macOS via Rosetta |
707
- * | `"system"` | host install | macOS, Linux | Uses the `wine` binary on `PATH` instead of a bundle |
769
+ * | `"system"` | host install | macOS, Linux | Uses the host Wine at a fixed install location instead of a bundle |
708
770
  *
709
771
  * `"system"` is the replacement for the `USE_SYSTEM_WINE` environment variable removed in v27, and
710
772
  * is what `"latest"` (the default) currently resolves to on every platform: the published `"1.0.1"`
711
773
  * bundles ship no PE builtins, so a host Wine installation is required to build Windows targets on
712
774
  * macOS or Linux.
713
775
  *
714
- * To use a custom Wine binary, use a `ToolsetCustom` object.
776
+ * The host Wine (`"system"`) is started by absolute path, never looked up on `PATH`: it is the `wine` entry of
777
+ * {@link executables}, which lists its default install locations and is where a Wine installed elsewhere is set.
778
+ * Setting both a bundle that would be used (a `ToolsetCustom` object, or a version on macOS; on Linux a version selects no
779
+ * bundle) and `executables.wine` is a configuration error.
780
+ *
781
+ * To use a custom Wine bundle, use a `ToolsetCustom` object.
715
782
  *
716
783
  * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wine/CHANGELOG.md
717
784
  *
@@ -811,6 +878,28 @@ export interface ToolsetConfig {
811
878
  * @default "latest"
812
879
  */
813
880
  readonly squirrel?: "1.1.1" | ToolsetCustom | "latest";
881
+ /**
882
+ * Where the host programs that electron-builder starts are installed on the build machine, by program name.
883
+ *
884
+ * electron-builder starts these programs only from an absolute path, never by looking up a name on `PATH`. For each one it
885
+ * uses the first location that is an executable file: from this entry when it is set, otherwise from a built-in list of
886
+ * default install locations for the host operating system (see https://www.electron.build/docs/toolsets#executables).
887
+ * An entry replaces the default list for that program; it is not merged with it.
888
+ *
889
+ * @example
890
+ * ```json
891
+ * {
892
+ * "toolsets": {
893
+ * "executables": {
894
+ * "mono": "file:///opt/homebrew/bin/mono",
895
+ * "pwsh": ["file:///usr/local/microsoft/powershell/7/pwsh", "file:///opt/microsoft/powershell/7/pwsh"],
896
+ * "powershell": "file:///C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"
897
+ * }
898
+ * }
899
+ * }
900
+ * ```
901
+ */
902
+ readonly executables?: ExecutablesConfig | null;
814
903
  }
815
904
  /**
816
905
  * A custom toolset bundle supplied by the user in place of a built-in versioned bundle.
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,gBAAgB,CAAA;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,GAAG,MAAM,GAAG,IAAI,CAAA;IAExE;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAE/E;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,uCAAuC,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;CAC9F;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE/B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,CAAA;CACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAA0B,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core.js\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework.js\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework.js\"\nimport { AppXOptions } from \"./options/AppXOptions.js\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions.js\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { MsiOptions } from \"./options/MsiOptions.js\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions.js\"\nimport { MsixOptions } from \"./options/MsixOptions.js\"\nimport { PkgOptions } from \"./options/pkgOptions.js\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { SnapcraftOptions } from \"./options/SnapOptions.js\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions.js\"\nimport { WindowsConfiguration } from \"./options/winOptions.js\"\nimport { BuildResult } from \"./packager.js\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/win/nsis/nsisOptions.js\"\nimport { ElectronGetOptions } from \"./util/electronGet.js\"\nimport { FuseOptionsV1 } from \"./options/FuseOptionsV1.js\"\n\n/**\n * Production dependencies that are excluded from the copied `node_modules` by default. These are\n * still legitimate production dependencies (for SBOM, license, and vulnerability tracking), but\n * electron-builder already provides them another way — notably the Electron runtime, which is\n * embedded separately — so copying them into the app would just duplicate what is already there.\n * Users can override the set via {@link CommonConfiguration.ignoredProductionDependencies}.\n *\n * Declared next to the option so the code constant, the jsdoc `@default`, and the generated\n * `scheme.json` stay in one place; a test asserts the generated schema matches this constant.\n */\nexport const DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES: ReadonlyArray<string> = [\"electron\", \"electron-builder\"]\n\n// duplicate appId here because it is important\n/**\n * Configuration options shared across all platforms.\n *\n * These properties apply regardless of the target platform and control general build behaviour such\n * as the application identity, output paths, native dependency rebuilding, toolset versions, and\n * platform-specific target sub-configurations.\n */\nexport interface CommonConfiguration {\n /**\n * The application identifier.\n *\n * Used as [`CFBundleIdentifier`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleidentifier)\n * on macOS and as the\n * [Application User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids)\n * on Windows (NSIS target only; Squirrel.Windows does not support custom Application User Model IDs).\n *\n * It is strongly recommended to set an explicit, reverse-DNS-style identifier (e.g. `\"com.example.myapp\"`)\n * rather than relying on the generated default.\n *\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * The human-readable product name displayed in installers, the macOS dock, and the Windows\n * Apps & Features list.\n *\n * Unlike the `name` field in `package.json`, this value may contain spaces and other characters\n * that are not allowed in npm package names.\n *\n * Resolution order:\n * 1. `productName` inside the `build` configuration block.\n * 2. `productName` at the top level of `package.json`.\n * 3. `name` at the top level of `package.json`.\n */\n readonly productName?: string | null\n\n /**\n * The copyright string embedded in the built artifacts.\n *\n * Appears in the Windows `LegalCopyright` version-info field and the macOS `NSHumanReadableCopyright`\n * Info.plist key.\n *\n * @default Copyright © ${year} ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Overrides for input/output directory paths used during the build.\n *\n * @see {@link MetadataDirectories}\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Pinned versions of the binary toolsets electron-builder downloads and uses internally.\n *\n * Each property selects a specific release of the corresponding tool bundle. Set a property to\n * `\"0.0.0\"` to force the legacy bundle (pre-v27 behaviour). Leave a property unset (or set it to\n * `\"latest\"`) to use the modern default (newest bundle) for that toolset.\n *\n * Note: Toolset versioning can drop intermediate releases (such as if a problem is discovered in a bundle). If you need to pin to a specific release, check the release notes for the toolset to ensure the version you specify is valid.\n *\n * @see {@link ToolsetConfig}\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * macOS-specific build options (signing, entitlements, notarization, target categories, etc.).\n * @see {@link MacConfiguration}\n */\n readonly mac?: MacConfiguration | null\n /**\n * macOS App Store (MAS) submission options.\n * @see {@link MasConfiguration}\n */\n readonly mas?: MasConfiguration | null\n /**\n * macOS App Store development-signing options (`mas-dev` target).\n * Used for local testing of MAS builds without submitting to the store.\n * @see {@link MasConfiguration}\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG disk image options (background image, window position, icon layout, licence, etc.).\n * @see {@link DmgOptions}\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG flat-package installer options.\n * @see {@link PkgOptions}\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Windows-specific build options (signing, NSIS, icon, file associations, etc.).\n * @see {@link WindowsConfiguration}\n */\n readonly win?: WindowsConfiguration | null\n /**\n * NSIS one-click installer options.\n *\n * NSIS (Nullsoft Scriptable Install System) is the default Windows installer format produced by\n * electron-builder. It generates a lightweight, self-extracting `.exe` installer.\n *\n * @see {@link NsisOptions}\n */\n readonly nsis?: NsisOptions | null\n /**\n * NSIS web installer options.\n *\n * Like the standard NSIS installer but the app payload is downloaded from a remote URL at install\n * time rather than bundled into the `.exe`. Useful for very large apps or staged rollouts.\n *\n * @see {@link NsisWebOptions}\n */\n readonly nsisWeb?: NsisWebOptions | null\n /**\n * Portable executable options.\n *\n * Produces a single `.exe` that requires no installation — it extracts and runs directly.\n *\n * @see {@link PortableOptions}\n */\n readonly portable?: PortableOptions | null\n /**\n * Windows Store (MSIX/AppX) package options.\n *\n * Produces a `.appx` or `.msix` package suitable for distribution through the Microsoft Store or\n * side-loading.\n *\n * @see {@link AppXOptions}\n */\n readonly appx?: AppXOptions | null\n /** MSIX package options. MSIX is the modern successor to AppX with additional deployment features. */\n readonly msix?: MsixOptions | null\n /**\n * WiX-based MSI installer options.\n *\n * Produces a traditional `.msi` package built with the WiX Toolset. Best for enterprise\n * deployments that require MSI-based installation policies.\n *\n * @see {@link MsiOptions}\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped NSIS installer options.\n *\n * Wraps the standard NSIS installer inside an MSI package so that it can be deployed via\n * Group Policy or other MSI-only channels while preserving the NSIS installer UX.\n *\n * @see {@link MsiWrappedOptions}\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows auto-update installer options.\n *\n * Requires the `electron-builder-squirrel-windows` optional dependency.\n *\n * @see {@link SquirrelWindowsOptions}\n */\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n /**\n * General Linux build options shared across all Linux targets (icon, category, desktop entry,\n * executable name, etc.). Target-specific compression and packaging options live in the\n * per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`, etc.).\n *\n * @see {@link LinuxConfiguration}\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n *\n * Targets Debian, Ubuntu, and Debian-based distributions. Produces a `.deb` archive\n * installable via `dpkg -i` or `apt install ./package.deb`.\n *\n * @see {@link DebOptions}\n */\n readonly deb?: DebOptions | null\n /**\n * Snapcraft configuration.\n *\n * Selects the snapcraft base and provides per-core options:\n * - `base: \"core18\" | \"core20\" | \"core22\"` — legacy bases; still functional but not recommended\n * for new apps.\n * - `base: \"core24\"` — modern base with the GNOME extension (recommended, requires Electron 25+).\n * - `base: \"custom\"` — pass an existing `snapcraft.yaml` through unchanged; no plugs, extensions,\n * or desktop files are injected.\n *\n * @example\n * ```json\n * { \"snapcraft\": { \"base\": \"core24\", \"core24\": { \"useLXD\": true } } }\n * ```\n *\n * @see {@link SnapcraftOptions}\n */\n readonly snapcraft?: SnapcraftOptions | null\n /**\n * AppImage options.\n *\n * AppImage is a portable application format that bundles the app and its runtime dependencies\n * into a single self-contained executable that runs on most Linux distributions without\n * installation. The produced `.AppImage` file is executable after `chmod +x`.\n *\n * @see {@link AppImageOptions}\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n *\n * Flatpak is a sandboxed application distribution format for Linux distributed via\n * [Flathub](https://flathub.org/) or self-hosted OSTree repositories.\n *\n * @see {@link FlatpakOptions}\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options.\n *\n * Targets Arch Linux and Arch-based distributions (Manjaro, EndeavourOS, etc.).\n * Produces a `.pacman` archive installable via `pacman -U ./package.pacman`.\n *\n * @see {@link PacmanOptions}\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options.\n *\n * Targets Fedora, Red Hat Enterprise Linux, SUSE, and RPM-based distributions.\n * Produces a `.rpm` archive installable via `rpm -i` or `dnf install ./package.rpm`.\n *\n * @see {@link RpmOptions}\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD `pkg` package options.\n *\n * Produces a `.pkg` archive for the FreeBSD package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options.\n *\n * Produces a `.p5p` archive for the Solaris Image Packaging System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options.\n *\n * Produces an `.apk` archive installable via `apk add --allow-untrusted ./package.apk`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Additional command-line arguments appended to the package manager's `install` command when\n * electron-builder installs app dependencies (i.e., when `node_modules` is missing and a fresh\n * install is required).\n *\n * These arguments are appended **only** during the install phase, not during the rebuild phase.\n * To influence `@electron/rebuild` directly, see {@link NativeModulesConfig.rebuildMode}.\n *\n * @example\n * ```json\n * { \"npmArgs\": [\"--prefer-offline\", \"--ignore-scripts\"] }\n * ```\n */\n readonly npmArgs?: Array<string> | string | null\n\n /**\n * Names of production dependencies that are excluded from the copied `node_modules`, even if they\n * are declared in the `dependencies` section of `package.json`.\n *\n * electron-builder copies the resolved production dependency tree into the app. Some packages —\n * notably `electron` — are already provided another way (the Electron runtime is embedded\n * separately), so copying them would just duplicate what is already there. Such packages are\n * excluded from the copy rather than rejected: they remain valid production dependencies for\n * tooling purposes (e.g. SBOM, license, and vulnerability tracking) without being shipped twice.\n *\n * Only dependencies **declared by the app itself** are eligible: a listed name and the transitive\n * dependencies required *only* by it are dropped, while anything also required by another (kept)\n * production dependency stays bundled. A matching name that appears solely as a transitive\n * dependency of a kept package is never excluded. Note that a kept package which `require()`s an\n * excluded name at runtime *without declaring it* (relying on hoisting) will fail with\n * `MODULE_NOT_FOUND` — declare such a dependency properly or remove the name from this list.\n *\n * Matching is by the dependency name as declared in `package.json`: an npm alias\n * (`\"custom-electron\": \"npm:electron@^30.0.0\"`) is matched by its alias key (`custom-electron`),\n * never by the underlying package name.\n *\n * Overriding this option **replaces** the default list, so include `electron` and `electron-builder`\n * unless you intend to ship them. The most common reason to override is to *add* a dependency that a\n * bundler (Vite, webpack, esbuild, …) already inlines into your app code: keep it in `dependencies`\n * so SBOM/license tooling still sees it, and list it here so a duplicate copy is not packaged — e.g.\n * `[\"electron\", \"electron-builder\", \"react\", \"react-dom\"]`. Removing a default name keeps that\n * package in the copied `node_modules`. Setting the option to `null` (or omitting it) applies the\n * default list; to disable exclusion entirely, set it to an empty array `[]`. Each excluded package\n * is logged once during packaging.\n *\n * @default [\"electron\", \"electron-builder\"]\n */\n readonly ignoredProductionDependencies?: Array<string> | null\n\n /**\n * Whether production dependencies that cannot be resolved during node-module collection are\n * allowed — i.e. whether the build should continue with a warning instead of failing.\n *\n * During collection every production dependency must resolve to an installed package on disk. A\n * dependency that does not resolve (`cannot find path for dependency` / `dependency not found on\n * disk`) is not bundled, which typically breaks the packaged app at runtime with\n * `MODULE_NOT_FOUND`.\n *\n * - `false` or `null` (default): the build fails after dependency collection completes,\n * reporting the **complete** list of missing production dependencies at once.\n * - `string[]`: the listed dependency names are allowed to be missing; any other missing\n * production dependency still fails the build. Entries match the package name of the reported\n * `name@version` entry (e.g. `some-native-module`, `@scope/pkg`), or an exact `name@version`\n * string to allow only that resolved version to be missing.\n * - `true`: missing production dependencies are only logged as warnings (the electron-builder\n * ≤ 26 behavior).\n *\n * Missing *optional* dependencies (declared in `optionalDependencies`, e.g. `fsevents` on\n * Linux/Windows, or platform-specific packages) are always allowed and never fail the build.\n *\n * Independent of {@link ignoredProductionDependencies}, which controls which dependencies are\n * excluded from the copied `node_modules`; this option only controls validation of the\n * collection result.\n *\n * @default false\n */\n readonly allowMissingDependencies?: boolean | Array<string> | null\n\n /**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * Groups all options that control how electron-builder handles native modules — from forcing\n * source builds during install through to the `@electron/rebuild` compilation mode.\n *\n * @see {@link NativeModulesConfig}\n */\n readonly nativeModules?: NativeModulesConfig | null\n\n /**\n * The build number.\n *\n * Maps to the `--iteration` flag for FPM-based Linux targets and is appended to the version\n * string in `CFBundleVersion` (macOS) and `FileVersion` (Windows) when {@link buildVersion} is\n * not set explicitly.\n *\n * If not set, falls back to the first defined environment variable among:\n * `BUILD_NUMBER`, `TRAVIS_BUILD_NUMBER`, `APPVEYOR_BUILD_NUMBER`, `CIRCLE_BUILD_NUM`,\n * `BUILD_BUILDNUMBER`, `CI_PIPELINE_IID`.\n */\n readonly buildNumber?: string | null\n\n /**\n * The full build version string.\n *\n * Maps to `CFBundleVersion` on macOS and the `FileVersion` metadata field on Windows.\n * Defaults to the `version` field from `package.json`.\n *\n * If `buildVersion` is not set but {@link buildNumber} is defined (or resolved from an\n * environment variable), the effective build version becomes `${version}.${buildNumber}`.\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the FFmpeg library variant from Electron's release assets and replace the\n * default (proprietary codec) FFmpeg library before signing.\n *\n * The alternate FFmpeg is compiled without proprietary codec support (H.264, AAC, etc.) and is\n * required for distributing on certain platforms (e.g., Linux distributions that prohibit\n * proprietary codecs). Enabling this swaps the bundled `ffmpeg` dynamic library before the app\n * is signed.\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Additional properties to deep-merge into the app's `package.json` at build time.\n *\n * Useful for injecting build-time metadata (e.g., a git commit hash or CI build URL) that\n * should be readable at runtime via `require('./package.json')` or `import.meta.url`.\n *\n * @example\n * ```json\n * { \"extraMetadata\": { \"commitHash\": \"abc1234\", \"buildDate\": \"2025-01-01\" } }\n * ```\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to throw an error and abort the build if the app could not be code-signed.\n *\n * Set to `true` in release pipelines to catch missing or misconfigured signing credentials\n * before producing unsigned artifacts. When `false` (the default), missing signing credentials\n * produce a warning and the build continues unsigned.\n *\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to remove the `scripts` field from bundled `package.json` files.\n *\n * Lifecycle scripts (`preinstall`, `postinstall`, etc.) have no meaning inside a packaged\n * Electron app and can trigger unintended behaviour if any tooling inspects the bundled\n * `package.json`. Removing them reduces artifact size and prevents accidental execution.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove the `keywords` field from bundled `package.json` files.\n *\n * The `keywords` array is only meaningful for package registry discoverability and has no\n * runtime value inside a packaged Electron app. Removing it marginally reduces artifact size.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options forwarded to [`@electron/fuses`](https://github.com/electron/fuses) to flip Electron\n * feature flags in the binary.\n *\n * Fuses are compile-time-like flags baked into the Electron binary that cannot be changed at\n * runtime. Flipping them is the approved mechanism for hardening Electron apps (e.g., disabling\n * `ELECTRON_RUN_AS_NODE`, enabling ASAR integrity, etc.).\n *\n * electron-builder flips fuses after packaging but before signing so that the final signature\n * covers the modified binary.\n *\n * @see {@link FuseOptionsV1}\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * Configuration for experimental concurrent (multi-platform / multi-arch) builds.\n *\n * When `jobs > 1`, electron-builder runs up to `jobs` platform builds in parallel. This is an\n * experimental feature — use with caution and verify that your hook functions and build resources\n * are safe to execute concurrently.\n *\n * @see {@link Concurrency}\n */\n readonly concurrency?: Concurrency | null\n}\n\n/**\n * The root build configuration object passed to electron-builder.\n *\n * Extends {@link CommonConfiguration} with top-level Electron-specific options, configuration\n * inheritance/presets, and all per-platform build hooks.\n */\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Options forwarded to [`@electron/get`](https://github.com/electron/get) when downloading the\n * Electron distribution to package.\n *\n * `checksums` (a map of artifact file name → SHA-256 hex) makes checksum validation fully offline —\n * without it, `@electron/get` fetches `SHASUMS256.txt` from the network on every build, even when the\n * artifact itself is already cached. When `checksums` is not configured, electron-builder automatically\n * picks up a locally seeded `SHASUMS256.txt-<version>` (or `SHASUMS256.txt`) file at the root of the\n * Electron cache directory. See the\n * [air-gapped / offline builds guide](https://www.electron.build/tutorials/offline-air-gapped-builds).\n */\n readonly electronGet?: ElectronGetOptions | null\n\n /**\n * Electron branding overrides.\n *\n * Required only when packaging a custom Electron fork that ships a modified `BRANDING.json`\n * (e.g., a fork that renames the `Electron Helper` process or the `Electron Framework`).\n * Standard Electron builds do not need this.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The Electron version to package against.\n *\n * Defaults to the version of the `electron` (or `electron-prebuilt`) dependency declared in\n * `package.json`. Set this explicitly only when the installed Electron version is not the one\n * you want to package against (e.g., in monorepos where the Electron dependency lives in a\n * different workspace).\n */\n electronVersion?: string | null\n\n /**\n * Whether to write `builder-effective-config.yaml` (the resolved configuration, including the detected\n * `electronVersion`) to the output directory.\n *\n * Defaults to writing it only for local interactive builds: not on CI and not when stdout is piped.\n * Set `true` to always write it, e.g. to read the resolved configuration in a CI step, or `false` to never write it.\n */\n readonly writeEffectiveConfig?: boolean | null\n\n /**\n * One or more configuration presets or file paths to merge into this configuration.\n *\n * Accepts a string or array of strings, each of which is either:\n * - A built-in preset name (`\"react-cra\"` is the only currently supported value).\n * - A path to a JS/JSON config file relative to the project directory.\n *\n * Configs are merged left-to-right using a deep-assign strategy that properly combines `files`\n * glob patterns rather than replacing them.\n *\n * The `react-cra` preset is applied automatically when `react-scripts` is found in\n * `dependencies`. Set `extends: null` to opt out of automatic preset detection.\n */\n extends?: Array<string> | string | null\n}\n\n/**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * All options that control how electron-builder handles native modules — from forcing source\n * builds at install time through to the `@electron/rebuild` compilation mode.\n */\nexport interface NativeModulesConfig {\n /**\n * Whether to pass `--build-from-source` to the package manager when installing native\n * dependencies, forcing them to compile from source rather than using pre-built binaries.\n *\n * Useful when pre-built binaries are not available for the target platform/arch combination,\n * or when you need to ensure native modules are compiled against the exact Electron ABI.\n *\n * Only honored when the target platform matches the host platform: native modules cannot be\n * cross-compiled from source for another OS, so for a cross-platform target native dependencies are\n * rebuilt with prebuilt binaries for that target instead (and a warning is logged).\n *\n * @default false\n */\n buildDependenciesFromSource?: boolean\n\n /**\n * Whether to run `node-gyp rebuild` with Electron headers before packaging.\n *\n * This is a low-level escape hatch for cases where the standard `@electron/rebuild` path\n * (controlled by {@link npmRebuild}) is insufficient. Most projects should leave this `false`\n * and rely on `@electron/rebuild` instead.\n *\n * When `true`, electron-builder runs `node-gyp rebuild` with the correct `npm_config_*`\n * environment variables set for the target Electron version and architecture before the\n * normal rebuild step.\n *\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n\n /**\n * Whether to rebuild native Node.js modules for the target Electron version and architecture\n * before packaging.\n *\n * When `true` (the default), electron-builder runs `@electron/rebuild` against the app's\n * `node_modules` directory to ensure all native modules are compiled against the correct Electron\n * ABI. Set to `false` to skip this step entirely — useful when native modules are pre-built\n * elsewhere in your pipeline or when the app has no native dependencies.\n *\n * The compilation mode (`sequential` vs `parallel`) is controlled by {@link rebuildMode}.\n *\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * Compilation mode for `@electron/rebuild`.\n *\n * - `\"sequential\"` — rebuilds native modules one at a time. Safer in memory-constrained\n * environments and produces cleaner log output.\n * - `\"parallel\"` — rebuilds all native modules concurrently. Faster on machines with many cores\n * and plentiful memory, but may exhaust resources on CI agents with limited RAM.\n *\n * @default \"sequential\"\n */\n readonly rebuildMode?: \"sequential\" | \"parallel\" | null\n\n /**\n * Whether to verify, after the app is packed, that every native binary shipped in the app was built for\n * the target platform and architecture.\n *\n * electron-builder reads the header of each `.node` addon (and of other native libraries and executables\n * such as `.so`, `.dylib`, `.dll`, `.exe`) in `app.asar`, `app.asar.unpacked` or the unpacked `app`\n * directory, and compares its format (ELF / Mach-O / PE) and machine type against the target (for\n * a macOS universal build, each per-arch slice is checked before the slices are merged). This catches a\n * stale or host-platform binary left in `node_modules` by a skipped or cached rebuild, which otherwise\n * only surfaces at runtime as `invalid ELF header` / `not a valid Win32 application` /\n * `incompatible architecture`.\n *\n * Files whose package declares another platform via `package.json` `os`/`cpu`, or whose path names\n * another platform/arch (e.g. prebuildify's `prebuilds/linux-arm64/`), are not loaded for this target\n * and are ignored.\n *\n * - `true` (default) — a mismatched `.node` addon fails the build; other mismatched native files log a warning.\n * - `\"warn\"` — log every mismatch as a warning and continue.\n * - `false` — skip the check.\n *\n * @default true\n */\n readonly verifyNativeBinaries?: boolean | \"warn\" | null\n}\n\nexport type Hook<T, V> = (contextOrPath: T) => Promise<V> | V\n\nexport interface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\nexport type AfterExtractContext = PackContext\n\n/**\n * Version pins and custom bundle overrides for the binary toolsets that electron-builder downloads and caches locally.\n *\n * Each toolset is a versioned archive hosted at [electron-userland/electron-builder-binaries](https://github.com/electron-userland/electron-builder-binaries/releases).\n * Omitting a property (or setting it to `latest`) selects the modern default for that toolset.\n *\n * To supply your own bundle, set the property to a {@link ToolsetCustom} object with a `url` (https:// or file://) and a `checksum` for verification. The bundle must mirror the expected directory layout of the corresponding built-in bundle; see the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n */\nexport interface ToolsetConfig {\n /**\n * Version of the `win-codesign` bundle used for Windows code signing and resource editing.\n *\n * The bundle ships:\n * - **`signtool.exe`** (Windows) / **`osslsigncode`** (macOS & Linux) — used to sign `.exe`,\n * `.dll`, and `.msix` artifacts.\n * - **`rcedit`** — embeds version metadata and icons into `.exe` files (legacy usage, migrated to npm `resedit` package).\n * - **Windows Kits** — used by AppX/MSIX packaging (`makeappx`, `signtool`).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"0.0.0\"` | Legacy bundle — `winCodeSign-2.6.0` (pre-v27) |\n * | `\"1.0.0\"` | Windows Kits 10.0.26100.0, `osslsigncode` v2.9 |\n * | `\"1.1.1\"` | Updates `osslsigncode` to v2.11 |\n * | `\"1.2.1\"` | Adds native `osslsigncode` arm64 |\n * | `\"1.3.0\"` | Includes support for Azure Trusted Signing `signtool` via dlib and .NET 8 runtime |\n * | `\"1.3.1\"` | macOS `osslsigncode` bundles its own OpenSSL (no Homebrew `openssl@3` needed) and libp11's PKCS#11 provider |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/win-codesign/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | \"1.1.1\" | \"1.2.1\" | \"1.3.0\" | \"1.3.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the AppImage toolset bundle used for building `.AppImage` files.\n *\n * The bundle ships:\n * - **`mksquashfs`** — creates the SquashFS filesystem embedded in the AppImage. It also packs legacy-base (core18/core20/core22) snaps built from the snap template app.\n * - **`desktop-file-validate`** — validates the generated `.desktop` entry.\n * - **AppImage runtime** — the self-executing stub that mounts the SquashFS at launch.\n *\n * Available versions:\n * | Version | Runtime date | Notes |\n * |---------|-------------|-------|\n * | `\"0.0.0\"` | Legacy | FUSE2-based AppImage runtime (pre-v27) |\n * | `\"1.0.3\"` | 20251108 | Introduces static AppImage runtime |\n * | `\"1.1.0\"` | 20251108 | Adds `unsquashfs` support |\n *\n * An explicit version pin always selects exactly that release.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/appimage/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.3\" | \"1.1.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the NSIS toolset bundle used to compile Windows installers.\n *\n * The bundle ships:\n * - **`makensis`** — the NSIS compiler invoked to build `.nsi` scripts into `.exe` installers.\n * - **NSIS plugins** — the plugin DLLs (`NsisMultiUser`, `UAC`, `StdUtils`, etc.) referenced by\n * electron-builder's default installer scripts.\n * - **`elevate.exe`** — UAC elevation helper included in NSIS installers.\n *\n * Available versions:\n * | Version | `makensis` version | Notes |\n * |---------|------------------|-------|\n * | `\"0.0.0\"` | 3.0.4.1 | Legacy split bundle — `nsis` + `nsis-resources` archives (pre-v27) |\n * | `\"1.2.1\"` | 3.12 | Unified bundle — single archive, entrypoint scripts auto-set `NSISDIR` |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/nsis/CHANGELOG.md\n *\n * A custom bundle (a {@link ToolsetCustom} object) must follow the layout at\n * https://www.electron.build/docs/toolsets#custom-nsis-bundle-layout\n *\n * @default \"latest\"\n */\n readonly nsis?: \"0.0.0\" | \"1.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Wine bundle used to run Windows tools (NSIS, rcedit, signtool) on\n * non-Windows hosts (macOS and Linux).\n *\n * Wine is only required when building Windows targets on a non-Windows machine. On Windows,\n * this setting has no effect.\n *\n * Available versions:\n * | Version | Wine version | Platform support | Notes |\n * |---------|-------------|-----------------|-------|\n * | `\"0.0.0\"` | 4.0.1 | macOS | Legacy portable bundle (pre-v27) |\n * | `\"1.0.1\"` | 11.0 | macOS | Supports arm64 macOS via Rosetta |\n * | `\"system\"` | host install | macOS, Linux | Uses the `wine` binary on `PATH` instead of a bundle |\n *\n * `\"system\"` is the replacement for the `USE_SYSTEM_WINE` environment variable removed in v27, and\n * is what `\"latest\"` (the default) currently resolves to on every platform: the published `\"1.0.1\"`\n * bundles ship no PE builtins, so a host Wine installation is required to build Windows targets on\n * macOS or Linux.\n *\n * To use a custom Wine binary, use a `ToolsetCustom` object.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wine/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly wine?: \"0.0.0\" | \"1.0.1\" | \"system\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the FPM bundle used to build Linux packages (`.deb`, `.rpm`, `.pacman`, etc.)\n * on macOS and Linux hosts.\n *\n * Available versions:\n * | Version | FPM version | Notes |\n * |---------|------------|-------|\n * | `\"2.2.1\"` | 1.17.0 (Ruby 3.4.3) | Current default |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/fpm/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly fpm?: \"2.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Linux-tools-mac bundle used to produce `.tar.lz` archives and build\n * Linux targets on macOS hosts.\n *\n * The bundle ships macOS-native builds of `ar`, `lzip`, and `gtar` (GNU tar).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | gnu-tar, lzip, makedepend, glib, libgsf, libtool, pcre, gettext, binutils |\n * | `\"1.0.1\"` | Same tools rebuilt on macOS 15 runners — binaries run on macOS 15+ (1.0.0 required macOS 26) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/linux-tools-mac/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly linuxToolsMac?: \"1.0.0\" | \"1.0.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the 7-Zip binary bundle used internally to extract `.7z` and `.tar.xz` archives.\n *\n * Set to a {@link ToolsetCustom} object to supply your own 7za binary.\n * The `url` must point to a directory (or a `.tar.gz`/`.zip` archive of one) that contains\n * `bin/7za` (macOS/Linux) or `bin/7za.exe` (Windows).\n *\n * **Bootstrap constraint:** the custom bundle itself must be a `.tar.gz` or `.zip` archive\n * (or a bare `file://` directory). `.7z` and `.tar.xz` archives cannot be used here because\n * extracting them requires 7za — a circular dependency.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | Shipped the 32-bit `7za.exe` for every Windows arch (1.75 GiB memory cap, no LZMA2 multithreading on x64/arm64) |\n * | `\"1.0.1\"` | Correct per-arch Windows binaries (x64, ia32, arm64) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/7zip/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly sevenZip?: \"1.0.0\" | \"1.0.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the icons-conversion bundle used to convert source images to `.icns`, `.ico`,\n * and PNG icon sets.\n *\n * Set to a {@link ToolsetCustom} object to supply your own icons bundle directory.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.2.3\"` | Writes 16px/32px ICNS entries as `ic04`/`ic05` ARGB (fixes corrupt small icons in Finder) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/icons/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly icons?: \"1.2.3\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the `squirrel.windows` bundle used to build Squirrel.Windows installers.\n *\n * The bundle ships the Squirrel vendor toolset under `electron-winstaller/vendor/`:\n * - **`Squirrel.exe`** / **`Squirrel-Mono.exe`** — releasify the app into `Setup.exe` (and an optional MSI).\n * - **`SyncReleases.exe`** — downloads prior releases to produce delta packages.\n * - **`nuget.exe`**, **`7z`** — pack the app into a `.nupkg` and compress release assets.\n *\n * `rcedit.exe` is provisioned from the {@link winCodeSign} toolset at runtime (on every platform;\n * under Wine on non-Windows hosts). Building an MSI additionally uses the shared WiX toolset.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.1.1\"` | Squirrel.Windows 2.0.1 (patched) with a standalone, checksum-verified `nuget.exe` 6.14.0 |\n *\n * Set to a {@link ToolsetCustom} object to supply your own bundle — it must contain the\n * `electron-winstaller/vendor/` subtree. Only used when building the `squirrelWindows` target.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/squirrel.windows/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly squirrel?: \"1.1.1\" | ToolsetCustom | \"latest\"\n}\n\n/**\n * A custom toolset bundle supplied by the user in place of a built-in versioned bundle.\n *\n * The bundle must mirror the expected directory layout of the corresponding built-in bundle.\n * See the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n *\n * File formats supported for `url` archives: `.zip`, `.7z`, `.tar.gz`, `.tar.xz`.\n *\n * `checksum` is the SHA-256 of the archive as 64 hex characters or its SHA-512 as 88 base64 characters (the format v26\n * used for all toolset checksums), the same for every toolset. See https://www.electron.build/docs/toolsets#custom-toolset-checksum\n *\n * @example\n * ```json\n * {\n * \"toolsets\": {\n * \"nsis\": {\n * \"url\": \"file:///path/to/my-nsis-bundle.tar.gz\",\n * \"checksum\": \"56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4\",\n * \"version\": \"my-custom-1.0\"\n * }\n * }\n * }\n * ```\n */\nexport interface ToolsetCustom {\n /**\n * The `https://` URL or `file://` path to load the custom toolset bundle from.\n *\n * - `https://` — downloaded and cached locally; the archive is extracted before use.\n * - `file:///absolute/path` — used directly; relative paths must be within the project resources dir.\n *\n * Archives (`.zip`, `.7z`, `.tar.gz`, `.tar.xz`) are extracted automatically.\n * A bare directory path (no archive) is used as-is.\n */\n readonly url: string\n\n /**\n * Checksum of the bundle archive, in one of two formats:\n * - the SHA-256 as 64 hex characters (uppercase is lowercased), e.g. `shasum -a 256 <archive>` (macOS / Linux),\n * `(Get-FileHash -Algorithm SHA256 <archive>).Hash` (PowerShell) or `certutil -hashfile <archive> SHA256`;\n * - the SHA-512 as 88 base64 characters, the format v26 used for all toolset checksums, e.g.\n * `openssl dgst -sha512 -binary <archive> | openssl base64 -A`.\n *\n * Prefixed forms such as `sha256:…` or `sha512-…`, and a hex-encoded SHA-512, are rejected before anything is downloaded.\n * A downloaded archive is verified before it is cached or extracted, and a local `file://` archive before it is extracted.\n *\n * Required for remote (`https://`) URLs and local archive files (`file://`).\n * Not needed for bare directory paths — the directory is used as-is with no caching and no verification.\n * @see https://www.electron.build/docs/toolsets#custom-toolset-checksum\n */\n readonly checksum?: string\n\n /**\n * Optional version label used in the local cache directory name.\n * Falls back to the first 8 hex characters of the `checksum` digest when omitted.\n */\n readonly version?: string\n}\n\n/**\n * Lifecycle hooks that run at specific points during the electron-builder pipeline.\n *\n * Each hook can be specified as:\n * - An **inline function** (JavaScript/TypeScript config files only):\n * ```js\n * // electron-builder.config.js\n * module.exports = { beforePack: async (context) => { /* ... *\\/ } }\n * ```\n * - A **path** to a CommonJS/ESM module (relative to the project directory) that exports the\n * hook as its **default export**:\n * ```json\n * { \"build\": { \"beforePack\": \"./scripts/myHook.js\" } }\n * ```\n * ```js\n * // scripts/myHook.js\n * export default async function (context) { /* ... *\\/ }\n * ```\n */\nexport interface Hooks {\n /**\n * Called immediately before electron-builder begins packing the app for each platform/arch\n * combination.\n *\n * Use this hook to perform last-minute modifications to source files or build resources before\n * they are read by the packager.\n *\n * Receives a {@link BeforePackContext}.\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * Called after the prebuilt Electron binary has been extracted to the staging directory but\n * before the app files have been copied into it.\n *\n * Use this hook to patch or augment the Electron binary itself (e.g. rename helper processes,\n * inject native libraries) before the app payload is laid down on top.\n *\n * Receives an {@link AfterExtractContext}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * Called after the app files have been copied into the staging directory (and ASAR created if\n * applicable) but **before** signing and before the output archive/installer is built.\n *\n * Use this hook to post-process the staged app bundle (e.g. strip debug symbols, inject\n * platform-specific resources).\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called after code signing but **before** the signed app is packed into the final\n * distributable format (e.g. before `dmg` is created from the signed `.app`).\n *\n * Use this hook to perform post-sign validation or to add signed resources that are not part of\n * the main app bundle.\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called when an individual artifact build starts (e.g. just before a `.dmg` or `.exe` is\n * written to disk).\n *\n * Receives an {@link ArtifactBuildStarted}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n\n /**\n * Called when an individual artifact has been successfully built and written to disk.\n *\n * Use this hook to collect artifact paths, upload to custom destinations, or trigger\n * post-processing steps.\n *\n * Receives an {@link ArtifactCreated}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n\n /**\n * Called after **all** artifacts across all platforms/architectures have been built.\n *\n * May return an array of additional file paths that should be treated as publish targets\n * (i.e. uploaded to the configured publisher).\n *\n * Receives a {@link BuildResult}.\n *\n * @example\n * ```js\n * export default async function afterAllArtifactBuild(result) {\n * return [\"/path/to/extra-file.txt\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n\n /**\n * Called after the WiX MSI project XML has been written to a temporary directory but before\n * `candle.exe` / `light.exe` compile it into a `.msi` package.\n *\n * The hook receives the path to the project directory as a string. Use it to patch the generated\n * `.wxs` files for customizations not exposed through electron-builder's options.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n\n /**\n * Called after the AppX/MSIX manifest XML has been written to the staging directory but before\n * `makeappx` packages it.\n *\n * The hook receives the path to the manifest file as a string. Use it to inject custom manifest\n * extensions (capabilities, protocol handlers, etc.) not exposed through {@link AppXOptions}.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n\n /**\n * Called after the `distribution.xml` of a macOS `pkg` installer has been written (synthesized by\n * `productbuild --synthesize`, then customized from {@link PkgOptions}) but before `productbuild` builds the\n * installer from it.\n *\n * The hook receives the path to the distribution file as a string. Edit it in place or overwrite it to\n * customize the installer beyond {@link PkgOptions} (for example, its `<title>`).\n */\n readonly pkgDistributionCreated?: Hook<string, void> | string | null\n\n /**\n * Called for every file inside each `node_modules` package directory as electron-builder\n * decides whether to include it in the packaged app.\n *\n * Return `true` to force-include the file regardless of the default exclusion rules.\n * Return `false` or `undefined` to let electron-builder apply its normal filtering logic.\n *\n * Receives the absolute path of the file as a string.\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n\n /**\n * Called before dependencies are installed or native modules are rebuilt.\n *\n * Return `false` (or a `Promise` that resolves to `false`) to skip the install/rebuild step\n * entirely — useful when you manage `node_modules` externally (e.g. in a CI pipeline that\n * restores them from cache). When not set, electron-builder proceeds with the normal\n * install/rebuild flow.\n *\n * If this hook is provided and `node_modules` is missing, electron-builder will not perform\n * the production-dependencies check.\n *\n * Receives a {@link BeforeBuildContext}.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n\n /**\n * Override the source of the Electron distribution to stage.\n *\n * Should return the path to either:\n * - A **directory** containing a pre-built, unpacked Electron app (e.g. `~/electron/out/R`).\n * - A **directory** containing Electron zip archives following the naming convention\n * `electron-v${version}-${platformName}-${arch}.zip`.\n *\n * When not set, electron-builder downloads the official Electron release from GitHub (or the\n * mirror configured via `electronGet`).\n *\n * Receives a {@link PrepareApplicationStageDirectoryOptions}.\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\n/**\n * Overrides for the input and output directories used during the build.\n */\nexport interface MetadataDirectories {\n /**\n * The directory that contains static build resources (icons, background images, license files,\n * custom NSIS scripts, etc.) that electron-builder reads during packaging.\n *\n * **Build resources are not copied into the packaged app.** If you need runtime access to a\n * file (e.g. a tray icon), include it explicitly via the `fileOptions.files` option:\n * ```json\n * { \"fileOptions\": { \"files\": [\"**\\/*\", \"build/icon.*\"] } }\n * ```\n *\n * @default \"build\"\n */\n readonly buildResources?: string | null\n\n /**\n * The directory where electron-builder writes its output (installers, zip archives, etc.).\n *\n * [File macros](https://www.electron.build/file-patterns#file-macros) are supported, e.g.\n * `\"dist/${os}-${arch}\"` to separate outputs by platform and architecture.\n *\n * @default \"dist\"\n */\n readonly output?: string | null\n\n /**\n * The directory that contains the application's `package.json` and source code.\n *\n * Defaults to `app`, then `www`, then the project root. Set this when your packagable app\n * lives in a subdirectory (common in monorepos or when using a separate frontend build step).\n */\n readonly app?: string | null\n}\n\n/**\n * Configuration for experimental concurrent builds.\n */\nexport interface Concurrency {\n /**\n * Maximum number of platform/architecture builds to run in parallel.\n *\n * Set to `1` to disable concurrency (sequential builds, the safe default). Higher values\n * reduce wall-clock time on multi-platform builds at the cost of increased memory and CPU\n * usage. Ensure that your {@link Hooks} and build resources are safe to execute concurrently\n * before raising this limit.\n *\n * @default 1\n */\n jobs: number\n}\n"]}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAA0B,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core.js\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework.js\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework.js\"\nimport { AppXOptions } from \"./options/AppXOptions.js\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions.js\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { MsiOptions } from \"./options/MsiOptions.js\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions.js\"\nimport { MsixOptions } from \"./options/MsixOptions.js\"\nimport { PkgOptions } from \"./options/pkgOptions.js\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { SnapcraftOptions } from \"./options/SnapOptions.js\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions.js\"\nimport { WindowsConfiguration } from \"./options/winOptions.js\"\nimport { BuildResult } from \"./packager.js\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/win/nsis/nsisOptions.js\"\nimport { ElectronGetOptions } from \"./util/electronGet.js\"\nimport type { ExecutablesConfig } from \"builder-util\"\n// the types of toolsets.executables live with its resolver, in builder-util\nexport type { ExecutableLocation, ExecutableName, ExecutablesConfig } from \"builder-util\"\nimport { FuseOptionsV1 } from \"./options/FuseOptionsV1.js\"\n\n/**\n * Production dependencies that are excluded from the copied `node_modules` by default. These are\n * still legitimate production dependencies (for SBOM, license, and vulnerability tracking), but\n * electron-builder already provides them another way — notably the Electron runtime, which is\n * embedded separately — so copying them into the app would just duplicate what is already there.\n * Users can override the set via {@link CommonConfiguration.ignoredProductionDependencies}.\n *\n * Declared next to the option so the code constant, the jsdoc `@default`, and the generated\n * `scheme.json` stay in one place; a test asserts the generated schema matches this constant.\n */\nexport const DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES: ReadonlyArray<string> = [\"electron\", \"electron-builder\"]\n\n// duplicate appId here because it is important\n/**\n * Configuration options shared across all platforms.\n *\n * These properties apply regardless of the target platform and control general build behaviour such\n * as the application identity, output paths, native dependency rebuilding, toolset versions, and\n * platform-specific target sub-configurations.\n */\nexport interface CommonConfiguration {\n /**\n * The application identifier.\n *\n * Used as [`CFBundleIdentifier`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleidentifier)\n * on macOS and as the\n * [Application User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids)\n * on Windows (NSIS target only; Squirrel.Windows does not support custom Application User Model IDs).\n *\n * It is strongly recommended to set an explicit, reverse-DNS-style identifier (e.g. `\"com.example.myapp\"`)\n * rather than relying on the generated default.\n *\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * The human-readable product name displayed in installers, the macOS dock, and the Windows\n * Apps & Features list.\n *\n * Unlike the `name` field in `package.json`, this value may contain spaces and other characters\n * that are not allowed in npm package names.\n *\n * Resolution order:\n * 1. `productName` inside the `build` configuration block.\n * 2. `productName` at the top level of `package.json`.\n * 3. `name` at the top level of `package.json`.\n */\n readonly productName?: string | null\n\n /**\n * The copyright string embedded in the built artifacts.\n *\n * Appears in the Windows `LegalCopyright` version-info field and the macOS `NSHumanReadableCopyright`\n * Info.plist key.\n *\n * @default Copyright © ${year} ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Overrides for input/output directory paths used during the build.\n *\n * @see {@link MetadataDirectories}\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Pinned versions of the binary toolsets electron-builder downloads and uses internally.\n *\n * Each property selects a specific release of the corresponding tool bundle. Set a property to\n * `\"0.0.0\"` to force the legacy bundle (pre-v27 behaviour). Leave a property unset (or set it to\n * `\"latest\"`) to use the modern default (newest bundle) for that toolset.\n *\n * Note: Toolset versioning can drop intermediate releases (such as if a problem is discovered in a bundle). If you need to pin to a specific release, check the release notes for the toolset to ensure the version you specify is valid.\n *\n * @see {@link ToolsetConfig}\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * Format of the `<artifact>.blockmap` file published next to installers and update archives, which electron-updater reads for\n * differential downloads. The map is read by the updater already installed in your users' apps, so the format follows\n * `electronUpdaterCompatibility` (default `\">=7\"`):\n *\n * - unset: `\"v3\"` when `electronUpdaterCompatibility` includes only electron-updater 7 and later, else `\"v2\"`, with a build\n * warning.\n * - `\"v3\"`: a binary block map that electron-updater fetches in parts with HTTP `Range` requests (only the parts that changed\n * since the installed version), with finer blocks for stored members such as an uncompressed `app.asar`. Needs electron-updater\n * 7 or later: with an `electronUpdaterCompatibility` that includes earlier versions, the build fails.\n * - `\"v2\"`: the gzipped JSON block map every electron-updater version reads, downloaded in full on every update; the package and\n * block map are the same as electron-builder 26 wrote.\n * - `\"latest\"`: the newest format the `electronUpdaterCompatibility` range supports (currently the same as unset). A future\n * format then costs one full download per user, as below.\n *\n * Apps whose electron-updater cannot read a release's format, or whose cached map is in another format, download that update\n * in full once; the next one is differential again, or with an artifact name without `${version}` the one after it.\n *\n * Block maps embedded in an artifact (AppImage, the NSIS web installer's app package) are always `\"v2\"`.\n * See [the v27 notes](https://www.electron.build/docs/migration/v27-build-changes#block-map-format-follows-electronupdatercompatibility).\n */\n readonly blockmap?: \"v2\" | \"v3\" | \"latest\" | null\n\n /**\n * macOS-specific build options (signing, entitlements, notarization, target categories, etc.).\n * @see {@link MacConfiguration}\n */\n readonly mac?: MacConfiguration | null\n /**\n * macOS App Store (MAS) submission options.\n * @see {@link MasConfiguration}\n */\n readonly mas?: MasConfiguration | null\n /**\n * macOS App Store development-signing options (`mas-dev` target).\n * Used for local testing of MAS builds without submitting to the store.\n * @see {@link MasConfiguration}\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG disk image options (background image, window position, icon layout, licence, etc.).\n * @see {@link DmgOptions}\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG flat-package installer options.\n * @see {@link PkgOptions}\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Windows-specific build options (signing, NSIS, icon, file associations, etc.).\n * @see {@link WindowsConfiguration}\n */\n readonly win?: WindowsConfiguration | null\n /**\n * NSIS one-click installer options.\n *\n * NSIS (Nullsoft Scriptable Install System) is the default Windows installer format produced by\n * electron-builder. It generates a lightweight, self-extracting `.exe` installer.\n *\n * @see {@link NsisOptions}\n */\n readonly nsis?: NsisOptions | null\n /**\n * NSIS web installer options.\n *\n * Like the standard NSIS installer but the app payload is downloaded from a remote URL at install\n * time rather than bundled into the `.exe`. Useful for very large apps or staged rollouts.\n *\n * @see {@link NsisWebOptions}\n */\n readonly nsisWeb?: NsisWebOptions | null\n /**\n * Portable executable options.\n *\n * Produces a single `.exe` that requires no installation — it extracts and runs directly.\n *\n * @see {@link PortableOptions}\n */\n readonly portable?: PortableOptions | null\n /**\n * Windows Store (MSIX/AppX) package options.\n *\n * Produces a `.appx` or `.msix` package suitable for distribution through the Microsoft Store or\n * side-loading.\n *\n * @see {@link AppXOptions}\n */\n readonly appx?: AppXOptions | null\n /** MSIX package options. MSIX is the modern successor to AppX with additional deployment features. */\n readonly msix?: MsixOptions | null\n /**\n * WiX-based MSI installer options.\n *\n * Produces a traditional `.msi` package built with the WiX Toolset. Best for enterprise\n * deployments that require MSI-based installation policies.\n *\n * @see {@link MsiOptions}\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped NSIS installer options.\n *\n * Wraps the standard NSIS installer inside an MSI package so that it can be deployed via\n * Group Policy or other MSI-only channels while preserving the NSIS installer UX.\n *\n * @see {@link MsiWrappedOptions}\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows auto-update installer options.\n *\n * Requires the `electron-builder-squirrel-windows` optional dependency.\n *\n * @see {@link SquirrelWindowsOptions}\n */\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n /**\n * General Linux build options shared across all Linux targets (icon, category, desktop entry,\n * executable name, etc.). Target-specific compression and packaging options live in the\n * per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`, etc.).\n *\n * @see {@link LinuxConfiguration}\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n *\n * Targets Debian, Ubuntu, and Debian-based distributions. Produces a `.deb` archive\n * installable via `dpkg -i` or `apt install ./package.deb`.\n *\n * @see {@link DebOptions}\n */\n readonly deb?: DebOptions | null\n /**\n * Snapcraft configuration.\n *\n * Selects the snapcraft base and provides per-core options:\n * - `base: \"core18\" | \"core20\" | \"core22\"` — legacy bases; still functional but not recommended\n * for new apps.\n * - `base: \"core24\"` — modern base with the GNOME extension (recommended, requires Electron 25+).\n * - `base: \"custom\"` — pass an existing `snapcraft.yaml` through unchanged; no plugs, extensions,\n * or desktop files are injected.\n *\n * @example\n * ```json\n * { \"snapcraft\": { \"base\": \"core24\", \"core24\": { \"useLXD\": true } } }\n * ```\n *\n * @see {@link SnapcraftOptions}\n */\n readonly snapcraft?: SnapcraftOptions | null\n /**\n * AppImage options.\n *\n * AppImage is a portable application format that bundles the app and its runtime dependencies\n * into a single self-contained executable that runs on most Linux distributions without\n * installation. The produced `.AppImage` file is executable after `chmod +x`.\n *\n * @see {@link AppImageOptions}\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n *\n * Flatpak is a sandboxed application distribution format for Linux distributed via\n * [Flathub](https://flathub.org/) or self-hosted OSTree repositories.\n *\n * @see {@link FlatpakOptions}\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options.\n *\n * Targets Arch Linux and Arch-based distributions (Manjaro, EndeavourOS, etc.).\n * Produces a `.pacman` archive installable via `pacman -U ./package.pacman`.\n *\n * @see {@link PacmanOptions}\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options.\n *\n * Targets Fedora, Red Hat Enterprise Linux, SUSE, and RPM-based distributions.\n * Produces a `.rpm` archive installable via `rpm -i` or `dnf install ./package.rpm`.\n *\n * @see {@link RpmOptions}\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD `pkg` package options.\n *\n * Produces a `.pkg` archive for the FreeBSD package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options.\n *\n * Produces a `.p5p` archive for the Solaris Image Packaging System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options.\n *\n * Produces an `.apk` archive installable via `apk add --allow-untrusted ./package.apk`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Additional command-line arguments appended to the package manager's `install` command when\n * electron-builder installs app dependencies (i.e., when `node_modules` is missing and a fresh\n * install is required).\n *\n * These arguments are appended **only** during the install phase, not during the rebuild phase.\n * To influence `@electron/rebuild` directly, see {@link NativeModulesConfig.rebuildMode}.\n *\n * @example\n * ```json\n * { \"npmArgs\": [\"--prefer-offline\", \"--ignore-scripts\"] }\n * ```\n */\n readonly npmArgs?: Array<string> | string | null\n\n /**\n * Names of production dependencies that are excluded from the copied `node_modules`, even if they\n * are declared in the `dependencies` section of `package.json`.\n *\n * electron-builder copies the resolved production dependency tree into the app. Some packages —\n * notably `electron` — are already provided another way (the Electron runtime is embedded\n * separately), so copying them would just duplicate what is already there. Such packages are\n * excluded from the copy rather than rejected: they remain valid production dependencies for\n * tooling purposes (e.g. SBOM, license, and vulnerability tracking) without being shipped twice.\n *\n * Only dependencies **declared by the app itself** are eligible: a listed name and the transitive\n * dependencies required *only* by it are dropped, while anything also required by another (kept)\n * production dependency stays bundled. A matching name that appears solely as a transitive\n * dependency of a kept package is never excluded. Note that a kept package which `require()`s an\n * excluded name at runtime *without declaring it* (relying on hoisting) will fail with\n * `MODULE_NOT_FOUND` — declare such a dependency properly or remove the name from this list.\n *\n * Matching is by the dependency name as declared in `package.json`: an npm alias\n * (`\"custom-electron\": \"npm:electron@^30.0.0\"`) is matched by its alias key (`custom-electron`),\n * never by the underlying package name.\n *\n * Overriding this option **replaces** the default list, so include `electron` and `electron-builder`\n * unless you intend to ship them. The most common reason to override is to *add* a dependency that a\n * bundler (Vite, webpack, esbuild, …) already inlines into your app code: keep it in `dependencies`\n * so SBOM/license tooling still sees it, and list it here so a duplicate copy is not packaged — e.g.\n * `[\"electron\", \"electron-builder\", \"react\", \"react-dom\"]`. Removing a default name keeps that\n * package in the copied `node_modules`. Setting the option to `null` (or omitting it) applies the\n * default list; to disable exclusion entirely, set it to an empty array `[]`. Each excluded package\n * is logged once during packaging.\n *\n * @default [\"electron\", \"electron-builder\"]\n */\n readonly ignoredProductionDependencies?: Array<string> | null\n\n /**\n * Whether production dependencies that cannot be resolved during node-module collection are\n * allowed — i.e. whether the build should continue with a warning instead of failing.\n *\n * During collection every production dependency must resolve to an installed package on disk. A\n * dependency that does not resolve (`cannot find path for dependency` / `dependency not found on\n * disk`) is not bundled, which typically breaks the packaged app at runtime with\n * `MODULE_NOT_FOUND`.\n *\n * - `false` or `null` (default): the build fails after dependency collection completes,\n * reporting the **complete** list of missing production dependencies at once.\n * - `string[]`: the listed dependency names are allowed to be missing; any other missing\n * production dependency still fails the build. Entries match the package name of the reported\n * `name@version` entry (e.g. `some-native-module`, `@scope/pkg`), or an exact `name@version`\n * string to allow only that resolved version to be missing.\n * - `true`: missing production dependencies are only logged as warnings (the electron-builder\n * ≤ 26 behavior).\n *\n * Missing *optional* dependencies (declared in `optionalDependencies`, e.g. `fsevents` on\n * Linux/Windows, or platform-specific packages) are always allowed and never fail the build.\n *\n * Independent of {@link ignoredProductionDependencies}, which controls which dependencies are\n * excluded from the copied `node_modules`; this option only controls validation of the\n * collection result.\n *\n * @default false\n */\n readonly allowMissingDependencies?: boolean | Array<string> | null\n\n /**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * Groups all options that control how electron-builder handles native modules — from forcing\n * source builds during install through to the `@electron/rebuild` compilation mode.\n *\n * @see {@link NativeModulesConfig}\n */\n readonly nativeModules?: NativeModulesConfig | null\n\n /**\n * The build number.\n *\n * Maps to the `--iteration` flag for FPM-based Linux targets and is appended to the version\n * string in `CFBundleVersion` (macOS) and `FileVersion` (Windows) when {@link buildVersion} is\n * not set explicitly.\n *\n * If not set, falls back to the first defined environment variable among:\n * `BUILD_NUMBER`, `TRAVIS_BUILD_NUMBER`, `APPVEYOR_BUILD_NUMBER`, `CIRCLE_BUILD_NUM`,\n * `BUILD_BUILDNUMBER`, `CI_PIPELINE_IID`.\n */\n readonly buildNumber?: string | null\n\n /**\n * The full build version string.\n *\n * Maps to `CFBundleVersion` on macOS and the `FileVersion` metadata field on Windows.\n * Defaults to the `version` field from `package.json`.\n *\n * If `buildVersion` is not set but {@link buildNumber} is defined (or resolved from an\n * environment variable), the effective build version becomes `${version}.${buildNumber}`.\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the FFmpeg library variant from Electron's release assets and replace the\n * default (proprietary codec) FFmpeg library before signing.\n *\n * The alternate FFmpeg is compiled without proprietary codec support (H.264, AAC, etc.) and is\n * required for distributing on certain platforms (e.g., Linux distributions that prohibit\n * proprietary codecs). Enabling this swaps the bundled `ffmpeg` dynamic library before the app\n * is signed.\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Additional properties to deep-merge into the app's `package.json` at build time.\n *\n * Useful for injecting build-time metadata (e.g., a git commit hash or CI build URL) that\n * should be readable at runtime via `require('./package.json')` or `import.meta.url`.\n *\n * @example\n * ```json\n * { \"extraMetadata\": { \"commitHash\": \"abc1234\", \"buildDate\": \"2025-01-01\" } }\n * ```\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to throw an error and abort the build if the app could not be code-signed, notarized, or have its\n * auto-update manifests signed - and to verify the signatures the build produces.\n *\n * Set to `true` in release pipelines to catch missing or misconfigured signing credentials\n * before producing unsigned artifacts. When `false` (the default), missing signing credentials\n * produce a warning and the build continues unsigned.\n *\n * With `true`:\n * - macOS: the app must be signed, which needs a macOS host, also in pull-request builds (set `CSC_FOR_PULL_REQUEST=true` to sign\n * them, or pass `-c.forceCodeSigning=false` there), and notarized: notarization credentials must be set when the build starts.\n * The output of a custom `mac.sign` signer is checked with `codesign --verify --deep --strict`, the stapled ticket with\n * `stapler validate`, a signed pkg with `pkgutil --check-signature`, and a DMG with `dmg.sign: true` must be signed.\n * - Windows: every signed file is read back and must carry a valid Authenticode signature.\n * - Every platform (the only effect on Linux): auto-update manifests must be signed, also by a build that does not publish.\n * - A prepackaged app, which electron-builder does not sign, must already be signed (and, on macOS, notarized).\n *\n * Explicit opt-outs are honored with a warning: `mac.notarize: false`, `updateManifest: false`, `win.signExts` exclusions and a\n * custom `nsis.script` (whose uninstaller electron-builder does not sign). `win.sign: false` and `mac.sign: null` contradict it\n * and fail the build. `electron-builder verify` checks the build output afterwards.\n *\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to remove the `scripts` field from bundled `package.json` files.\n *\n * Lifecycle scripts (`preinstall`, `postinstall`, etc.) have no meaning inside a packaged\n * Electron app and can trigger unintended behaviour if any tooling inspects the bundled\n * `package.json`. Removing them reduces artifact size and prevents accidental execution.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove the `keywords` field from bundled `package.json` files.\n *\n * The `keywords` array is only meaningful for package registry discoverability and has no\n * runtime value inside a packaged Electron app. Removing it marginally reduces artifact size.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options forwarded to [`@electron/fuses`](https://github.com/electron/fuses) to flip Electron\n * feature flags in the binary.\n *\n * Fuses are compile-time-like flags baked into the Electron binary that cannot be changed at\n * runtime. Flipping them is the approved mechanism for hardening Electron apps (e.g., disabling\n * `ELECTRON_RUN_AS_NODE`, enabling ASAR integrity, etc.).\n *\n * electron-builder flips fuses after packaging but before signing so that the final signature\n * covers the modified binary.\n *\n * @see {@link FuseOptionsV1}\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * Configuration for experimental concurrent (multi-platform / multi-arch) builds.\n *\n * When `jobs > 1`, electron-builder runs up to `jobs` platform builds in parallel. This is an\n * experimental feature — use with caution and verify that your hook functions and build resources\n * are safe to execute concurrently.\n *\n * @see {@link Concurrency}\n */\n readonly concurrency?: Concurrency | null\n}\n\n/**\n * The root build configuration object passed to electron-builder.\n *\n * Extends {@link CommonConfiguration} with top-level Electron-specific options, configuration\n * inheritance/presets, and all per-platform build hooks.\n */\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Options forwarded to [`@electron/get`](https://github.com/electron/get) when downloading the\n * Electron distribution to package.\n *\n * `checksums` (a map of artifact file name → SHA-256 hex) makes checksum validation fully offline —\n * without it, `@electron/get` fetches `SHASUMS256.txt` from the network on every build, even when the\n * artifact itself is already cached. When `checksums` is not configured, electron-builder automatically\n * picks up a locally seeded `SHASUMS256.txt-<version>` (or `SHASUMS256.txt`) file at the root of the\n * Electron cache directory. See the\n * [air-gapped / offline builds guide](https://www.electron.build/tutorials/offline-air-gapped-builds).\n */\n readonly electronGet?: ElectronGetOptions | null\n\n /**\n * Electron branding overrides.\n *\n * Required only when packaging a custom Electron fork that ships a modified `BRANDING.json`\n * (e.g., a fork that renames the `Electron Helper` process or the `Electron Framework`).\n * Standard Electron builds do not need this.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The Electron version to package against.\n *\n * Defaults to the version of the `electron` (or `electron-prebuilt`) dependency declared in\n * `package.json`. Set this explicitly only when the installed Electron version is not the one\n * you want to package against (e.g., in monorepos where the Electron dependency lives in a\n * different workspace).\n */\n electronVersion?: string | null\n\n /**\n * Whether to write `builder-effective-config.yaml` (the resolved configuration, including the detected\n * `electronVersion`) to the output directory.\n *\n * Defaults to writing it only for local interactive builds: not on CI and not when stdout is piped.\n * Set `true` to always write it, e.g. to read the resolved configuration in a CI step, or `false` to never write it.\n */\n readonly writeEffectiveConfig?: boolean | null\n\n /**\n * One or more configuration presets or file paths to merge into this configuration.\n *\n * Accepts a string or array of strings, each of which is either:\n * - A built-in preset name (`\"react-cra\"` is the only currently supported value).\n * - A path to a JS/JSON config file relative to the project directory.\n *\n * Configs are merged left-to-right using a deep-assign strategy that properly combines `files`\n * glob patterns rather than replacing them.\n *\n * The `react-cra` preset is applied automatically when `react-scripts` is found in\n * `dependencies`. Set `extends: null` to opt out of automatic preset detection.\n */\n extends?: Array<string> | string | null\n}\n\n/**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * All options that control how electron-builder handles native modules — from forcing source\n * builds at install time through to the `@electron/rebuild` compilation mode.\n */\nexport interface NativeModulesConfig {\n /**\n * Whether to pass `--build-from-source` to the package manager when installing native\n * dependencies, forcing them to compile from source rather than using pre-built binaries.\n *\n * Useful when pre-built binaries are not available for the target platform/arch combination,\n * or when you need to ensure native modules are compiled against the exact Electron ABI.\n *\n * Only honored when the target platform matches the host platform: native modules cannot be\n * cross-compiled from source for another OS, so for a cross-platform target native dependencies are\n * rebuilt with prebuilt binaries for that target instead (and a warning is logged).\n *\n * @default false\n */\n buildDependenciesFromSource?: boolean\n\n /**\n * Whether to run `node-gyp rebuild` with Electron headers before packaging.\n *\n * This is a low-level escape hatch for cases where the standard `@electron/rebuild` path\n * (controlled by {@link npmRebuild}) is insufficient. Most projects should leave this `false`\n * and rely on `@electron/rebuild` instead.\n *\n * When `true`, electron-builder runs `node-gyp rebuild` with the correct `npm_config_*`\n * environment variables set for the target Electron version and architecture before the\n * normal rebuild step.\n *\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n\n /**\n * Whether to rebuild native Node.js modules for the target Electron version and architecture\n * before packaging.\n *\n * When `true` (the default), electron-builder runs `@electron/rebuild` against the app's\n * `node_modules` directory to ensure all native modules are compiled against the correct Electron\n * ABI. Set to `false` to skip this step entirely — useful when native modules are pre-built\n * elsewhere in your pipeline or when the app has no native dependencies.\n *\n * The compilation mode (`sequential` vs `parallel`) is controlled by {@link rebuildMode}.\n *\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * Compilation mode for `@electron/rebuild`.\n *\n * - `\"sequential\"` — rebuilds native modules one at a time. Safer in memory-constrained\n * environments and produces cleaner log output.\n * - `\"parallel\"` — rebuilds all native modules concurrently. Faster on machines with many cores\n * and plentiful memory, but may exhaust resources on CI agents with limited RAM.\n *\n * @default \"sequential\"\n */\n readonly rebuildMode?: \"sequential\" | \"parallel\" | null\n\n /**\n * Whether to verify, after the app is packed, that every native binary shipped in the app was built for\n * the target platform and architecture.\n *\n * electron-builder reads the header of each `.node` addon (and of other native libraries and executables\n * such as `.so`, `.dylib`, `.dll`, `.exe`) in `app.asar`, `app.asar.unpacked` or the unpacked `app`\n * directory, and compares its format (ELF / Mach-O / PE) and machine type against the target (for\n * a macOS universal build, each per-arch slice is checked before the slices are merged). This catches a\n * stale or host-platform binary left in `node_modules` by a skipped or cached rebuild, which otherwise\n * only surfaces at runtime as `invalid ELF header` / `not a valid Win32 application` /\n * `incompatible architecture`.\n *\n * Files whose package declares another platform via `package.json` `os`/`cpu`, or whose path names\n * another platform/arch (e.g. prebuildify's `prebuilds/linux-arm64/`), are not loaded for this target\n * and are ignored.\n *\n * - `true` (default) — a mismatched `.node` addon fails the build; other mismatched native files log a warning.\n * - `\"warn\"` — log every mismatch as a warning and continue.\n * - `false` — skip the check.\n *\n * @default true\n */\n readonly verifyNativeBinaries?: boolean | \"warn\" | null\n}\n\nexport type Hook<T, V> = (contextOrPath: T) => Promise<V> | V\n\nexport interface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\nexport type AfterExtractContext = PackContext\n\n/**\n * Version pins and custom bundle overrides for the binary toolsets that electron-builder downloads and caches locally.\n *\n * Each toolset is a versioned archive hosted at [electron-userland/electron-builder-binaries](https://github.com/electron-userland/electron-builder-binaries/releases).\n * Omitting a property (or setting it to `latest`) selects the modern default for that toolset.\n *\n * To supply your own bundle, set the property to a {@link ToolsetCustom} object with a `url` (https:// or file://) and a `checksum` for verification. The bundle must mirror the expected directory layout of the corresponding built-in bundle; see the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n */\nexport interface ToolsetConfig {\n /**\n * Version of the `win-codesign` bundle used for Windows code signing and resource editing.\n *\n * The bundle ships:\n * - **`signtool.exe`** (Windows) / **`osslsigncode`** (macOS & Linux) — used to sign `.exe`,\n * `.dll`, and `.msix` artifacts.\n * - **`rcedit`** — embeds version metadata and icons into `.exe` files (legacy usage, migrated to npm `resedit` package).\n * - **Windows Kits** — used by AppX/MSIX packaging (`makeappx`, `signtool`).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"0.0.0\"` | Legacy bundle — `winCodeSign-2.6.0` (pre-v27) |\n * | `\"1.0.0\"` | Windows Kits 10.0.26100.0, `osslsigncode` v2.9 |\n * | `\"1.1.1\"` | Updates `osslsigncode` to v2.11 |\n * | `\"1.2.1\"` | Adds native `osslsigncode` arm64 |\n * | `\"1.3.0\"` | Includes support for Azure Trusted Signing `signtool` via dlib and .NET 8 runtime |\n * | `\"1.3.1\"` | macOS `osslsigncode` bundles its own OpenSSL (no Homebrew `openssl@3` needed) and libp11's PKCS#11 provider |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/win-codesign/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | \"1.1.1\" | \"1.2.1\" | \"1.3.0\" | \"1.3.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the AppImage toolset bundle used for building `.AppImage` files.\n *\n * The bundle ships:\n * - **`mksquashfs`** — creates the SquashFS filesystem embedded in the AppImage. It also packs legacy-base (core18/core20/core22) snaps built from the snap template app.\n * - **`desktop-file-validate`** — validates the generated `.desktop` entry.\n * - **AppImage runtime** — the self-executing stub that mounts the SquashFS at launch.\n *\n * Available versions:\n * | Version | Runtime date | Notes |\n * |---------|-------------|-------|\n * | `\"0.0.0\"` | Legacy | FUSE2-based AppImage runtime (pre-v27) |\n * | `\"1.0.3\"` | 20251108 | Introduces static AppImage runtime |\n * | `\"1.1.0\"` | 20251108 | Adds `unsquashfs` support |\n * | `\"1.2.0\"` | 20251108 | squashfs-tools 4.7.5 with a statically linked zstd 1.5.7, so Linux and macOS hosts produce identical images |\n *\n * An explicit version pin always selects exactly that release.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/appimage/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.3\" | \"1.1.0\" | \"1.2.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the NSIS toolset bundle used to compile Windows installers.\n *\n * The bundle ships:\n * - **`makensis`** — the NSIS compiler invoked to build `.nsi` scripts into `.exe` installers.\n * - **NSIS plugins** — the plugin DLLs (`NsisMultiUser`, `UAC`, `StdUtils`, etc.) referenced by\n * electron-builder's default installer scripts.\n * - **`elevate.exe`** — UAC elevation helper included in NSIS installers.\n *\n * Available versions:\n * | Version | `makensis` version | Notes |\n * |---------|------------------|-------|\n * | `\"0.0.0\"` | 3.0.4.1 | Legacy split bundle — `nsis` + `nsis-resources` archives (pre-v27) |\n * | `\"1.2.1\"` | 3.12 | Unified bundle — single archive, entrypoint scripts auto-set `NSISDIR` |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/nsis/CHANGELOG.md\n *\n * A custom bundle (a {@link ToolsetCustom} object) must follow the layout at\n * https://www.electron.build/docs/toolsets#custom-nsis-bundle-layout\n *\n * @default \"latest\"\n */\n readonly nsis?: \"0.0.0\" | \"1.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the WiX Toolset bundle used to build `msi` and `msiWrapped` installers.\n *\n * The bundle ships **`candle.exe`** and **`light.exe`** (compile and link the generated `.wxs` project) and the WiX\n * extensions (`WixUIExtension` for assisted installers). On macOS and Linux they run under Wine with wine-mono.\n *\n * Available versions:\n * | Version | WiX version | Notes |\n * |---------|-------------|-------|\n * | `\"0.0.0\"` | 4.0.0.5512 (preview) | Legacy bundle (pre-v27). An `arm64` app is packaged in an `x64` MSI, because this toolset has no `arm64` |\n * | `\"2.0.0\"` | 3.14.1 | Builds a native `arm64` MSI for `arm64` |\n *\n * The `.wxs` project uses the WiX 3 schema with `\"2.0.0\"`: an `msiProjectCreated` hook that inserts elements of a WiX 4\n * extension namespace must use the WiX 3 one (for example `http://schemas.microsoft.com/wix/UtilExtension`), or pin `\"0.0.0\"`.\n *\n * A custom bundle (a {@link ToolsetCustom} object) must have the WiX v3 layout: `candle.exe`, `light.exe` and the\n * extensions at its root.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wix/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly wix?: \"0.0.0\" | \"2.0.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Wine bundle used to run Windows tools (NSIS, rcedit, signtool) on\n * non-Windows hosts (macOS and Linux).\n *\n * Wine is only required when building Windows targets on a non-Windows machine. On Windows,\n * this setting has no effect.\n *\n * Available versions:\n * | Version | Wine version | Platform support | Notes |\n * |---------|-------------|-----------------|-------|\n * | `\"0.0.0\"` | 4.0.1 | macOS | Legacy portable bundle (pre-v27) |\n * | `\"1.0.1\"` | 11.0 | macOS | Supports arm64 macOS via Rosetta |\n * | `\"system\"` | host install | macOS, Linux | Uses the host Wine at a fixed install location instead of a bundle |\n *\n * `\"system\"` is the replacement for the `USE_SYSTEM_WINE` environment variable removed in v27, and\n * is what `\"latest\"` (the default) currently resolves to on every platform: the published `\"1.0.1\"`\n * bundles ship no PE builtins, so a host Wine installation is required to build Windows targets on\n * macOS or Linux.\n *\n * The host Wine (`\"system\"`) is started by absolute path, never looked up on `PATH`: it is the `wine` entry of\n * {@link executables}, which lists its default install locations and is where a Wine installed elsewhere is set.\n * Setting both a bundle that would be used (a `ToolsetCustom` object, or a version on macOS; on Linux a version selects no\n * bundle) and `executables.wine` is a configuration error.\n *\n * To use a custom Wine bundle, use a `ToolsetCustom` object.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wine/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly wine?: \"0.0.0\" | \"1.0.1\" | \"system\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the FPM bundle used to build Linux packages (`.deb`, `.rpm`, `.pacman`, etc.)\n * on macOS and Linux hosts.\n *\n * Available versions:\n * | Version | FPM version | Notes |\n * |---------|------------|-------|\n * | `\"2.2.1\"` | 1.17.0 (Ruby 3.4.3) | Current default |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/fpm/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly fpm?: \"2.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Linux-tools-mac bundle used to produce `.tar.lz` archives and build\n * Linux targets on macOS hosts.\n *\n * The bundle ships macOS-native builds of `ar`, `lzip`, and `gtar` (GNU tar).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | gnu-tar, lzip, makedepend, glib, libgsf, libtool, pcre, gettext, binutils |\n * | `\"1.0.1\"` | Same tools rebuilt on macOS 15 runners — binaries run on macOS 15+ (1.0.0 required macOS 26) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/linux-tools-mac/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly linuxToolsMac?: \"1.0.0\" | \"1.0.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the 7-Zip binary bundle used internally to extract `.7z` and `.tar.xz` archives.\n *\n * Set to a {@link ToolsetCustom} object to supply your own 7za binary.\n * The `url` must point to a directory (or a `.tar.gz`/`.zip` archive of one) that contains\n * `bin/7za` (macOS/Linux) or `bin/7za.exe` (Windows).\n *\n * **Bootstrap constraint:** the custom bundle itself must be a `.tar.gz` or `.zip` archive\n * (or a bare `file://` directory). `.7z` and `.tar.xz` archives cannot be used here because\n * extracting them requires 7za — a circular dependency.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | Shipped the 32-bit `7za.exe` for every Windows arch (1.75 GiB memory cap, no LZMA2 multithreading on x64/arm64) |\n * | `\"1.0.1\"` | Correct per-arch Windows binaries (x64, ia32, arm64) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/7zip/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly sevenZip?: \"1.0.0\" | \"1.0.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the icons-conversion bundle used to convert source images to `.icns`, `.ico`,\n * and PNG icon sets.\n *\n * Set to a {@link ToolsetCustom} object to supply your own icons bundle directory.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.2.3\"` | Writes 16px/32px ICNS entries as `ic04`/`ic05` ARGB (fixes corrupt small icons in Finder) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/icons/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly icons?: \"1.2.3\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the `squirrel.windows` bundle used to build Squirrel.Windows installers.\n *\n * The bundle ships the Squirrel vendor toolset under `electron-winstaller/vendor/`:\n * - **`Squirrel.exe`** / **`Squirrel-Mono.exe`** — releasify the app into `Setup.exe` (and an optional MSI).\n * - **`SyncReleases.exe`** — downloads prior releases to produce delta packages.\n * - **`nuget.exe`**, **`7z`** — pack the app into a `.nupkg` and compress release assets.\n *\n * `rcedit.exe` is provisioned from the {@link winCodeSign} toolset at runtime (on every platform;\n * under Wine on non-Windows hosts). Building an MSI additionally uses the shared WiX toolset.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.1.1\"` | Squirrel.Windows 2.0.1 (patched) with a standalone, checksum-verified `nuget.exe` 6.14.0 |\n *\n * Set to a {@link ToolsetCustom} object to supply your own bundle — it must contain the\n * `electron-winstaller/vendor/` subtree. Only used when building the `squirrelWindows` target.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/squirrel.windows/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly squirrel?: \"1.1.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Where the host programs that electron-builder starts are installed on the build machine, by program name.\n *\n * electron-builder starts these programs only from an absolute path, never by looking up a name on `PATH`. For each one it\n * uses the first location that is an executable file: from this entry when it is set, otherwise from a built-in list of\n * default install locations for the host operating system (see https://www.electron.build/docs/toolsets#executables).\n * An entry replaces the default list for that program; it is not merged with it.\n *\n * @example\n * ```json\n * {\n * \"toolsets\": {\n * \"executables\": {\n * \"mono\": \"file:///opt/homebrew/bin/mono\",\n * \"pwsh\": [\"file:///usr/local/microsoft/powershell/7/pwsh\", \"file:///opt/microsoft/powershell/7/pwsh\"],\n * \"powershell\": \"file:///C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe\"\n * }\n * }\n * }\n * ```\n */\n readonly executables?: ExecutablesConfig | null\n}\n\n/**\n * A custom toolset bundle supplied by the user in place of a built-in versioned bundle.\n *\n * The bundle must mirror the expected directory layout of the corresponding built-in bundle.\n * See the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n *\n * File formats supported for `url` archives: `.zip`, `.7z`, `.tar.gz`, `.tar.xz`.\n *\n * `checksum` is the SHA-256 of the archive as 64 hex characters or its SHA-512 as 88 base64 characters (the format v26\n * used for all toolset checksums), the same for every toolset. See https://www.electron.build/docs/toolsets#custom-toolset-checksum\n *\n * @example\n * ```json\n * {\n * \"toolsets\": {\n * \"nsis\": {\n * \"url\": \"file:///path/to/my-nsis-bundle.tar.gz\",\n * \"checksum\": \"56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4\",\n * \"version\": \"my-custom-1.0\"\n * }\n * }\n * }\n * ```\n */\nexport interface ToolsetCustom {\n /**\n * The `https://` URL or `file://` path to load the custom toolset bundle from.\n *\n * - `https://` — downloaded and cached locally; the archive is extracted before use.\n * - `file:///absolute/path` — used directly; relative paths must be within the project resources dir.\n *\n * Archives (`.zip`, `.7z`, `.tar.gz`, `.tar.xz`) are extracted automatically.\n * A bare directory path (no archive) is used as-is.\n */\n readonly url: string\n\n /**\n * Checksum of the bundle archive, in one of two formats:\n * - the SHA-256 as 64 hex characters (uppercase is lowercased), e.g. `shasum -a 256 <archive>` (macOS / Linux),\n * `(Get-FileHash -Algorithm SHA256 <archive>).Hash` (PowerShell) or `certutil -hashfile <archive> SHA256`;\n * - the SHA-512 as 88 base64 characters, the format v26 used for all toolset checksums, e.g.\n * `openssl dgst -sha512 -binary <archive> | openssl base64 -A`.\n *\n * Prefixed forms such as `sha256:…` or `sha512-…`, and a hex-encoded SHA-512, are rejected before anything is downloaded.\n * A downloaded archive is verified before it is cached or extracted, and a local `file://` archive before it is extracted.\n *\n * Required for remote (`https://`) URLs and local archive files (`file://`).\n * Not needed for bare directory paths — the directory is used as-is with no caching and no verification.\n * @see https://www.electron.build/docs/toolsets#custom-toolset-checksum\n */\n readonly checksum?: string\n\n /**\n * Optional version label used in the local cache directory name.\n * Falls back to the first 8 hex characters of the `checksum` digest when omitted.\n */\n readonly version?: string\n}\n\n/**\n * Lifecycle hooks that run at specific points during the electron-builder pipeline.\n *\n * Each hook can be specified as:\n * - An **inline function** (JavaScript/TypeScript config files only):\n * ```js\n * // electron-builder.config.js\n * module.exports = { beforePack: async (context) => { /* ... *\\/ } }\n * ```\n * - A **path** to a CommonJS/ESM module (relative to the project directory) that exports the\n * hook as its **default export**:\n * ```json\n * { \"build\": { \"beforePack\": \"./scripts/myHook.js\" } }\n * ```\n * ```js\n * // scripts/myHook.js\n * export default async function (context) { /* ... *\\/ }\n * ```\n */\nexport interface Hooks {\n /**\n * Called immediately before electron-builder begins packing the app for each platform/arch\n * combination.\n *\n * Use this hook to perform last-minute modifications to source files or build resources before\n * they are read by the packager.\n *\n * Receives a {@link BeforePackContext}.\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * Called after the prebuilt Electron binary has been extracted to the staging directory but\n * before the app files have been copied into it.\n *\n * Use this hook to patch or augment the Electron binary itself (e.g. rename helper processes,\n * inject native libraries) before the app payload is laid down on top.\n *\n * Receives an {@link AfterExtractContext}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * Called after the app files have been copied into the staging directory (and ASAR created if\n * applicable) but **before** signing and before the output archive/installer is built.\n *\n * Use this hook to post-process the staged app bundle (e.g. strip debug symbols, inject\n * platform-specific resources).\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called after code signing but **before** the signed app is packed into the final\n * distributable format (e.g. before `dmg` is created from the signed `.app`).\n *\n * Use this hook to perform post-sign validation or to add signed resources that are not part of\n * the main app bundle.\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called when an individual artifact build starts (e.g. just before a `.dmg` or `.exe` is\n * written to disk).\n *\n * Receives an {@link ArtifactBuildStarted}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n\n /**\n * Called when an individual artifact has been successfully built and written to disk.\n *\n * Use this hook to collect artifact paths, upload to custom destinations, or trigger\n * post-processing steps.\n *\n * Receives an {@link ArtifactCreated}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n\n /**\n * Called after **all** artifacts across all platforms/architectures have been built.\n *\n * May return an array of additional file paths that should be treated as publish targets\n * (i.e. uploaded to the configured publisher).\n *\n * Receives a {@link BuildResult}.\n *\n * @example\n * ```js\n * export default async function afterAllArtifactBuild(result) {\n * return [\"/path/to/extra-file.txt\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n\n /**\n * Called after the WiX MSI project XML has been written to a temporary directory but before\n * `candle.exe` / `light.exe` compile it into a `.msi` package.\n *\n * The hook receives the path to the project directory as a string. Use it to patch the generated\n * `.wxs` files for customizations not exposed through electron-builder's options.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n\n /**\n * Called after the AppX/MSIX manifest XML has been written to the staging directory but before\n * `makeappx` packages it.\n *\n * The hook receives the path to the manifest file as a string. Use it to inject custom manifest\n * extensions (capabilities, protocol handlers, etc.) not exposed through {@link AppXOptions}.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n\n /**\n * Called after the `distribution.xml` of a macOS `pkg` installer has been written (synthesized by\n * `productbuild --synthesize`, then customized from {@link PkgOptions}) but before `productbuild` builds the\n * installer from it.\n *\n * The hook receives the path to the distribution file as a string. Edit it in place or overwrite it to\n * customize the installer beyond {@link PkgOptions} (for example, its `<title>`).\n */\n readonly pkgDistributionCreated?: Hook<string, void> | string | null\n\n /**\n * Called for every file inside each `node_modules` package directory as electron-builder\n * decides whether to include it in the packaged app.\n *\n * Return `true` to force-include the file regardless of the default exclusion rules.\n * Return `false` or `undefined` to let electron-builder apply its normal filtering logic.\n *\n * Receives the absolute path of the file as a string.\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n\n /**\n * Called before dependencies are installed or native modules are rebuilt.\n *\n * Return `false` (or a `Promise` that resolves to `false`) to skip the install/rebuild step\n * entirely — useful when you manage `node_modules` externally (e.g. in a CI pipeline that\n * restores them from cache). When not set, electron-builder proceeds with the normal\n * install/rebuild flow.\n *\n * If this hook is provided and `node_modules` is missing, electron-builder will not perform\n * the production-dependencies check.\n *\n * Receives a {@link BeforeBuildContext}.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n\n /**\n * Override the source of the Electron distribution to stage.\n *\n * Should return the path to either:\n * - A **directory** containing a pre-built, unpacked Electron app (e.g. `~/electron/out/R`).\n * - A **directory** containing Electron zip archives following the naming convention\n * `electron-v${version}-${platformName}-${arch}.zip`.\n *\n * When not set, electron-builder downloads the official Electron release from GitHub (or the\n * mirror configured via `electronGet`).\n *\n * Receives a {@link PrepareApplicationStageDirectoryOptions}.\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\n/**\n * Overrides for the input and output directories used during the build.\n */\nexport interface MetadataDirectories {\n /**\n * The directory that contains static build resources (icons, background images, license files,\n * custom NSIS scripts, etc.) that electron-builder reads during packaging.\n *\n * **Build resources are not copied into the packaged app.** If you need runtime access to a\n * file (e.g. a tray icon), include it explicitly via the `fileOptions.files` option:\n * ```json\n * { \"fileOptions\": { \"files\": [\"**\\/*\", \"build/icon.*\"] } }\n * ```\n *\n * @default \"build\"\n */\n readonly buildResources?: string | null\n\n /**\n * The directory where electron-builder writes its output (installers, zip archives, etc.).\n *\n * [File macros](https://www.electron.build/file-patterns#file-macros) are supported, e.g.\n * `\"dist/${os}-${arch}\"` to separate outputs by platform and architecture.\n *\n * @default \"dist\"\n */\n readonly output?: string | null\n\n /**\n * The directory that contains the application's `package.json` and source code.\n *\n * Defaults to `app`, then `www`, then the project root. Set this when your packagable app\n * lives in a subdirectory (common in monorepos or when using a separate frontend build step).\n */\n readonly app?: string | null\n}\n\n/**\n * Configuration for experimental concurrent builds.\n */\nexport interface Concurrency {\n /**\n * Maximum number of platform/architecture builds to run in parallel.\n *\n * Set to `1` to disable concurrency (sequential builds, the safe default). Higher values\n * reduce wall-clock time on multi-platform builds at the cost of increased memory and CPU\n * usage. Ensure that your {@link Hooks} and build resources are safe to execute concurrently\n * before raising this limit.\n *\n * @default 1\n */\n jobs: number\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { exec, InvalidConfigurationError, log, sanitizeDirPath } from "builder-util";
1
+ import { exec, Executables, InvalidConfigurationError, log, sanitizeDirPath } from "builder-util";
2
2
  import { createHash } from "crypto";
3
3
  import { open } from "fs/promises";
4
4
  import * as path from "path";
@@ -93,7 +93,7 @@ export async function embedAsarIntegrityDigest(appPath, frameworkName) {
93
93
  // --deep: Electron's x64 builds ship the framework's nested code unsigned, and codesign refuses to seal a bundle around unsigned code
94
94
  // Copied/verified from electron/packager:
95
95
  // https://github.com/electron/packager/blob/8c5cc941018b1d890c7152734972c44b9b98f268/src/mac.ts#L704-L733
96
- await exec("/usr/bin/codesign", ["--sign", "-", "--force", "--deep", "--preserve-metadata=entitlements,requirements,flags,runtime", frameworkPath]);
96
+ await exec(Executables.resolve("codesign"), ["--sign", "-", "--force", "--deep", "--preserve-metadata=entitlements,requirements,flags,runtime", frameworkPath]);
97
97
  log.info({ file: log.filePath(frameworkPath) }, "embedded ASAR integrity digest");
98
98
  return true;
99
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"asarIntegrityDigest.js","sourceRoot":"","sources":["../../../src/electron/mac/asarIntegrityDigest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAc,IAAI,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,kCAAkC,CAAA;AAEhF,oFAAoF;AACpF,MAAM,CAAC,MAAM,+CAA+C,GAAG,EAAE,CAAA;AAEjE,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,aAAa,GAAG,EAAE,CAAA;AACxB,0BAA0B;AAC1B,MAAM,WAAW,GAAG,CAAC,GAAG,aAAa,CAAA;AACrC,MAAM,eAAe,GAAG,CAAC,GA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,CAAC,CAAC,qBAAqB,CAAA;IAC/G,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,MAAM,IAAI,yBAAyB,CACjC,eAAe,aAAa,wCAAwC,CAAC,CAAC,OAAO,iMAAiM,CAC/Q,CAAA;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,MAAkB,EAAE,IAAY,EAAE,QAAgB;IAC7E,4HAA4H;IAC5H,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,eAAe,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACxE,MAAM,OAAO,GAAkB,EAAE,CAAA;IACjC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,eAAe,EAAE,CAAC;QAC3D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QAChG,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;QAC3C,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;YACnG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { exec, InvalidConfigurationError, log, sanitizeDirPath } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { FileHandle, open } from \"fs/promises\"\nimport * as path from \"path\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\nimport { parsePlistFile } from \"../../util/mac/plist.js\"\n\n/**\n * Marks the slot Electron (>= 41) reserves in the `Electron Framework` binary for the digest of the\n * `ElectronAsarIntegrity` Info.plist dictionary. The sentinel is followed by `used` (1 byte), `version` (1 byte) and\n * the SHA-256 digest (32 bytes); Electron skips the check (fails open) while `used` is 0.\n * @see https://github.com/electron/electron/blob/main/shell/common/asar/integrity_digest.mm\n */\nexport const ASAR_INTEGRITY_DIGEST_SENTINEL = \"AGbevlPCksUGKNL8TSn7wGmJEuJsXb2A\"\n\n/** electron/electron#48587, first released in 41.0.0-alpha.1 and not backported. */\nexport const FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST = 41\n\nconst DIGEST_VERSION = 1\nconst DIGEST_LENGTH = 32\n// used + version + digest\nconst SLOT_LENGTH = 2 + DIGEST_LENGTH\nconst SCAN_CHUNK_SIZE = 4 * 1024 * 1024\n\n/**\n * Computes the version 1 digest Electron validates the `ElectronAsarIntegrity` dictionary against: SHA-256 over the\n * UTF-8 key, algorithm and hash of every entry, in key order.\n * @internal\n */\nexport function computeAsarIntegrityDigest(integrity: AsarIntegrity): Buffer {\n const hash = createHash(\"sha256\")\n // Electron sorts the keys with NSLiteralSearch (UTF-16 code unit order), which is what the default sort() does; localeCompare would not match\n for (const key of Object.keys(integrity).sort()) {\n const { algorithm, hash: headerHash } = integrity[key]\n hash.update(key).update(algorithm).update(headerHash)\n }\n return hash.digest()\n}\n\n/**\n * Writes `digest` into every digest slot of an `Electron Framework` binary (one per architecture slice) and returns how\n * many slots were written, 0 if the binary has none (Electron < 41). The slots are counted and bounds-checked before the\n * first write, so a failure never leaves one slice of a universal binary enforcing a digest the other lacks.\n * @internal\n */\nexport async function writeAsarIntegrityDigest(binaryPath: string, digest: Buffer): Promise<number> {\n if (digest.length !== DIGEST_LENGTH) {\n throw new Error(`ASAR integrity digest must be ${DIGEST_LENGTH} bytes, got ${digest.length}`)\n }\n\n const sentinel = Buffer.from(ASAR_INTEGRITY_DIGEST_SENTINEL)\n const handle = await open(binaryPath, \"r+\")\n try {\n const { size } = await handle.stat()\n const slotOffsets = (await findSentinels(handle, size, sentinel)).map(it => it + sentinel.length)\n if (slotOffsets.length > 2) {\n throw new Error(`Found ${slotOffsets.length} ASAR integrity digest slots in ${binaryPath}, at most 2 are expected (one per slice of a universal binary)`)\n }\n for (const offset of slotOffsets) {\n if (offset + SLOT_LENGTH > size) {\n throw new Error(`ASAR integrity digest slot at offset ${offset} of ${binaryPath} is truncated, the binary is corrupted or not an Electron Framework`)\n }\n }\n\n const payload = Buffer.alloc(SLOT_LENGTH)\n payload[0] = 1 // used\n payload[1] = DIGEST_VERSION\n digest.copy(payload, 2)\n for (const offset of slotOffsets) {\n await handle.write(payload, 0, payload.length, offset)\n }\n return slotOffsets.length\n } finally {\n await handle.close()\n }\n}\n\n/**\n * Embeds the digest of the app's `ElectronAsarIntegrity` Info.plist entries into its Electron Framework, then signs the\n * framework again, ad hoc: the write invalidates its signature (Electron's arm64 builds ship linker-signed), and Apple\n * Silicon refuses to load a binary whose signature is invalid. Code signing the app afterwards replaces the ad-hoc\n * signature. macOS only (codesign). Returns whether the digest was embedded.\n * @internal\n */\nexport async function embedAsarIntegrityDigest(appPath: string, frameworkName: string): Promise<boolean> {\n const safeAppPath = sanitizeDirPath(appPath)\n const infoPlistPath = path.join(safeAppPath, \"Contents\", \"Info.plist\")\n const integrity = await readAsarIntegrity(infoPlistPath)\n if (integrity == null || Object.keys(integrity).length === 0) {\n log.warn({ file: log.filePath(infoPlistPath), reason: \"Info.plist has no ElectronAsarIntegrity entries\" }, \"skipped ASAR integrity digest\")\n return false\n }\n\n // frameworkName is a file name, not a path: resolving it on its own would root it at the cwd. Containment keeps both paths inside the app\n const frameworksDir = path.join(safeAppPath, \"Contents\", \"Frameworks\")\n const frameworkPath = sanitizeDirPath(path.join(frameworksDir, `${frameworkName}.framework`), frameworksDir)\n const binaryPath = sanitizeDirPath(path.join(frameworkPath, frameworkName), frameworkPath)\n if ((await writeAsarIntegrityDigest(binaryPath, computeAsarIntegrityDigest(integrity))) === 0) {\n log.warn({ file: log.filePath(binaryPath), reason: \"the binary has no ASAR integrity digest slot\" }, \"skipped ASAR integrity digest\")\n return false\n }\n\n // --deep: Electron's x64 builds ship the framework's nested code unsigned, and codesign refuses to seal a bundle around unsigned code\n // Copied/verified from electron/packager:\n // https://github.com/electron/packager/blob/8c5cc941018b1d890c7152734972c44b9b98f268/src/mac.ts#L704-L733\n await exec(\"/usr/bin/codesign\", [\"--sign\", \"-\", \"--force\", \"--deep\", \"--preserve-metadata=entitlements,requirements,flags,runtime\", frameworkPath])\n log.info({ file: log.filePath(frameworkPath) }, \"embedded ASAR integrity digest\")\n return true\n}\n\n// parsePlistFile reads the XML format electron-builder writes; an afterPack hook that edits Info.plist with `defaults write` leaves it binary\nasync function readAsarIntegrity(infoPlistPath: string): Promise<AsarIntegrity | undefined> {\n try {\n return (await parsePlistFile<{ ElectronAsarIntegrity?: AsarIntegrity }>(infoPlistPath)).ElectronAsarIntegrity\n } catch (e: any) {\n throw new InvalidConfigurationError(\n `Cannot read ${infoPlistPath} to embed the ASAR integrity digest: ${e.message}. Keep Info.plist in the XML format electron-builder writes (\\`defaults write\\` converts it to binary, PlistBuddy and \\`plutil -replace\\` keep it XML), or set mac.asarIntegrityDigest to false`\n )\n }\n}\n\nasync function findSentinels(handle: FileHandle, size: number, sentinel: Buffer): Promise<Array<number>> {\n // each read overlaps the next chunk by sentinel.length - 1 bytes, so a sentinel straddling a chunk boundary is found (once)\n const buffer = Buffer.allocUnsafe(SCAN_CHUNK_SIZE + sentinel.length - 1)\n const offsets: Array<number> = []\n for (let start = 0; start < size; start += SCAN_CHUNK_SIZE) {\n const { bytesRead } = await handle.read(buffer, 0, Math.min(buffer.length, size - start), start)\n const chunk = buffer.subarray(0, bytesRead)\n for (let index = chunk.indexOf(sentinel); index !== -1; index = chunk.indexOf(sentinel, index + 1)) {\n offsets.push(start + index)\n }\n }\n return offsets\n}\n"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M,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QAChG,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;QAC3C,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;YACnG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { exec, Executables, InvalidConfigurationError, log, sanitizeDirPath } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { FileHandle, open } from \"fs/promises\"\nimport * as path from \"path\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\nimport { parsePlistFile } from \"../../util/mac/plist.js\"\n\n/**\n * Marks the slot Electron (>= 41) reserves in the `Electron Framework` binary for the digest of the\n * `ElectronAsarIntegrity` Info.plist dictionary. The sentinel is followed by `used` (1 byte), `version` (1 byte) and\n * the SHA-256 digest (32 bytes); Electron skips the check (fails open) while `used` is 0.\n * @see https://github.com/electron/electron/blob/main/shell/common/asar/integrity_digest.mm\n */\nexport const ASAR_INTEGRITY_DIGEST_SENTINEL = \"AGbevlPCksUGKNL8TSn7wGmJEuJsXb2A\"\n\n/** electron/electron#48587, first released in 41.0.0-alpha.1 and not backported. */\nexport const FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST = 41\n\nconst DIGEST_VERSION = 1\nconst DIGEST_LENGTH = 32\n// used + version + digest\nconst SLOT_LENGTH = 2 + DIGEST_LENGTH\nconst SCAN_CHUNK_SIZE = 4 * 1024 * 1024\n\n/**\n * Computes the version 1 digest Electron validates the `ElectronAsarIntegrity` dictionary against: SHA-256 over the\n * UTF-8 key, algorithm and hash of every entry, in key order.\n * @internal\n */\nexport function computeAsarIntegrityDigest(integrity: AsarIntegrity): Buffer {\n const hash = createHash(\"sha256\")\n // Electron sorts the keys with NSLiteralSearch (UTF-16 code unit order), which is what the default sort() does; localeCompare would not match\n for (const key of Object.keys(integrity).sort()) {\n const { algorithm, hash: headerHash } = integrity[key]\n hash.update(key).update(algorithm).update(headerHash)\n }\n return hash.digest()\n}\n\n/**\n * Writes `digest` into every digest slot of an `Electron Framework` binary (one per architecture slice) and returns how\n * many slots were written, 0 if the binary has none (Electron < 41). The slots are counted and bounds-checked before the\n * first write, so a failure never leaves one slice of a universal binary enforcing a digest the other lacks.\n * @internal\n */\nexport async function writeAsarIntegrityDigest(binaryPath: string, digest: Buffer): Promise<number> {\n if (digest.length !== DIGEST_LENGTH) {\n throw new Error(`ASAR integrity digest must be ${DIGEST_LENGTH} bytes, got ${digest.length}`)\n }\n\n const sentinel = Buffer.from(ASAR_INTEGRITY_DIGEST_SENTINEL)\n const handle = await open(binaryPath, \"r+\")\n try {\n const { size } = await handle.stat()\n const slotOffsets = (await findSentinels(handle, size, sentinel)).map(it => it + sentinel.length)\n if (slotOffsets.length > 2) {\n throw new Error(`Found ${slotOffsets.length} ASAR integrity digest slots in ${binaryPath}, at most 2 are expected (one per slice of a universal binary)`)\n }\n for (const offset of slotOffsets) {\n if (offset + SLOT_LENGTH > size) {\n throw new Error(`ASAR integrity digest slot at offset ${offset} of ${binaryPath} is truncated, the binary is corrupted or not an Electron Framework`)\n }\n }\n\n const payload = Buffer.alloc(SLOT_LENGTH)\n payload[0] = 1 // used\n payload[1] = DIGEST_VERSION\n digest.copy(payload, 2)\n for (const offset of slotOffsets) {\n await handle.write(payload, 0, payload.length, offset)\n }\n return slotOffsets.length\n } finally {\n await handle.close()\n }\n}\n\n/**\n * Embeds the digest of the app's `ElectronAsarIntegrity` Info.plist entries into its Electron Framework, then signs the\n * framework again, ad hoc: the write invalidates its signature (Electron's arm64 builds ship linker-signed), and Apple\n * Silicon refuses to load a binary whose signature is invalid. Code signing the app afterwards replaces the ad-hoc\n * signature. macOS only (codesign). Returns whether the digest was embedded.\n * @internal\n */\nexport async function embedAsarIntegrityDigest(appPath: string, frameworkName: string): Promise<boolean> {\n const safeAppPath = sanitizeDirPath(appPath)\n const infoPlistPath = path.join(safeAppPath, \"Contents\", \"Info.plist\")\n const integrity = await readAsarIntegrity(infoPlistPath)\n if (integrity == null || Object.keys(integrity).length === 0) {\n log.warn({ file: log.filePath(infoPlistPath), reason: \"Info.plist has no ElectronAsarIntegrity entries\" }, \"skipped ASAR integrity digest\")\n return false\n }\n\n // frameworkName is a file name, not a path: resolving it on its own would root it at the cwd. Containment keeps both paths inside the app\n const frameworksDir = path.join(safeAppPath, \"Contents\", \"Frameworks\")\n const frameworkPath = sanitizeDirPath(path.join(frameworksDir, `${frameworkName}.framework`), frameworksDir)\n const binaryPath = sanitizeDirPath(path.join(frameworkPath, frameworkName), frameworkPath)\n if ((await writeAsarIntegrityDigest(binaryPath, computeAsarIntegrityDigest(integrity))) === 0) {\n log.warn({ file: log.filePath(binaryPath), reason: \"the binary has no ASAR integrity digest slot\" }, \"skipped ASAR integrity digest\")\n return false\n }\n\n // --deep: Electron's x64 builds ship the framework's nested code unsigned, and codesign refuses to seal a bundle around unsigned code\n // Copied/verified from electron/packager:\n // https://github.com/electron/packager/blob/8c5cc941018b1d890c7152734972c44b9b98f268/src/mac.ts#L704-L733\n await exec(Executables.resolve(\"codesign\"), [\"--sign\", \"-\", \"--force\", \"--deep\", \"--preserve-metadata=entitlements,requirements,flags,runtime\", frameworkPath])\n log.info({ file: log.filePath(frameworkPath) }, \"embedded ASAR integrity digest\")\n return true\n}\n\n// parsePlistFile reads the XML format electron-builder writes; an afterPack hook that edits Info.plist with `defaults write` leaves it binary\nasync function readAsarIntegrity(infoPlistPath: string): Promise<AsarIntegrity | undefined> {\n try {\n return (await parsePlistFile<{ ElectronAsarIntegrity?: AsarIntegrity }>(infoPlistPath)).ElectronAsarIntegrity\n } catch (e: any) {\n throw new InvalidConfigurationError(\n `Cannot read ${infoPlistPath} to embed the ASAR integrity digest: ${e.message}. Keep Info.plist in the XML format electron-builder writes (\\`defaults write\\` converts it to binary, PlistBuddy and \\`plutil -replace\\` keep it XML), or set mac.asarIntegrityDigest to false`\n )\n }\n}\n\nasync function findSentinels(handle: FileHandle, size: number, sentinel: Buffer): Promise<Array<number>> {\n // each read overlaps the next chunk by sentinel.length - 1 bytes, so a sentinel straddling a chunk boundary is found (once)\n const buffer = Buffer.allocUnsafe(SCAN_CHUNK_SIZE + sentinel.length - 1)\n const offsets: Array<number> = []\n for (let start = 0; start < size; start += SCAN_CHUNK_SIZE) {\n const { bytesRead } = await handle.read(buffer, 0, Math.min(buffer.length, size - start), start)\n const chunk = buffer.subarray(0, bytesRead)\n for (let index = chunk.indexOf(sentinel); index !== -1; index = chunk.indexOf(sentinel, index + 1)) {\n offsets.push(start + index)\n }\n }\n return offsets\n}\n"]}
@@ -25,8 +25,9 @@ export declare function getAvailableHelperSuffixes(present: AvailableHelpers): s
25
25
  * Adds the App Transport Security entries that electron-updater's local update proxy needs: local networking, and
26
26
  * plain-HTTP exceptions for `localhost` and `127.0.0.1`.
27
27
  *
28
- * `NSAllowsArbitraryLoads` is set to `true` only when the app has not set it already, for example through
29
- * `mac.extendInfo`, so an explicit `false` is kept.
28
+ * Electron's default `Info.plist` already enables `NSAllowsArbitraryLoads`, and `mac.extendInfo` is merged over it before this runs,
29
+ * so whatever value the app sets there is kept; the key is set to `true` only when it is missing (or `null`, which `extendInfo` cannot
30
+ * use to remove it).
30
31
  */
31
32
  export declare function configureLocalhostAts(appPlist: any): void;
32
33
  //# sourceMappingURL=electronMacUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"electronMacUtils.d.ts","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOtE;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAkB9E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CA+BzD"}
1
+ {"version":3,"file":"electronMacUtils.d.ts","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOtE;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAkB9E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CA+BzD"}
@@ -43,8 +43,9 @@ export function getAvailableHelperSuffixes(present) {
43
43
  * Adds the App Transport Security entries that electron-updater's local update proxy needs: local networking, and
44
44
  * plain-HTTP exceptions for `localhost` and `127.0.0.1`.
45
45
  *
46
- * `NSAllowsArbitraryLoads` is set to `true` only when the app has not set it already, for example through
47
- * `mac.extendInfo`, so an explicit `false` is kept.
46
+ * Electron's default `Info.plist` already enables `NSAllowsArbitraryLoads`, and `mac.extendInfo` is merged over it before this runs,
47
+ * so whatever value the app sets there is kept; the key is set to `true` only when it is missing (or `null`, which `extendInfo` cannot
48
+ * use to remove it).
48
49
  */
49
50
  export function configureLocalhostAts(appPlist) {
50
51
  // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/