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

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 (220) 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 +46 -3
  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 +15 -12
  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 +1 -0
  81. package/dist/packager.d.ts.map +1 -1
  82. package/dist/packager.js +7 -2
  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 +51 -17
  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/linux/FlatpakTarget.js +5 -5
  110. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  111. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  112. package/dist/targets/linux/FpmTarget.js +10 -7
  113. package/dist/targets/linux/FpmTarget.js.map +1 -1
  114. package/dist/targets/linux/LinuxTargetHelper.js +1 -1
  115. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  116. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  117. package/dist/targets/linux/appimage/AppImageTarget.js +6 -1
  118. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  119. package/dist/targets/linux/appimage/appImageUtil.js +9 -9
  120. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  121. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -1
  122. package/dist/targets/linux/flatpakBundle.js +25 -20
  123. package/dist/targets/linux/flatpakBundle.js.map +1 -1
  124. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  125. package/dist/targets/linux/snap/coreLegacy.js +22 -6
  126. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  127. package/dist/targets/linux/snap/snapPlugs.d.ts +2 -2
  128. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -1
  129. package/dist/targets/linux/snap/snapPlugs.js +1 -1
  130. package/dist/targets/linux/snap/snapPlugs.js.map +1 -1
  131. package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
  132. package/dist/targets/linux/snap/snapcraftBuilder.js +19 -17
  133. package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
  134. package/dist/targets/mac/MacTargetHelper.d.ts +15 -3
  135. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  136. package/dist/targets/mac/MacTargetHelper.js +96 -13
  137. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  138. package/dist/targets/mac/pkg.d.ts.map +1 -1
  139. package/dist/targets/mac/pkg.js +7 -5
  140. package/dist/targets/mac/pkg.js.map +1 -1
  141. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  142. package/dist/targets/win/nsis/NsisTarget.js +8 -2
  143. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  144. package/dist/targets/win/nsis/nsisOptions.d.ts +1 -1
  145. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  146. package/dist/toolsets/nsis.js +1 -1
  147. package/dist/toolsets/nsis.js.map +1 -1
  148. package/dist/toolsets/wine.d.ts +3 -0
  149. package/dist/toolsets/wine.d.ts.map +1 -1
  150. package/dist/toolsets/wine.js +14 -5
  151. package/dist/toolsets/wine.js.map +1 -1
  152. package/dist/util/appFileCopier.d.ts.map +1 -1
  153. package/dist/util/appFileCopier.js +9 -3
  154. package/dist/util/appFileCopier.js.map +1 -1
  155. package/dist/util/buildOutputVerifier.d.ts +40 -0
  156. package/dist/util/buildOutputVerifier.d.ts.map +1 -0
  157. package/dist/util/buildOutputVerifier.js +420 -0
  158. package/dist/util/buildOutputVerifier.js.map +1 -0
  159. package/dist/util/config/fileOptions.js +2 -2
  160. package/dist/util/config/fileOptions.js.map +1 -1
  161. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
  162. package/dist/util/config/legacyConfigGuard.js +2 -2
  163. package/dist/util/config/legacyConfigGuard.js.map +1 -1
  164. package/dist/util/config/legacyOptions.d.ts +9 -2
  165. package/dist/util/config/legacyOptions.d.ts.map +1 -1
  166. package/dist/util/config/legacyOptions.js +8 -2
  167. package/dist/util/config/legacyOptions.js.map +1 -1
  168. package/dist/util/electronGet.d.ts.map +1 -1
  169. package/dist/util/electronGet.js +3 -1
  170. package/dist/util/electronGet.js.map +1 -1
  171. package/dist/util/flags.d.ts.map +1 -1
  172. package/dist/util/flags.js +3 -9
  173. package/dist/util/flags.js.map +1 -1
  174. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  175. package/dist/util/mac/macosIconComposer.js +6 -5
  176. package/dist/util/mac/macosIconComposer.js.map +1 -1
  177. package/dist/util/macroExpander.js +1 -1
  178. package/dist/util/macroExpander.js.map +1 -1
  179. package/dist/util/nativeBinaryVerifier.d.ts.map +1 -1
  180. package/dist/util/nativeBinaryVerifier.js +3 -1
  181. package/dist/util/nativeBinaryVerifier.js.map +1 -1
  182. package/dist/util/packageMetadata.js +1 -1
  183. package/dist/util/packageMetadata.js.map +1 -1
  184. package/dist/util/removedEnvVars.d.ts +2 -0
  185. package/dist/util/removedEnvVars.d.ts.map +1 -1
  186. package/dist/util/removedEnvVars.js +15 -1
  187. package/dist/util/removedEnvVars.js.map +1 -1
  188. package/dist/util/streamSpawnToFile.d.ts +3 -1
  189. package/dist/util/streamSpawnToFile.d.ts.map +1 -1
  190. package/dist/util/streamSpawnToFile.js +6 -2
  191. package/dist/util/streamSpawnToFile.js.map +1 -1
  192. package/dist/version.d.ts +1 -1
  193. package/dist/version.js +1 -1
  194. package/dist/version.js.map +1 -1
  195. package/dist/vm/ParallelsVm.d.ts +10 -0
  196. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  197. package/dist/vm/ParallelsVm.js +22 -8
  198. package/dist/vm/ParallelsVm.js.map +1 -1
  199. package/dist/vm/PwshVm.d.ts +0 -1
  200. package/dist/vm/PwshVm.d.ts.map +1 -1
  201. package/dist/vm/PwshVm.js +10 -15
  202. package/dist/vm/PwshVm.js.map +1 -1
  203. package/dist/vm/WineVm.d.ts.map +1 -1
  204. package/dist/vm/WineVm.js +4 -4
  205. package/dist/vm/WineVm.js.map +1 -1
  206. package/dist/vm/vm.d.ts +9 -3
  207. package/dist/vm/vm.d.ts.map +1 -1
  208. package/dist/vm/vm.js +40 -32
  209. package/dist/vm/vm.js.map +1 -1
  210. package/dist/winPackager.d.ts +16 -1
  211. package/dist/winPackager.d.ts.map +1 -1
  212. package/dist/winPackager.js +77 -19
  213. package/dist/winPackager.js.map +1 -1
  214. package/package.json +9 -9
  215. package/scheme.json +497 -23
  216. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +14 -9
  217. package/dist/vm/MonoVm.d.ts +0 -9
  218. package/dist/vm/MonoVm.d.ts.map +0 -1
  219. package/dist/vm/MonoVm.js +0 -16
  220. package/dist/vm/MonoVm.js.map +0 -1
@@ -23,6 +23,27 @@ export declare class MacPackager extends PlatformPackager<MacConfiguration | Mas
23
23
  private _iconPath;
24
24
  readonly helper: MacTargetHelper;
25
25
  constructor(info: Packager);
26
+ /**
27
+ * Fails a forceCodeSigning build at build start, before anything is packed, when the macOS app could not be signed or
28
+ * notarized: on a host other than macOS, in a pull-request build without CSC_FOR_PULL_REQUEST, or without notarization
29
+ * credentials; and a build with `mac.notarize: true` without notarization credentials, where notarization can happen.
30
+ * sign() and notarizeIfProvided keep their own checks for callers that never emit `targetsCreated`.
31
+ */
32
+ private checkForceCodeSigningAtBuildStart;
33
+ /**
34
+ * `forceCodeSigning` of a flavor: `mas` and `mas-dev` cascade `mac` → `mas` → `masDev` like every other option (see
35
+ * getPlatformConfig), then the root value. For `mac` it is {@link forceCodeSigning}.
36
+ */
37
+ forceCodeSigningFor(platformType: PlatformType): boolean;
38
+ /** The `-c` override that turns `forceCodeSigning` off for a flavor: on the most specific block that sets it. */
39
+ forceCodeSigningOverrideHintFor(platformType: PlatformType): string;
40
+ /**
41
+ * Whether sign() skips the macOS app because of the configuration, before it would notarize it: `sign: null`, `sign.identity: null`,
42
+ * or `CSC_IDENTITY_AUTO_DISCOVERY=false` without an identity (`sign.identity` or `CSC_NAME`) or a custom signer.
43
+ */
44
+ private isMacSigningSkippedByConfiguration;
45
+ /** Whether `pack` builds the non-MAS app: unless every target is a MAS one. No target at all is a dir build. */
46
+ private static packsNonMasApp;
26
47
  get defaultTarget(): Array<string>;
27
48
  /**
28
49
  * Get the merged configuration for a specific platform type. Calls statically known to be a MAS
@@ -52,6 +73,11 @@ export declare class MacPackager extends PlatformPackager<MacConfiguration | Mas
52
73
  pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void>;
53
74
  private packMasTargets;
54
75
  private packMacTargets;
76
+ /**
77
+ * electron-builder neither signs nor notarizes a prepackaged app, so under forceCodeSigning the app it packages must
78
+ * already carry a valid signature - and a stapled notarization ticket, unless `mac.notarize` is false.
79
+ */
80
+ private verifyPrepackagedApp;
55
81
  /**
56
82
  * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`
57
83
  * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).
@@ -1 +1 @@
1
- {"version":3,"file":"macPackager.d.ts","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAYjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAMxD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,OAAO,EAAE,eAAe,EAAkB,qBAAqB,EAAE,QAAQ,EAAuC,MAAM,+BAA+B,CAAA;AACrJ,OAAO,EAA0C,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAChG,OAAO,EAAwB,MAAM,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjG,OAAO,EAAuB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAE,QAAQ,EA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,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;cA2E/G,OAAO,CAAC,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;CAgC7H"}
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  const _require = createRequire(import.meta.url);
3
- import { Arch, copyFile, deepAssign, exec, exists, getArchSuffix, InvalidConfigurationError, log, orIfFileNotExist, sanitizeDirPath, unlinkIfExists, use, } from "builder-util";
3
+ import { Arch, copyFile, deepAssign, exec, Executables, exists, getArchSuffix, InvalidConfigurationError, isEmptyOrSpaces, log, orIfFileNotExist, sanitizeDirPath, unlinkIfExists, use, } from "builder-util";
4
4
  import { MemoLazy } from "builder-util-runtime";
5
5
  import * as fs from "fs/promises";
6
6
  import { mkdir, readdir } from "fs/promises";
@@ -10,7 +10,10 @@ import * as semver from "semver";
10
10
  import { AppInfo } from "./appInfo.js";
11
11
  import { embedAsarIntegrityDigest, FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST } from "./electron/mac/asarIntegrityDigest.js";
12
12
  import { assertSafeHelperName } from "./electron/mac/electronMacUtils.js";
13
- import { createKeychain, isSignAllowed, removeKeychain, sign } from "./codeSign/mac/macCodeSign.js";
13
+ import { forceCodeSigningError, forceCodeSigningOverrideHint, VERIFICATION_FAILED_ERROR_CODE } from "./codeSign/forceCodeSigning.js";
14
+ import { isAutoDiscoveryCodeSignIdentity } from "./util/flags.js";
15
+ import { createKeychain, isSignAllowed, macSigningUnavailableError, removeKeychain, sign } from "./codeSign/mac/macCodeSign.js";
16
+ import { validateStapledTicket, verifyMacCodeSignature } from "./codeSign/mac/macSignatureVerifier.js";
14
17
  import { combineSignResults, isSignResultSigned } from "./codeSign/signResult.js";
15
18
  import { DIR_TARGET, Platform } from "./core.js";
16
19
  import { MacTargetHelper } from "./targets/mac/MacTargetHelper.js";
@@ -68,6 +71,108 @@ export class MacPackager extends PlatformPackager {
68
71
  });
69
72
  this._iconPath = new Lazy(() => this.getOrConvertIcon("icns"));
70
73
  this.helper = new MacTargetHelper(this);
74
+ info.onTargetsCreated(plans => this.checkForceCodeSigningAtBuildStart(plans));
75
+ }
76
+ /**
77
+ * Fails a forceCodeSigning build at build start, before anything is packed, when the macOS app could not be signed or
78
+ * notarized: on a host other than macOS, in a pull-request build without CSC_FOR_PULL_REQUEST, or without notarization
79
+ * credentials; and a build with `mac.notarize: true` without notarization credentials, where notarization can happen.
80
+ * sign() and notarizeIfProvided keep their own checks for callers that never emit `targetsCreated`.
81
+ */
82
+ checkForceCodeSigningAtBuildStart(plans) {
83
+ const ownPlans = plans.filter(it => it.packager === this);
84
+ // each flavor that is built, with its own forceCodeSigning: the macOS app (and its pkg), and every MAS target
85
+ const flavors = new Set();
86
+ for (const { targets } of ownPlans) {
87
+ if (MacPackager.packsNonMasApp(targets) || targets.some(it => it.name === "pkg")) {
88
+ flavors.add("mac");
89
+ }
90
+ for (const target of targets) {
91
+ if (MacTargetHelper.isMasTarget(target.name)) {
92
+ flavors.add(MacTargetHelper.getPlatformTypeFromTarget(target.name));
93
+ }
94
+ }
95
+ }
96
+ for (const flavor of flavors) {
97
+ if (!this.forceCodeSigningFor(flavor)) {
98
+ continue;
99
+ }
100
+ const unavailable = macSigningUnavailableError(flavor === "mac" ? "the macOS app" : `the ${flavor} app`, this.forceCodeSigningOverrideHintFor(flavor));
101
+ if (unavailable != null) {
102
+ throw unavailable;
103
+ }
104
+ }
105
+ if (!flavors.has("mac")) {
106
+ return;
107
+ }
108
+ // the non-MAS app is notarized when it is packed (never for a prepackaged one), and the pkg installer always
109
+ const prepackaged = this.packagerOptions.prepackaged != null;
110
+ const packsApp = ownPlans.some(({ targets }) => !prepackaged && MacPackager.packsNonMasApp(targets));
111
+ const packsPkg = ownPlans.some(({ targets }) => targets.some(it => it.name === "pkg"));
112
+ const notarize = this.platformSpecificBuildOptions.notarize;
113
+ if ((!packsApp && !packsPkg) || notarize === false) {
114
+ return;
115
+ }
116
+ // the credentials are read (getNotarizeOptions also rejects an incomplete set) only where they are required
117
+ if (this.forceCodeSigning) {
118
+ if (MacTargetHelper.getNotarizeOptions("") == null) {
119
+ throw MacTargetHelper.missingNotarizationCredentialsError();
120
+ }
121
+ return;
122
+ }
123
+ // notarize: true requires notarization where it runs: the app only when sign() signs it, the pkg installer whenever it is built
124
+ if (!MacTargetHelper.isNotarizationRequired(notarize) || (!packsPkg && this.isMacSigningSkippedByConfiguration())) {
125
+ return;
126
+ }
127
+ if (MacTargetHelper.getNotarizeOptions("") == null) {
128
+ throw MacTargetHelper.notarizeTrueWithoutCredentialsError();
129
+ }
130
+ }
131
+ /**
132
+ * `forceCodeSigning` of a flavor: `mas` and `mas-dev` cascade `mac` → `mas` → `masDev` like every other option (see
133
+ * getPlatformConfig), then the root value. For `mac` it is {@link forceCodeSigning}.
134
+ */
135
+ forceCodeSigningFor(platformType) {
136
+ if (platformType === "mac") {
137
+ return this.forceCodeSigning;
138
+ }
139
+ return this.getPlatformConfig(platformType).config.forceCodeSigning ?? this.config.forceCodeSigning ?? false;
140
+ }
141
+ /** The `-c` override that turns `forceCodeSigning` off for a flavor: on the most specific block that sets it. */
142
+ forceCodeSigningOverrideHintFor(platformType) {
143
+ if (platformType === "mas-dev" && this.config.masDev?.forceCodeSigning != null) {
144
+ return "-c.masDev.forceCodeSigning=false";
145
+ }
146
+ if (platformType !== "mac" && this.config.mas?.forceCodeSigning != null) {
147
+ return "-c.mas.forceCodeSigning=false";
148
+ }
149
+ return forceCodeSigningOverrideHint(this);
150
+ }
151
+ /**
152
+ * Whether sign() skips the macOS app because of the configuration, before it would notarize it: `sign: null`, `sign.identity: null`,
153
+ * or `CSC_IDENTITY_AUTO_DISCOVERY=false` without an identity (`sign.identity` or `CSC_NAME`) or a custom signer.
154
+ */
155
+ isMacSigningSkippedByConfiguration() {
156
+ const signConfig = this.platformSpecificBuildOptions.sign;
157
+ if (signConfig === null) {
158
+ return true;
159
+ }
160
+ const signOpts = isElectronSignOptions(signConfig) ? signConfig : undefined;
161
+ if (signConfig != null && signOpts == null) {
162
+ // a custom signer is called without an identity too
163
+ return false;
164
+ }
165
+ if (signOpts?.identity === null) {
166
+ return true;
167
+ }
168
+ return isEmptyOrSpaces(signOpts?.identity ?? process.env.CSC_NAME) && !isAutoDiscoveryCodeSignIdentity();
169
+ }
170
+ /** Whether `pack` builds the non-MAS app: unless every target is a MAS one. No target at all is a dir build. */
171
+ static packsNonMasApp(targets) {
172
+ // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS
173
+ // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because
174
+ // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.
175
+ return !targets.some(it => MacTargetHelper.isMasTarget(it.name)) || targets.length > 1;
71
176
  }
72
177
  get defaultTarget() {
73
178
  return this.info.framework.macOsDefaultTargets;
@@ -265,7 +370,7 @@ export class MacPackager extends PlatformPackager {
265
370
  .once("asar-integrity-digest-after-afterpack")
266
371
  .warn({ solution: "set mac.asarIntegrityDigest to false if your afterPack hook signs the app" }, "electron-builder v27 embeds the ASAR integrity digest into the Electron Framework after the afterPack hook and signs the framework again ad hoc, replacing a signature applied in afterPack. " +
267
372
  "Changing app.asar or Info.plist after afterPack now fails the app at launch when the enableEmbeddedAsarIntegrityValidation fuse is on. " +
268
- "See https://www.electron.build/docs/migration/v27-breaking-changes#macos-asar-integrity-digest");
373
+ "See https://www.electron.build/docs/migration/v27-runtime-changes#macos-asar-integrity-digest");
269
374
  }
270
375
  }
271
376
  /**
@@ -295,13 +400,9 @@ export class MacPackager extends PlatformPackager {
295
400
  const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name));
296
401
  const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name));
297
402
  const prepackaged = this.packagerOptions.prepackaged;
298
- const hasMas = masTargets.length > 0;
299
403
  // mas always first
300
404
  await this.packMasTargets(outDir, arch, masTargets, prepackaged);
301
- // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS
302
- // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because
303
- // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.
304
- if (!hasMas || targets.length > 1) {
405
+ if (MacPackager.packsNonMasApp(targets)) {
305
406
  await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager);
306
407
  }
307
408
  }
@@ -380,6 +481,9 @@ export class MacPackager extends PlatformPackager {
380
481
  targets,
381
482
  });
382
483
  }
484
+ else if (this.forceCodeSigning) {
485
+ await this.verifyPrepackagedApp(appPath);
486
+ }
383
487
  // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set
384
488
  if (await this.info.shouldSkipTargetsAfterPack({
385
489
  appOutDir: path.dirname(appPath),
@@ -393,6 +497,31 @@ export class MacPackager extends PlatformPackager {
393
497
  }
394
498
  this.packageInDistributableFormat(appPath, arch, targets, taskManager);
395
499
  }
500
+ /**
501
+ * electron-builder neither signs nor notarizes a prepackaged app, so under forceCodeSigning the app it packages must
502
+ * already carry a valid signature - and a stapled notarization ticket, unless `mac.notarize` is false.
503
+ */
504
+ async verifyPrepackagedApp(appPath) {
505
+ const unavailable = macSigningUnavailableError(`the prepackaged app ${log.filePath(appPath)}`, forceCodeSigningOverrideHint(this));
506
+ if (unavailable != null) {
507
+ throw unavailable;
508
+ }
509
+ const signConfig = this.platformSpecificBuildOptions.sign;
510
+ const problem = await verifyMacCodeSignature(appPath, { deep: true, strict: isElectronSignOptions(signConfig) ? signConfig.strictVerify : undefined });
511
+ if (problem != null) {
512
+ throw forceCodeSigningError(`forceCodeSigning is enabled, but the prepackaged app ${log.filePath(appPath)} has no valid code signature (codesign --verify --deep: ${problem}). ` +
513
+ "electron-builder does not sign a prepackaged app: sign it before packaging it.", VERIFICATION_FAILED_ERROR_CODE);
514
+ }
515
+ if (this.platformSpecificBuildOptions.notarize === false) {
516
+ log.warn({ file: log.filePath(appPath), reason: "`notarize` is set to false" }, "the notarization of the prepackaged app is not verified although forceCodeSigning is enabled");
517
+ return;
518
+ }
519
+ const ticketProblem = await validateStapledTicket(appPath);
520
+ if (ticketProblem != null) {
521
+ throw forceCodeSigningError(`forceCodeSigning is enabled, but the prepackaged app ${log.filePath(appPath)} has no valid stapled notarization ticket (stapler validate: ${ticketProblem}). ` +
522
+ "Notarize and staple it before packaging it, or set mac.notarize: false.", VERIFICATION_FAILED_ERROR_CODE);
523
+ }
524
+ }
396
525
  /**
397
526
  * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`
398
527
  * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).
@@ -409,6 +538,14 @@ export class MacPackager extends PlatformPackager {
409
538
  * (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.
410
539
  */
411
540
  async sign(appPath, arch, targetPlatform) {
541
+ const forceCodeSigning = this.forceCodeSigningFor(targetPlatform);
542
+ if (forceCodeSigning) {
543
+ // checked before isSignAllowed, which would log that signing is skipped right before this fails the build
544
+ const unavailable = macSigningUnavailableError(`the ${targetPlatform} app ${log.filePath(appPath)}`, this.forceCodeSigningOverrideHintFor(targetPlatform));
545
+ if (unavailable != null) {
546
+ throw unavailable;
547
+ }
548
+ }
412
549
  if (!isSignAllowed()) {
413
550
  // non-mac host, or the pull-request CI guard — signing cannot happen in this environment
414
551
  return "skipped:unsupported";
@@ -417,27 +554,46 @@ export class MacPackager extends PlatformPackager {
417
554
  const config = this.getPlatformConfig(targetPlatform).config.sign;
418
555
  // sign: null → user explicitly disabled signing
419
556
  if (config === null) {
420
- return this.helper.handleNullIdentity();
557
+ return this.helper.handleNullIdentity(targetPlatform);
421
558
  }
422
559
  const signOpts = isElectronSignOptions(config) ? config : undefined;
423
560
  // sign.identity: null → explicit skip; undefined → auto-discover
424
561
  const qualifier = signOpts?.identity;
425
562
  if (qualifier === null) {
426
- return this.helper.handleNullIdentity();
563
+ return this.helper.handleNullIdentity(targetPlatform);
427
564
  }
428
565
  const keychainFile = (await this.codeSigningInfo.value).keychainFile;
429
566
  // `config` is a custom fn/string module path when it's non-null and not an options object
430
567
  const hasCustomSign = config != null && !signOpts;
431
568
  const isMas = MacTargetHelper.isMasTarget(targetPlatform);
432
569
  const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts);
570
+ // A custom signer is called without a keychain identity too (a remote or HSM signer needs none); under forceCodeSigning
571
+ // its output is verified below. @electron/osx-sign needs one, and so does the installer of a MAS app (createMasInstaller), so
572
+ // a MAS app is only signed without one under forceCodeSigning, which fails on the missing installer identity instead.
433
573
  if (!identity) {
434
- return "skipped:no-certificate";
574
+ if (!hasCustomSign) {
575
+ return "skipped:no-certificate";
576
+ }
577
+ // mas-dev builds no installer, so its custom signer is called without an identity too
578
+ if (!forceCodeSigning && MacTargetHelper.shouldCreateMasInstaller(targetPlatform, undefined)) {
579
+ log.warn({ file: log.filePath(appPath), reason: "no keychain identity was found, and the MAS installer needs one" }, "the custom mac.sign signer is not called for the MAS app, which is left unsigned");
580
+ return "skipped:no-certificate";
581
+ }
582
+ log.info({ file: log.filePath(appPath), reason: "no keychain identity was found" }, "calling the custom mac.sign signer without an identity");
435
583
  }
436
584
  if (!isMacOsHighSierra()) {
437
585
  throw new InvalidConfigurationError("macOS High Sierra 10.13.6 is required to sign");
438
586
  }
439
587
  const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform, hasCustomSign);
440
588
  await this.doSign(signOptions, config, identity);
589
+ // @electron/osx-sign verifies the signatures it makes; a custom signer replaces it, so its output is checked here
590
+ if (hasCustomSign && forceCodeSigning) {
591
+ const problem = await verifyMacCodeSignature(appPath, { deep: true });
592
+ if (problem != null) {
593
+ throw forceCodeSigningError(`forceCodeSigning is enabled, but the custom mac.sign signer left ${log.filePath(appPath)} without a valid code signature (codesign --verify --deep --strict: ${problem}). ` +
594
+ "The signer must sign the app at configuration.app in place.", VERIFICATION_FAILED_ERROR_CODE);
595
+ }
596
+ }
441
597
  // now that everything is signed, flag binaries that still carry a foreign (or missing) signature and would
442
598
  // fail library validation at launch — the case the old blanket entitlements default used to mask
443
599
  if (!hasCustomSign) {
@@ -476,7 +632,7 @@ export class MacPackager extends PlatformPackager {
476
632
  const args = prepareProductBuildArgs(identity, keychain);
477
633
  args.push("--component", safeAppPath, "/Applications");
478
634
  args.push(safeOutFile);
479
- return await exec("productbuild", args);
635
+ return await exec(Executables.resolve("productbuild"), args);
480
636
  }
481
637
  getElectronSrcDir(dist) {
482
638
  return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName);