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

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 (217) hide show
  1. package/dist/asar/asarAlign.d.ts +35 -0
  2. package/dist/asar/asarAlign.d.ts.map +1 -0
  3. package/dist/asar/asarAlign.js +149 -0
  4. package/dist/asar/asarAlign.js.map +1 -0
  5. package/dist/asar/asarUtil.d.ts +15 -1
  6. package/dist/asar/asarUtil.d.ts.map +1 -1
  7. package/dist/asar/asarUtil.js +111 -61
  8. package/dist/asar/asarUtil.js.map +1 -1
  9. package/dist/codeSign/win/authenticodeSignature.d.ts +71 -0
  10. package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -0
  11. package/dist/codeSign/win/authenticodeSignature.js +241 -0
  12. package/dist/codeSign/win/authenticodeSignature.js.map +1 -0
  13. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +11 -0
  14. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  15. package/dist/codeSign/win/signtoolBaseSignManager.js +36 -16
  16. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  17. package/dist/codeSign/win/verifyUpdatePublisher.d.ts +25 -0
  18. package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -0
  19. package/dist/codeSign/win/verifyUpdatePublisher.js +98 -0
  20. package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -0
  21. package/dist/configuration.d.ts +16 -13
  22. package/dist/configuration.d.ts.map +1 -1
  23. package/dist/configuration.js.map +1 -1
  24. package/dist/electron/ElectronFramework.d.ts +15 -0
  25. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  26. package/dist/electron/ElectronFramework.js +33 -2
  27. package/dist/electron/ElectronFramework.js.map +1 -1
  28. package/dist/electron/mac/asarIntegrityDigest.d.ts +10 -0
  29. package/dist/electron/mac/asarIntegrityDigest.d.ts.map +1 -0
  30. package/dist/electron/mac/asarIntegrityDigest.js +122 -0
  31. package/dist/electron/mac/asarIntegrityDigest.js.map +1 -0
  32. package/dist/electron/mac/electronMac.js +1 -28
  33. package/dist/electron/mac/electronMac.js.map +1 -1
  34. package/dist/electron/mac/electronMacUtils.d.ts +8 -0
  35. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
  36. package/dist/electron/mac/electronMacUtils.js +36 -0
  37. package/dist/electron/mac/electronMacUtils.js.map +1 -1
  38. package/dist/fileMatcher.d.ts +47 -12
  39. package/dist/fileMatcher.d.ts.map +1 -1
  40. package/dist/fileMatcher.js +150 -45
  41. package/dist/fileMatcher.js.map +1 -1
  42. package/dist/forge-maker.d.ts +64 -0
  43. package/dist/forge-maker.d.ts.map +1 -1
  44. package/dist/forge-maker.js +104 -2
  45. package/dist/forge-maker.js.map +1 -1
  46. package/dist/index.d.ts +4 -4
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/indexInternal.d.ts +5 -3
  51. package/dist/indexInternal.d.ts.map +1 -1
  52. package/dist/indexInternal.js +5 -3
  53. package/dist/indexInternal.js.map +1 -1
  54. package/dist/macPackager.d.ts +6 -0
  55. package/dist/macPackager.d.ts.map +1 -1
  56. package/dist/macPackager.js +48 -2
  57. package/dist/macPackager.js.map +1 -1
  58. package/dist/options/FuseOptionsV1.d.ts +4 -0
  59. package/dist/options/FuseOptionsV1.d.ts.map +1 -1
  60. package/dist/options/FuseOptionsV1.js.map +1 -1
  61. package/dist/options/PlatformSpecificBuildOptions.d.ts +166 -8
  62. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  63. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  64. package/dist/options/SnapOptions.d.ts +36 -15
  65. package/dist/options/SnapOptions.d.ts.map +1 -1
  66. package/dist/options/SnapOptions.js.map +1 -1
  67. package/dist/options/linuxOptions.d.ts +53 -18
  68. package/dist/options/linuxOptions.d.ts.map +1 -1
  69. package/dist/options/linuxOptions.js.map +1 -1
  70. package/dist/options/macOptions.d.ts +15 -1
  71. package/dist/options/macOptions.d.ts.map +1 -1
  72. package/dist/options/macOptions.js.map +1 -1
  73. package/dist/options/winOptions.d.ts +7 -4
  74. package/dist/options/winOptions.d.ts.map +1 -1
  75. package/dist/options/winOptions.js.map +1 -1
  76. package/dist/packager.d.ts +2 -0
  77. package/dist/packager.d.ts.map +1 -1
  78. package/dist/packager.js +6 -0
  79. package/dist/packager.js.map +1 -1
  80. package/dist/platformPackager.d.ts +11 -4
  81. package/dist/platformPackager.d.ts.map +1 -1
  82. package/dist/platformPackager.js +53 -18
  83. package/dist/platformPackager.js.map +1 -1
  84. package/dist/presets/rectCra.js +3 -1
  85. package/dist/presets/rectCra.js.map +1 -1
  86. package/dist/publish/PublishManager.d.ts +6 -1
  87. package/dist/publish/PublishManager.d.ts.map +1 -1
  88. package/dist/publish/PublishManager.js +80 -58
  89. package/dist/publish/PublishManager.js.map +1 -1
  90. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  91. package/dist/publish/updateInfoBuilder.js +8 -10
  92. package/dist/publish/updateInfoBuilder.js.map +1 -1
  93. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  94. package/dist/targets/ArchiveTarget.js +7 -1
  95. package/dist/targets/ArchiveTarget.js.map +1 -1
  96. package/dist/targets/archive.d.ts +12 -0
  97. package/dist/targets/archive.d.ts.map +1 -1
  98. package/dist/targets/archive.js +17 -3
  99. package/dist/targets/archive.js.map +1 -1
  100. package/dist/targets/blockmap/blockmap.d.ts +3 -2
  101. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  102. package/dist/targets/blockmap/blockmap.js +3 -2
  103. package/dist/targets/blockmap/blockmap.js.map +1 -1
  104. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  105. package/dist/targets/differentialUpdateInfoBuilder.js +4 -0
  106. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  107. package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
  108. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  109. package/dist/targets/linux/FlatpakTarget.js +238 -48
  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 -14
  113. package/dist/targets/linux/FpmTarget.js.map +1 -1
  114. package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -3
  115. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  116. package/dist/targets/linux/LinuxTargetHelper.js +45 -20
  117. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  118. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  119. package/dist/targets/linux/appimage/AppImageTarget.js +5 -1
  120. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  121. package/dist/targets/linux/appimage/appImageUtil.d.ts +3 -1
  122. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  123. package/dist/targets/linux/appimage/appImageUtil.js +2 -2
  124. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  125. package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
  126. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  127. package/dist/targets/linux/appimage/appLauncher.js +13 -9
  128. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  129. package/dist/targets/linux/flatpakBundle.d.ts +43 -0
  130. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
  131. package/dist/targets/linux/flatpakBundle.js +210 -0
  132. package/dist/targets/linux/flatpakBundle.js.map +1 -0
  133. package/dist/targets/linux/snap/core24.d.ts +0 -18
  134. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  135. package/dist/targets/linux/snap/core24.js +29 -100
  136. package/dist/targets/linux/snap/core24.js.map +1 -1
  137. package/dist/targets/linux/snap/coreLegacy.d.ts +7 -0
  138. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  139. package/dist/targets/linux/snap/coreLegacy.js +25 -6
  140. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  141. package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
  142. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
  143. package/dist/targets/linux/snap/snapPlugs.js +242 -0
  144. package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
  145. package/dist/targets/mac/MacTargetHelper.d.ts +6 -0
  146. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  147. package/dist/targets/mac/MacTargetHelper.js +47 -3
  148. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  149. package/dist/targets/mac/pkg.d.ts.map +1 -1
  150. package/dist/targets/mac/pkg.js +1 -0
  151. package/dist/targets/mac/pkg.js.map +1 -1
  152. package/dist/targets/win/nsis/Defines.d.ts +1 -0
  153. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  154. package/dist/targets/win/nsis/Defines.js.map +1 -1
  155. package/dist/targets/win/nsis/NsisTarget.d.ts +8 -1
  156. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  157. package/dist/targets/win/nsis/NsisTarget.js +36 -5
  158. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  159. package/dist/targets/win/nsis/nsisOptions.d.ts +6 -4
  160. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  161. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  162. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  163. package/dist/targets/win/nsis/nsisUtil.js +7 -2
  164. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  165. package/dist/targets/win/winAppUtil.d.ts +2 -2
  166. package/dist/targets/win/winAppUtil.d.ts.map +1 -1
  167. package/dist/targets/win/winAppUtil.js +5 -3
  168. package/dist/targets/win/winAppUtil.js.map +1 -1
  169. package/dist/toolsets/appimage.d.ts.map +1 -1
  170. package/dist/toolsets/appimage.js +19 -19
  171. package/dist/toolsets/appimage.js.map +1 -1
  172. package/dist/toolsets/nsis.js +1 -1
  173. package/dist/toolsets/nsis.js.map +1 -1
  174. package/dist/toolsets/winCodeSign.d.ts +14 -1
  175. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  176. package/dist/toolsets/winCodeSign.js +14 -1
  177. package/dist/toolsets/winCodeSign.js.map +1 -1
  178. package/dist/util/AppFileWalker.js +9 -1
  179. package/dist/util/AppFileWalker.js.map +1 -1
  180. package/dist/util/appFileCopier.d.ts +15 -2
  181. package/dist/util/appFileCopier.d.ts.map +1 -1
  182. package/dist/util/appFileCopier.js +30 -20
  183. package/dist/util/appFileCopier.js.map +1 -1
  184. package/dist/util/config/config.d.ts +1 -1
  185. package/dist/util/config/config.d.ts.map +1 -1
  186. package/dist/util/config/config.js +42 -19
  187. package/dist/util/config/config.js.map +1 -1
  188. package/dist/util/config/fileOptions.d.ts +52 -0
  189. package/dist/util/config/fileOptions.d.ts.map +1 -0
  190. package/dist/util/config/fileOptions.js +210 -0
  191. package/dist/util/config/fileOptions.js.map +1 -0
  192. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
  193. package/dist/util/config/legacyConfigGuard.js +31 -4
  194. package/dist/util/config/legacyConfigGuard.js.map +1 -1
  195. package/dist/util/config/legacyOptions.d.ts +11 -0
  196. package/dist/util/config/legacyOptions.d.ts.map +1 -1
  197. package/dist/util/config/legacyOptions.js +36 -10
  198. package/dist/util/config/legacyOptions.js.map +1 -1
  199. package/dist/util/electronGet.d.ts +13 -0
  200. package/dist/util/electronGet.d.ts.map +1 -1
  201. package/dist/util/electronGet.js +40 -17
  202. package/dist/util/electronGet.js.map +1 -1
  203. package/dist/util/removedEnvVars.d.ts +25 -0
  204. package/dist/util/removedEnvVars.d.ts.map +1 -0
  205. package/dist/util/removedEnvVars.js +54 -0
  206. package/dist/util/removedEnvVars.js.map +1 -0
  207. package/dist/util/trustedSourceRoots.d.ts +59 -0
  208. package/dist/util/trustedSourceRoots.d.ts.map +1 -0
  209. package/dist/util/trustedSourceRoots.js +127 -0
  210. package/dist/util/trustedSourceRoots.js.map +1 -0
  211. package/dist/version.d.ts +1 -1
  212. package/dist/version.js +1 -1
  213. package/dist/version.js.map +1 -1
  214. package/package.json +18 -17
  215. package/scheme.json +421 -436
  216. package/templates/nsis/include/installer.nsh +11 -8
  217. package/templates/nsis/installSection.nsh +5 -0
@@ -1 +1 @@
1
- {"version":3,"file":"winCodeSign.d.ts","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAA;AAMjE,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAU1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DvB,CAAA;AAaV,wBAAsB,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAOlJ;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE;;;GAevJ;AAED,wBAAgB,SAAS,YAGxB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,GAAG,OAAO,CAEhG;AA2DD,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW1E;AAED,wBAAsB,mBAA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E;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,EAAE,YAAY,SAAK;;;GAgB3G"}
@@ -6,7 +6,7 @@ import { downloadBuilderToolset } from "../util/electronGet.js";
6
6
  import { getCustomToolsetPath } from "./custom.js";
7
7
  import { resolveToolsetVersion } from "./version.js";
8
8
  // Newest win-codesign bundle — selected when the config is unset / null / "latest".
9
- export const WIN_CODESIGN_LATEST = "1.3.0";
9
+ export const WIN_CODESIGN_LATEST = "1.3.1";
10
10
  function getLegacyWinCodeSignBin() {
11
11
  return downloadBuilderToolset({
12
12
  releaseName: "winCodeSign-2.6.0",
@@ -72,6 +72,19 @@ export const wincodesignChecksums = {
72
72
  "win-codesign-windows-x64.zip": "40d621aad7593e6298ce1d24798760dcefb053f358be891d74c95386ac2ac50b",
73
73
  "windows-kits-bundle-10_0_26100_0.zip": "2eeb955e580103e1bbecf9666dca87b141c3bb73ad99ead64bb8821755694ecd",
74
74
  },
75
+ "1.3.1": {
76
+ "ats-bundle-1_0_95.zip": "233230cefef263e2c9cc03e8c480bd8dcfe7ff3518e3c591dbb24fc21c1370e7",
77
+ "dotnet-runtime-win-x64-8_0_28.zip": "9de4bdfdf33d98afb73947a8c013eb1511af0d6e1051bfc4921fbe2d34426308",
78
+ "rcedit-windows-2_0_0.zip": "eb975970b1295a960ba5d428693f9aa548fc00b16ae441fb8cc97abedb7cb4b9",
79
+ "win-codesign-darwin-arm64.zip": "cda6c58a81fd86c4a5474c2da2d1b450b40805b3eef6974f5a6a3af7ece2b811",
80
+ "win-codesign-darwin-x86_64.zip": "9e07f6f7a4fd096b868e8cf2d6f06f50d9decf03fcbf6b39d3045688ccddb1f5",
81
+ "win-codesign-linux-amd64.zip": "8443dfd4acf811b2d7eb8420fdd500c07058f507cc65ee9a6b215f833acba659",
82
+ "win-codesign-linux-arm64.zip": "f7f287533cb302f4230960a3b2915ec5ae165f0089ddacf1940d8aa44c049fa6",
83
+ "win-codesign-linux-i386.zip": "45649f83d9378d39123620982fd7fe15cc9ba4fb8f4009fb697f03ff02f06545",
84
+ "win-codesign-windows-arm64.zip": "9daee4e5359371d8566639be70251abebe6ddbed82054e2ecd1812bd0d879291",
85
+ "win-codesign-windows-x64.zip": "830167112badff1bd5bf4759e0bac4d9f45a96c0cbb9b8e72e1f70187758516a",
86
+ "windows-kits-bundle-10_0_26100_0.zip": "6a8a6211f02c0cd09118710e4a48ee411bd3cb2dbb8bd25cbd5f9e4afd9f556d",
87
+ },
75
88
  };
76
89
  function _getWindowsToolsBin(winCodeSign, file) {
77
90
  const filenameWithExt = file;
@@ -1 +1 @@
1
- {"version":3,"file":"winCodeSign.js","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAY,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAA;AAE1C,SAAS,uBAAuB;IAC9B,OAAO,sBAAsB,CAAC;QAC5B,WAAW,EAAE,mBAAmB;QAChC,eAAe,EAAE,sBAAsB;QACvC,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,EAAE,kEAAkE,EAAE;KAC5G,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE;IACP,qEAAqE;KACtE;IACD,OAAO,EAAE;QACP,0BAA0B,EAAE,kEAAkE;QAC9F,+BAA+B,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GAAG,GAAG,gBAAgB,CAAA;IAC5B,MAAM,GAAG,GAAG,gBAAgB,CAAA;IAC5B,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QAC3D,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,oBAAoB,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,YAAY,IAAI,SAAS,CAAC,CAAA;QACpH,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;IAC7E,CAAC;IACD,MAAM,OAAO,GAAG,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAA;IACvE,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,uBAAuB,EAAE,CAAC,CAAA;QACnE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;IAC9E,CAAC;IACD,MAAM,IAAI,GAAG,0BAA0B,CAAA;IACvC,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAC5E,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;AAC7E,CAAC","sourcesContent":["import { InvalidConfigurationError, sanitizeDirPath } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo, computeToolEnv } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest win-codesign bundle — selected when the config is unset / null / \"latest\".\nexport const WIN_CODESIGN_LATEST = \"1.3.0\"\n\nfunction getLegacyWinCodeSignBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"winCodeSign-2.6.0\",\n filenameWithExt: \"winCodeSign-2.6.0.7z\",\n checksums: { [\"winCodeSign-2.6.0.7z\"]: \"cdaec7154dda7cc31f88d886e2489379a0625a737d610b5ae7f62a12f16743a4\" },\n })\n}\n\nexport const wincodesignChecksums = {\n \"0.0.0\": {\n // legacy — downloads winCodeSign-2.6.0 via getLegacyWinCodeSignBin()\n },\n \"1.0.0\": {\n \"rcedit-windows-2_0_0.zip\": \"589709935902545a8335190b08644cf61b46a9042e34c0c3ef0660a5aeddeaae\",\n \"win-codesign-darwin-arm64.zip\": \"7eb41c3e6e48a75ced6b3384de22185da4bb458960fa410970eedd4e838c5c14\",\n \"win-codesign-darwin-x86_64.zip\": \"3986c97429f002df63490193d7f787281836f055934e3cdd9e69c70a8acb695e\",\n \"win-codesign-linux-amd64.zip\": \"d362a1a981053841554867e3e9dff51fe420fd577b44653df89bd7d3c916b156\",\n \"win-codesign-linux-arm64.zip\": \"fb848d498281f081c937be48dd6ddaf49b0201f32210dfc816ad061c47ecd37b\",\n \"win-codesign-linux-i386.zip\": \"11f8d9ffbf5b01e3bf6321c6d93b9b5e43d0c2d2a9fde1bca07698f2eb967cdf\",\n \"win-codesign-windows-x64.zip\": \"1bd27f9fa553cb14bec8df530cb3caffcfb095f9dd187dab6eaf5e9b7d6e7bff\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"1a12c81024c3499c212fdc5fac34a918e6d199271a39dfc524f6d8da484329bd\",\n },\n \"1.1.0\": {\n \"rcedit-windows-2_0_0.zip\": \"c66591ebe0919c60231f0bf79ff223e6504bfa69bc13edc1fa8bfc6177b73402\",\n \"win-codesign-darwin-arm64.zip\": \"3f263b0e53cdc5410f6165471b2e808aee3148dc792efa23a7c303e7a01e67b7\",\n \"win-codesign-darwin-x86_64.zip\": \"143fbdfcbc53bc273fa181356be8416829778452621484d39eadbe1ce49979ba\",\n \"win-codesign-linux-amd64.zip\": \"65477fe8e40709b0f998928afb8336f82413b123310bf5adaa8efb7ed6ed0eeb\",\n \"win-codesign-linux-arm64.zip\": \"575b01a966f2b775bbea119de263957378e2bd28cbd064d35f9e981827e37b59\",\n \"win-codesign-linux-i386.zip\": \"aa3ce90e9aaa3449a228a3fa30633cdeb6b2791913786677a85c59db1d985598\",\n \"win-codesign-windows-x64.zip\": \"6e5dcc5d7af7c00a7387e2101d1ad986aef80e963a3526da07bd0e65de484c30\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"284f18a2fde66e6ecfbefc3065926c9bfdf641761a9e6cd2bd26e18d1e328bf7\",\n },\n \"1.1.1\": {\n \"rcedit-windows-2_0_0.zip\": \"a4133c265a53a8a6d5063c6d92603dc2dcd47546e50bfd79c93bc56692d6fcb3\",\n \"win-codesign-darwin-arm64.zip\": \"8c655fe77edb326fb6b7051a6f74b0f09843f7d3de7887c1d217088cff47ece6\",\n \"win-codesign-darwin-x86_64.zip\": \"b5882783c910e10b18792ea8c319fa8d6ce9dbbdd0d6a283a504787b3e9e96c6\",\n \"win-codesign-linux-amd64.zip\": \"8e0c05c33b3fb24d41ac41d37b0c70ad9f8c1c82bb667ed60c2a6a8d141b7c62\",\n \"win-codesign-linux-arm64.zip\": \"535f318b8aac1c9487e0f8b58df0a4182103e303ccaca1c9d0ef20b1020e03ca\",\n \"win-codesign-linux-i386.zip\": \"e432f2819f557f9d1175e26f374eec8a368eb23b519c12c690a969ce369966c5\",\n \"win-codesign-windows-x64.zip\": \"47d78ed7e229e891866b0d0e10dde6df9617c32a89fc76a9e280ffabfc80e1fe\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"f7e67213ce690386b2f0a58e3af986dbf223bc1b45ef4a75e77ff85f66b78c94\",\n },\n \"1.2.1\": {\n \"rcedit-windows-2_0_0.zip\": \"1c2b68b9ae41229566c008ce98c4f6cd2b642ace85284e753d1d3509377f9e67\",\n \"win-codesign-darwin-arm64.zip\": \"ac7c1d9279490fc88e9e744ed965ad7e1d377e0219142dab0ab49cfba3ede764\",\n \"win-codesign-darwin-x86_64.zip\": \"7c4188bb301621cde22f918bb2d1a86ef9892ad401a40b7838b80efc9165547d\",\n \"win-codesign-linux-amd64.zip\": \"69b94f71f9189ded6b962718df102e0ffe0a81d506351fecd3df3d73c7166e31\",\n \"win-codesign-linux-arm64.zip\": \"c959031605a5ab994bfd9b84d37bc5bcaba8f39d54a6d69bd2541b2a91ecf723\",\n \"win-codesign-linux-i386.zip\": \"fc937f40655b9839b67ed35cc7b571795b3f7b7b15db10c3026599db43f1c2b1\",\n \"win-codesign-windows-arm64.zip\": \"96390eb3130e63ea9d3641ef076c941c6f51463125498cf53b2503e52c38082d\",\n \"win-codesign-windows-x64.zip\": \"40b1d88ea074de58ddc7595a2b6d30ca23f81bcce33f110102304337538fcbeb\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"9b198db76ae75b124169aef3369fb96c17b39dbf16f16f1264dbd9fd001d976f\",\n },\n \"1.3.0\": {\n \"ats-bundle-1_0_95.zip\": \"93e1441cd8c60f7b7a57a3e0e20a2109994e33a7f42bd04c998204a1928f9f2f\", // new\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"71b9aa960ebaae196a62ec0bb1a4d224e1b48e18b6dc5eed89a37b28b72965ee\", // new\n \"rcedit-windows-2_0_0.zip\": \"84ea279c5d94977fecffbe0f21b073318575dc631a3dae46fadb14309f2eef11\",\n \"win-codesign-darwin-arm64.zip\": \"c5c1e1e106a5feff27d320c57856e362d8f605c09c7c02fc42d9309b72c56372\",\n \"win-codesign-darwin-x86_64.zip\": \"4fd5af2c4c655257685fad1769457419e086ec0862ee36f893b3659e1788c8ca\",\n \"win-codesign-linux-amd64.zip\": \"58c708762b3088a2c6c98494c4813e2a1d030a314a7958c77a2806d58e5efe95\",\n \"win-codesign-linux-arm64.zip\": \"1e9dd1ae149a4e0c988b5529fb983d7a8265cd71e7f3fb5af4cce501005a670c\",\n \"win-codesign-linux-i386.zip\": \"b5c3249fb565bb956a48aaff01bc1bbbd9acaf3c981960f2b754210f9df95cd9\",\n \"win-codesign-windows-arm64.zip\": \"c707709440a07e400b4053d9bab77c9f335505c1701035c2aa8285d880360989\",\n \"win-codesign-windows-x64.zip\": \"40d621aad7593e6298ce1d24798760dcefb053f358be891d74c95386ac2ac50b\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"2eeb955e580103e1bbecf9666dca87b141c3bb73ad99ead64bb8821755694ecd\",\n },\n} as const\n\ntype CodeSignVersionKey = keyof typeof wincodesignChecksums\n\nfunction _getWindowsToolsBin<V extends CodeSignVersionKey>(winCodeSign: V, file: keyof (typeof wincodesignChecksums)[V]): Promise<string> {\n const filenameWithExt = file as string\n return downloadBuilderToolset({\n releaseName: `win-codesign@${winCodeSign}`,\n filenameWithExt,\n checksums: { [filenameWithExt]: wincodesignChecksums[winCodeSign][file] as string },\n })\n}\n\nexport async function getSignToolPath(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, isWin: boolean, resourcesDir: string): Promise<ToolInfo> {\n if (isWin) {\n return { path: await getWindowsSignToolExe({ winCodeSign, resourcesDir }) }\n } else {\n const vendor = await getOsslSigncodeBundle(winCodeSign, resourcesDir)\n return { path: vendor.path, env: vendor.env }\n }\n}\n\n/**\n * Resolve the Windows Kits bundle paths.\n *\n * The `kit` subdirectory holds HOST executables (`signtool.exe` / `makeappx.exe` / `makepri.exe`), so\n * it is always the x64 kit (x86 on 32-bit hosts) — never arm64. x64 binaries run on x64 hosts natively\n * and on arm64 Windows via emulation, whereas an arm64 binary cannot run on an x64 host and fails with\n * `spawn UNKNOWN`. The artifact's target arch is irrelevant here.\n * `appxAssets` is arch-independent (the bundle root).\n */\nexport async function getWindowsKitsBundle({ winCodeSign, resourcesDir }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n const kitArch = process.arch === \"ia32\" ? \"x86\" : \"x64\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { kit: path.join(vendorPath, \"windows-10\", kitArch), appxAssets: vendorPath }\n }\n const file = \"windows-kits-bundle-10_0_26100_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n}\n\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\n/**\n * True only for the explicit legacy winCodeSign pin (`\"0.0.0\"` → winCodeSign-2.6.0). That bundle lacks\n * the modern Windows Kits SDK (no MSIX-capable `makeappx`/`makepri`), so it cannot build MSIX — only the\n * MSIX target gates on this. AppX still builds fine with the legacy bundle (it has its own legacy-bundle\n * `signtool` handling in `getWindowsSignToolExe`). Unset / `null` / `\"latest\"` and any modern version pin\n * resolve to a modern bundle; a custom `{ url, … }` toolset is the caller's responsibility and is not\n * treated as legacy.\n */\nexport function isLegacyWinCodeSign(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish): boolean {\n return typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\"\n}\n\nasync function getWindowsSignToolExe({ winCodeSign, resourcesDir = \"\" }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n if (typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n } else {\n return path.join(vendorPath, \"windows-10\", process.arch === \"ia32\" ? \"ia32\" : \"x64\", \"signtool.exe\")\n }\n }\n // kit is already sanitized by getWindowsKitsBundle\n const { kit } = await getWindowsKitsBundle({ winCodeSign, resourcesDir })\n return path.join(kit, \"signtool.exe\")\n}\n\nasync function getOsslSigncodeBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n // A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { path: path.join(vendorPath, \"osslsigncode\") }\n }\n\n if (process.platform === \"win32\") {\n // Unreachable in normal flow: osslsigncode is only requested when the host is not Windows (Windows signs via\n // signtool). Kept as defense-in-depth — fail loudly instead of resolving a bare `osslsigncode` from $PATH.\n throw new InvalidConfigurationError(\n `osslsigncode is not used on Windows (signing uses signtool). To override, configure a custom toolset: toolsets: { winCodeSign: { url: \"file:///absolute/path/to/dir\" } }`\n )\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const legacyBase = sanitizeDirPath(await getLegacyWinCodeSignBin())\n const vendorBase = path.join(legacyBase, process.platform)\n const vendorPath = process.platform === \"darwin\" ? path.join(vendorBase, \"10.12\") : vendorBase\n return { path: path.join(vendorPath, \"osslsigncode\"), env: process.platform === \"darwin\" ? computeToolEnv([path.join(vendorPath, \"lib\")]) : undefined }\n }\n\n const file = (() => {\n if (process.platform === \"linux\") {\n if (process.arch == \"x64\") {\n return \"win-codesign-linux-amd64.zip\"\n } else if (process.arch === \"arm64\") {\n return \"win-codesign-linux-arm64.zip\"\n }\n return \"win-codesign-linux-i386.zip\"\n }\n // darwin arm64\n if (process.arch === \"arm64\") {\n return \"win-codesign-darwin-arm64.zip\"\n }\n return \"win-codesign-darwin-x86_64.zip\"\n })()\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { path: path.join(vendorPath, \"osslsigncode\") }\n}\n\nexport async function getAtsBundleDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"ats-bundle-1_0_95.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include an ATS bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"ats-bundle-1_0_95.zip\",\n checksums: { \"ats-bundle-1_0_95.zip\": checksum },\n })\n}\n\nexport async function getDotnetRuntimeDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"dotnet-runtime-win-x64-8_0_28.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include a .NET runtime bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"dotnet-runtime-win-x64-8_0_28.zip\",\n checksums: { \"dotnet-runtime-win-x64-8_0_28.zip\": checksum },\n })\n}\n\nexport async function getRceditBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n const ia32 = \"rcedit-ia32.exe\"\n const x86 = \"rcedit-x86.exe\"\n const x64 = \"rcedit-x64.exe\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n }\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { x86: path.join(vendorPath, ia32), x64: path.join(vendorPath, x64) }\n }\n const file = \"rcedit-windows-2_0_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n}\n"]}
1
+ {"version":3,"file":"winCodeSign.js","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAY,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAA;AAE1C,SAAS,uBAAuB;IAC9B,OAAO,sBAAsB,CAAC;QAC5B,WAAW,EAAE,mBAAmB;QAChC,eAAe,EAAE,sBAAsB;QACvC,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,EAAE,kEAAkE,EAAE;KAC5G,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE;IACP,qEAAqE;KACtE;IACD,OAAO,EAAE;QACP,0BAA0B,EAAE,kEAAkE;QAC9F,+BAA+B,EAAE,kEAAkE;QACnG,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AC5E,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,CAAA;AAC7E,CAAC","sourcesContent":["import { InvalidConfigurationError, sanitizeDirPath } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo, computeToolEnv } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest win-codesign bundle — selected when the config is unset / null / \"latest\".\nexport const WIN_CODESIGN_LATEST = \"1.3.1\"\n\nfunction getLegacyWinCodeSignBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"winCodeSign-2.6.0\",\n filenameWithExt: \"winCodeSign-2.6.0.7z\",\n checksums: { [\"winCodeSign-2.6.0.7z\"]: \"cdaec7154dda7cc31f88d886e2489379a0625a737d610b5ae7f62a12f16743a4\" },\n })\n}\n\nexport const wincodesignChecksums = {\n \"0.0.0\": {\n // legacy — downloads winCodeSign-2.6.0 via getLegacyWinCodeSignBin()\n },\n \"1.0.0\": {\n \"rcedit-windows-2_0_0.zip\": \"589709935902545a8335190b08644cf61b46a9042e34c0c3ef0660a5aeddeaae\",\n \"win-codesign-darwin-arm64.zip\": \"7eb41c3e6e48a75ced6b3384de22185da4bb458960fa410970eedd4e838c5c14\",\n \"win-codesign-darwin-x86_64.zip\": \"3986c97429f002df63490193d7f787281836f055934e3cdd9e69c70a8acb695e\",\n \"win-codesign-linux-amd64.zip\": \"d362a1a981053841554867e3e9dff51fe420fd577b44653df89bd7d3c916b156\",\n \"win-codesign-linux-arm64.zip\": \"fb848d498281f081c937be48dd6ddaf49b0201f32210dfc816ad061c47ecd37b\",\n \"win-codesign-linux-i386.zip\": \"11f8d9ffbf5b01e3bf6321c6d93b9b5e43d0c2d2a9fde1bca07698f2eb967cdf\",\n \"win-codesign-windows-x64.zip\": \"1bd27f9fa553cb14bec8df530cb3caffcfb095f9dd187dab6eaf5e9b7d6e7bff\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"1a12c81024c3499c212fdc5fac34a918e6d199271a39dfc524f6d8da484329bd\",\n },\n \"1.1.0\": {\n \"rcedit-windows-2_0_0.zip\": \"c66591ebe0919c60231f0bf79ff223e6504bfa69bc13edc1fa8bfc6177b73402\",\n \"win-codesign-darwin-arm64.zip\": \"3f263b0e53cdc5410f6165471b2e808aee3148dc792efa23a7c303e7a01e67b7\",\n \"win-codesign-darwin-x86_64.zip\": \"143fbdfcbc53bc273fa181356be8416829778452621484d39eadbe1ce49979ba\",\n \"win-codesign-linux-amd64.zip\": \"65477fe8e40709b0f998928afb8336f82413b123310bf5adaa8efb7ed6ed0eeb\",\n \"win-codesign-linux-arm64.zip\": \"575b01a966f2b775bbea119de263957378e2bd28cbd064d35f9e981827e37b59\",\n \"win-codesign-linux-i386.zip\": \"aa3ce90e9aaa3449a228a3fa30633cdeb6b2791913786677a85c59db1d985598\",\n \"win-codesign-windows-x64.zip\": \"6e5dcc5d7af7c00a7387e2101d1ad986aef80e963a3526da07bd0e65de484c30\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"284f18a2fde66e6ecfbefc3065926c9bfdf641761a9e6cd2bd26e18d1e328bf7\",\n },\n \"1.1.1\": {\n \"rcedit-windows-2_0_0.zip\": \"a4133c265a53a8a6d5063c6d92603dc2dcd47546e50bfd79c93bc56692d6fcb3\",\n \"win-codesign-darwin-arm64.zip\": \"8c655fe77edb326fb6b7051a6f74b0f09843f7d3de7887c1d217088cff47ece6\",\n \"win-codesign-darwin-x86_64.zip\": \"b5882783c910e10b18792ea8c319fa8d6ce9dbbdd0d6a283a504787b3e9e96c6\",\n \"win-codesign-linux-amd64.zip\": \"8e0c05c33b3fb24d41ac41d37b0c70ad9f8c1c82bb667ed60c2a6a8d141b7c62\",\n \"win-codesign-linux-arm64.zip\": \"535f318b8aac1c9487e0f8b58df0a4182103e303ccaca1c9d0ef20b1020e03ca\",\n \"win-codesign-linux-i386.zip\": \"e432f2819f557f9d1175e26f374eec8a368eb23b519c12c690a969ce369966c5\",\n \"win-codesign-windows-x64.zip\": \"47d78ed7e229e891866b0d0e10dde6df9617c32a89fc76a9e280ffabfc80e1fe\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"f7e67213ce690386b2f0a58e3af986dbf223bc1b45ef4a75e77ff85f66b78c94\",\n },\n \"1.2.1\": {\n \"rcedit-windows-2_0_0.zip\": \"1c2b68b9ae41229566c008ce98c4f6cd2b642ace85284e753d1d3509377f9e67\",\n \"win-codesign-darwin-arm64.zip\": \"ac7c1d9279490fc88e9e744ed965ad7e1d377e0219142dab0ab49cfba3ede764\",\n \"win-codesign-darwin-x86_64.zip\": \"7c4188bb301621cde22f918bb2d1a86ef9892ad401a40b7838b80efc9165547d\",\n \"win-codesign-linux-amd64.zip\": \"69b94f71f9189ded6b962718df102e0ffe0a81d506351fecd3df3d73c7166e31\",\n \"win-codesign-linux-arm64.zip\": \"c959031605a5ab994bfd9b84d37bc5bcaba8f39d54a6d69bd2541b2a91ecf723\",\n \"win-codesign-linux-i386.zip\": \"fc937f40655b9839b67ed35cc7b571795b3f7b7b15db10c3026599db43f1c2b1\",\n \"win-codesign-windows-arm64.zip\": \"96390eb3130e63ea9d3641ef076c941c6f51463125498cf53b2503e52c38082d\",\n \"win-codesign-windows-x64.zip\": \"40b1d88ea074de58ddc7595a2b6d30ca23f81bcce33f110102304337538fcbeb\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"9b198db76ae75b124169aef3369fb96c17b39dbf16f16f1264dbd9fd001d976f\",\n },\n \"1.3.0\": {\n \"ats-bundle-1_0_95.zip\": \"93e1441cd8c60f7b7a57a3e0e20a2109994e33a7f42bd04c998204a1928f9f2f\", // new\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"71b9aa960ebaae196a62ec0bb1a4d224e1b48e18b6dc5eed89a37b28b72965ee\", // new\n \"rcedit-windows-2_0_0.zip\": \"84ea279c5d94977fecffbe0f21b073318575dc631a3dae46fadb14309f2eef11\",\n \"win-codesign-darwin-arm64.zip\": \"c5c1e1e106a5feff27d320c57856e362d8f605c09c7c02fc42d9309b72c56372\",\n \"win-codesign-darwin-x86_64.zip\": \"4fd5af2c4c655257685fad1769457419e086ec0862ee36f893b3659e1788c8ca\",\n \"win-codesign-linux-amd64.zip\": \"58c708762b3088a2c6c98494c4813e2a1d030a314a7958c77a2806d58e5efe95\",\n \"win-codesign-linux-arm64.zip\": \"1e9dd1ae149a4e0c988b5529fb983d7a8265cd71e7f3fb5af4cce501005a670c\",\n \"win-codesign-linux-i386.zip\": \"b5c3249fb565bb956a48aaff01bc1bbbd9acaf3c981960f2b754210f9df95cd9\",\n \"win-codesign-windows-arm64.zip\": \"c707709440a07e400b4053d9bab77c9f335505c1701035c2aa8285d880360989\",\n \"win-codesign-windows-x64.zip\": \"40d621aad7593e6298ce1d24798760dcefb053f358be891d74c95386ac2ac50b\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"2eeb955e580103e1bbecf9666dca87b141c3bb73ad99ead64bb8821755694ecd\",\n },\n \"1.3.1\": {\n \"ats-bundle-1_0_95.zip\": \"233230cefef263e2c9cc03e8c480bd8dcfe7ff3518e3c591dbb24fc21c1370e7\",\n \"dotnet-runtime-win-x64-8_0_28.zip\": \"9de4bdfdf33d98afb73947a8c013eb1511af0d6e1051bfc4921fbe2d34426308\",\n \"rcedit-windows-2_0_0.zip\": \"eb975970b1295a960ba5d428693f9aa548fc00b16ae441fb8cc97abedb7cb4b9\",\n \"win-codesign-darwin-arm64.zip\": \"cda6c58a81fd86c4a5474c2da2d1b450b40805b3eef6974f5a6a3af7ece2b811\",\n \"win-codesign-darwin-x86_64.zip\": \"9e07f6f7a4fd096b868e8cf2d6f06f50d9decf03fcbf6b39d3045688ccddb1f5\",\n \"win-codesign-linux-amd64.zip\": \"8443dfd4acf811b2d7eb8420fdd500c07058f507cc65ee9a6b215f833acba659\",\n \"win-codesign-linux-arm64.zip\": \"f7f287533cb302f4230960a3b2915ec5ae165f0089ddacf1940d8aa44c049fa6\",\n \"win-codesign-linux-i386.zip\": \"45649f83d9378d39123620982fd7fe15cc9ba4fb8f4009fb697f03ff02f06545\",\n \"win-codesign-windows-arm64.zip\": \"9daee4e5359371d8566639be70251abebe6ddbed82054e2ecd1812bd0d879291\",\n \"win-codesign-windows-x64.zip\": \"830167112badff1bd5bf4759e0bac4d9f45a96c0cbb9b8e72e1f70187758516a\",\n \"windows-kits-bundle-10_0_26100_0.zip\": \"6a8a6211f02c0cd09118710e4a48ee411bd3cb2dbb8bd25cbd5f9e4afd9f556d\",\n },\n} as const\n\ntype CodeSignVersionKey = keyof typeof wincodesignChecksums\n\nfunction _getWindowsToolsBin<V extends CodeSignVersionKey>(winCodeSign: V, file: keyof (typeof wincodesignChecksums)[V]): Promise<string> {\n const filenameWithExt = file as string\n return downloadBuilderToolset({\n releaseName: `win-codesign@${winCodeSign}`,\n filenameWithExt,\n checksums: { [filenameWithExt]: wincodesignChecksums[winCodeSign][file] as string },\n })\n}\n\nexport async function getSignToolPath(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, isWin: boolean, resourcesDir: string): Promise<ToolInfo> {\n if (isWin) {\n return { path: await getWindowsSignToolExe({ winCodeSign, resourcesDir }) }\n } else {\n const vendor = await getOsslSigncodeBundle(winCodeSign, resourcesDir)\n return { path: vendor.path, env: vendor.env }\n }\n}\n\n/**\n * Resolve the Windows Kits bundle paths.\n *\n * The `kit` subdirectory holds HOST executables (`signtool.exe` / `makeappx.exe` / `makepri.exe`), so\n * it is always the x64 kit (x86 on 32-bit hosts) — never arm64. x64 binaries run on x64 hosts natively\n * and on arm64 Windows via emulation, whereas an arm64 binary cannot run on an x64 host and fails with\n * `spawn UNKNOWN`. The artifact's target arch is irrelevant here.\n * `appxAssets` is arch-independent (the bundle root).\n */\nexport async function getWindowsKitsBundle({ winCodeSign, resourcesDir }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n const kitArch = process.arch === \"ia32\" ? \"x86\" : \"x64\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { kit: path.join(vendorPath, \"windows-10\", kitArch), appxAssets: vendorPath }\n }\n const file = \"windows-kits-bundle-10_0_26100_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath }\n}\n\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\n/**\n * True only for the explicit legacy winCodeSign pin (`\"0.0.0\"` → winCodeSign-2.6.0). That bundle lacks\n * the modern Windows Kits SDK (no MSIX-capable `makeappx`/`makepri`), so it cannot build MSIX — only the\n * MSIX target gates on this. AppX still builds fine with the legacy bundle (it has its own legacy-bundle\n * `signtool` handling in `getWindowsSignToolExe`). Unset / `null` / `\"latest\"` and any modern version pin\n * resolve to a modern bundle; a custom `{ url, … }` toolset is the caller's responsibility and is not\n * treated as legacy.\n */\nexport function isLegacyWinCodeSign(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish): boolean {\n return typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\"\n}\n\nasync function getWindowsSignToolExe({ winCodeSign, resourcesDir = \"\" }: { winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish; resourcesDir?: string }) {\n if (typeof winCodeSign !== \"object\" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === \"0.0.0\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n } else {\n return path.join(vendorPath, \"windows-10\", process.arch === \"ia32\" ? \"ia32\" : \"x64\", \"signtool.exe\")\n }\n }\n // kit is already sanitized by getWindowsKitsBundle\n const { kit } = await getWindowsKitsBundle({ winCodeSign, resourcesDir })\n return path.join(kit, \"signtool.exe\")\n}\n\nasync function getOsslSigncodeBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n // A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { path: path.join(vendorPath, \"osslsigncode\") }\n }\n\n if (process.platform === \"win32\") {\n // Unreachable in normal flow: osslsigncode is only requested when the host is not Windows (Windows signs via\n // signtool). Kept as defense-in-depth — fail loudly instead of resolving a bare `osslsigncode` from $PATH.\n throw new InvalidConfigurationError(\n `osslsigncode is not used on Windows (signing uses signtool). To override, configure a custom toolset: toolsets: { winCodeSign: { url: \"file:///absolute/path/to/dir\" } }`\n )\n }\n\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const legacyBase = sanitizeDirPath(await getLegacyWinCodeSignBin())\n const vendorBase = path.join(legacyBase, process.platform)\n const vendorPath = process.platform === \"darwin\" ? path.join(vendorBase, \"10.12\") : vendorBase\n return { path: path.join(vendorPath, \"osslsigncode\"), env: process.platform === \"darwin\" ? computeToolEnv([path.join(vendorPath, \"lib\")]) : undefined }\n }\n\n const file = (() => {\n if (process.platform === \"linux\") {\n if (process.arch == \"x64\") {\n return \"win-codesign-linux-amd64.zip\"\n } else if (process.arch === \"arm64\") {\n return \"win-codesign-linux-arm64.zip\"\n }\n return \"win-codesign-linux-i386.zip\"\n }\n // darwin arm64\n if (process.arch === \"arm64\") {\n return \"win-codesign-darwin-arm64.zip\"\n }\n return \"win-codesign-darwin-x86_64.zip\"\n })()\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { path: path.join(vendorPath, \"osslsigncode\") }\n}\n\nexport async function getAtsBundleDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"ats-bundle-1_0_95.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include an ATS bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"ats-bundle-1_0_95.zip\",\n checksums: { \"ats-bundle-1_0_95.zip\": checksum },\n })\n}\n\nexport async function getDotnetRuntimeDir(winCodeSign: string): Promise<string> {\n const version = winCodeSign === \"latest\" ? WIN_CODESIGN_LATEST : winCodeSign\n const checksum = (wincodesignChecksums as Record<string, Record<string, string>>)[version]?.[\"dotnet-runtime-win-x64-8_0_28.zip\"]\n if (!checksum) {\n throw new Error(`winCodeSign version \"${version}\" does not include a .NET runtime bundle (requires >= 1.3.0)`)\n }\n return downloadBuilderToolset({\n releaseName: `win-codesign@${version}`,\n filenameWithExt: \"dotnet-runtime-win-x64-8_0_28.zip\",\n checksums: { \"dotnet-runtime-win-x64-8_0_28.zip\": checksum },\n })\n}\n\nexport async function getRceditBundle(winCodeSign: ToolsetConfig[\"winCodeSign\"] | Nullish, resourcesDir = \"\") {\n const ia32 = \"rcedit-ia32.exe\"\n const x86 = \"rcedit-x86.exe\"\n const x64 = \"rcedit-x64.exe\"\n if (typeof winCodeSign === \"object\" && winCodeSign != null) {\n const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined)\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n }\n const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST)\n if (version === \"0.0.0\") {\n const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin())\n return { x86: path.join(vendorPath, ia32), x64: path.join(vendorPath, x64) }\n }\n const file = \"rcedit-windows-2_0_0.zip\"\n const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file))\n return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) }\n}\n"]}
@@ -25,7 +25,7 @@ export class FileCopyHelper {
25
25
  handleSymlink(fileStat, file, parent, linkTarget) {
26
26
  const resolvedLinkTarget = path.resolve(parent, linkTarget);
27
27
  const link = path.relative(this.matcher.from, resolvedLinkTarget);
28
- if (link.startsWith("..")) {
28
+ if (isOutsidePath(link)) {
29
29
  // outside of project, linked module (https://github.com/electron-userland/electron-builder/issues/675)
30
30
  return fsExtra.stat(resolvedLinkTarget).then(targetFileStat => {
31
31
  this.metadata.set(file, targetFileStat);
@@ -40,6 +40,14 @@ export class FileCopyHelper {
40
40
  return null;
41
41
  }
42
42
  }
43
+ /** @internal */
44
+ export function isOutsidePath(relativePath) {
45
+ if (relativePath === ".." || path.isAbsolute(relativePath)) {
46
+ return true;
47
+ }
48
+ // Windows path APIs accept both "/" and "\" as separators; on POSIX a backslash is an ordinary filename character
49
+ return relativePath.startsWith("../") || (path.sep === "\\" && relativePath.startsWith("..\\"));
50
+ }
43
51
  function createAppFilter(matcher, packager) {
44
52
  if (packager.areNodeModulesHandledExternally) {
45
53
  return matcher.isEmpty() ? null : matcher.createFilter();
@@ -1 +1 @@
1
- {"version":3,"file":"AppFileWalker.js","sourceRoot":"","sources":["../../src/util/AppFileWalker.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,KAAK,IA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C;aAAM,CAAC;YACN,oDAAoD;YACpD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACnC,CAAC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["import { FileConsumer, Filter, FilterStats } from \"builder-util\"\nimport fsExtra from \"fs-extra\"\nimport * as path from \"path\"\nimport { FileMatcher } from \"../fileMatcher.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\n\nfunction addAllPatternIfNeed(matcher: FileMatcher) {\n if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {\n matcher.prependPattern(\"**/*\")\n }\n return matcher\n}\n\nexport abstract class FileCopyHelper {\n readonly metadata = new Map<string, fsExtra.Stats>()\n\n protected constructor(\n protected readonly matcher: FileMatcher,\n readonly filter: Filter | null,\n protected readonly packager: PlatformPackager<any>\n ) {}\n\n protected handleFile(file: string, parent: string, fileStat: fsExtra.Stats): Promise<fsExtra.Stats | null> | null {\n if (!fileStat.isSymbolicLink()) {\n return null\n }\n\n return fsExtra.readlink(file).then((linkTarget): any => {\n // http://unix.stackexchange.com/questions/105637/is-symlinks-target-relative-to-the-destinations-parent-directory-and-if-so-wh\n return this.handleSymlink(fileStat, file, parent, linkTarget)\n })\n }\n\n private handleSymlink(fileStat: fsExtra.Stats, file: string, parent: string, linkTarget: string): Promise<fsExtra.Stats> | null {\n const resolvedLinkTarget = path.resolve(parent, linkTarget)\n const link = path.relative(this.matcher.from, resolvedLinkTarget)\n if (link.startsWith(\"..\")) {\n // outside of project, linked module (https://github.com/electron-userland/electron-builder/issues/675)\n return fsExtra.stat(resolvedLinkTarget).then(targetFileStat => {\n this.metadata.set(file, targetFileStat)\n return targetFileStat\n })\n } else {\n const s: FilterStats = fileStat\n s.relativeLink = link\n s.linkRelativeToFile = path.relative(parent, resolvedLinkTarget)\n }\n return null\n }\n}\n\nfunction createAppFilter(matcher: FileMatcher, packager: PlatformPackager<any>): Filter | null {\n if (packager.areNodeModulesHandledExternally) {\n return matcher.isEmpty() ? null : matcher.createFilter()\n }\n return matcher.createFilter()\n}\n\n/** @internal */\nexport class AppFileWalker extends FileCopyHelper implements FileConsumer {\n readonly matcherFilter: any\n constructor(matcher: FileMatcher, packager: PlatformPackager<any>) {\n super(addAllPatternIfNeed(matcher), createAppFilter(matcher, packager), packager)\n this.matcherFilter = matcher.createFilter()\n }\n\n // noinspection JSUnusedGlobalSymbols\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n consume(file: string, fileStat: fsExtra.Stats, parent: string, siblingNames: Array<string>): any {\n if (fileStat.isDirectory()) {\n const matchesFilter = this.matcherFilter(file, fileStat)\n return !matchesFilter\n } else {\n // save memory - no need to store stat for directory\n this.metadata.set(file, fileStat)\n }\n\n return this.handleFile(file, parent, fileStat)\n }\n}\n"]}
1
+ {"version":3,"file":"AppFileWalker.js","sourceRoot":"","sources":["../../src/util/AppFileWalker.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAI5B,SAAS,mBAAmB,CAAC,OAAoB;IAC/C,IAAI,CAAC,OAAO,CAAC,uBAAuB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,EAAE,CAAC;QAC5F,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,OAAgB,cAAc;IAGlC,YACqB,OAAoB,EAC9B,MAAqB,EACX,QAA+B;QAF/B,YAAO,GAAP,OAAO,CAAa;QAC9B,WAAM,GAAN,MAAM,CAAe;QACX,aAAQ,GAAR,QAAQ,CAAuB;QAL3C,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAA;IAMjD,CAAC;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Q,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["import { FileConsumer, Filter, FilterStats } from \"builder-util\"\nimport fsExtra from \"fs-extra\"\nimport * as path from \"path\"\nimport { FileMatcher } from \"../fileMatcher.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\n\nfunction addAllPatternIfNeed(matcher: FileMatcher) {\n if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {\n matcher.prependPattern(\"**/*\")\n }\n return matcher\n}\n\nexport abstract class FileCopyHelper {\n readonly metadata = new Map<string, fsExtra.Stats>()\n\n protected constructor(\n protected readonly matcher: FileMatcher,\n readonly filter: Filter | null,\n protected readonly packager: PlatformPackager<any>\n ) {}\n\n protected handleFile(file: string, parent: string, fileStat: fsExtra.Stats): Promise<fsExtra.Stats | null> | null {\n if (!fileStat.isSymbolicLink()) {\n return null\n }\n\n return fsExtra.readlink(file).then((linkTarget): any => {\n // http://unix.stackexchange.com/questions/105637/is-symlinks-target-relative-to-the-destinations-parent-directory-and-if-so-wh\n return this.handleSymlink(fileStat, file, parent, linkTarget)\n })\n }\n\n private handleSymlink(fileStat: fsExtra.Stats, file: string, parent: string, linkTarget: string): Promise<fsExtra.Stats> | null {\n const resolvedLinkTarget = path.resolve(parent, linkTarget)\n const link = path.relative(this.matcher.from, resolvedLinkTarget)\n if (isOutsidePath(link)) {\n // outside of project, linked module (https://github.com/electron-userland/electron-builder/issues/675)\n return fsExtra.stat(resolvedLinkTarget).then(targetFileStat => {\n this.metadata.set(file, targetFileStat)\n return targetFileStat\n })\n } else {\n const s: FilterStats = fileStat\n s.relativeLink = link\n s.linkRelativeToFile = path.relative(parent, resolvedLinkTarget)\n }\n return null\n }\n}\n\n/** @internal */\nexport function isOutsidePath(relativePath: string): boolean {\n if (relativePath === \"..\" || path.isAbsolute(relativePath)) {\n return true\n }\n // Windows path APIs accept both \"/\" and \"\\\" as separators; on POSIX a backslash is an ordinary filename character\n return relativePath.startsWith(\"../\") || (path.sep === \"\\\\\" && relativePath.startsWith(\"..\\\\\"))\n}\n\nfunction createAppFilter(matcher: FileMatcher, packager: PlatformPackager<any>): Filter | null {\n if (packager.areNodeModulesHandledExternally) {\n return matcher.isEmpty() ? null : matcher.createFilter()\n }\n return matcher.createFilter()\n}\n\n/** @internal */\nexport class AppFileWalker extends FileCopyHelper implements FileConsumer {\n readonly matcherFilter: any\n constructor(matcher: FileMatcher, packager: PlatformPackager<any>) {\n super(addAllPatternIfNeed(matcher), createAppFilter(matcher, packager), packager)\n this.matcherFilter = matcher.createFilter()\n }\n\n // noinspection JSUnusedGlobalSymbols\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n consume(file: string, fileStat: fsExtra.Stats, parent: string, siblingNames: Array<string>): any {\n if (fileStat.isDirectory()) {\n const matchesFilter = this.matcherFilter(file, fileStat)\n return !matchesFilter\n } else {\n // save memory - no need to store stat for directory\n this.metadata.set(file, fileStat)\n }\n\n return this.handleFile(file, parent, fileStat)\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { FileTransformer } from "builder-util";
1
+ import { ExternalLinkPolicy, FileTransformer } from "builder-util";
2
2
  import { Stats } from "fs";
3
3
  import { FileMatcher } from "../fileMatcher.js";
4
4
  import { PM } from "../node-module-collector/index.js";
@@ -7,7 +7,20 @@ import { Packager } from "../packager.js";
7
7
  import { PlatformPackager } from "../platformPackager.js";
8
8
  import { NodeModuleInfo } from "../node-module-collector/types.js";
9
9
  export declare function getDestinationPath(file: string, fileSet: ResolvedFileSet): string;
10
- export declare function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer): Promise<void>;
10
+ export interface CopyAppFilesOptions {
11
+ /** Every file, directory and symlink is written inside it, checked by its real path: the resources directory of the app. */
12
+ readonly containmentRoot: string;
13
+ /** The real paths files may be copied from, see `getTrustedSourceRoots`. Each file is checked when given. */
14
+ readonly trustedSourceRoots?: ReadonlyArray<string> | null;
15
+ /** The `fileOptions.allowExternalLinks` build option: allows a file outside the trusted source roots, or a kept symlink that leaves the containment root. */
16
+ readonly externalLinks?: ExternalLinkPolicy | null;
17
+ }
18
+ /**
19
+ * Copies the files of the app when they are not packed into an asar archive. Like the asar packer, it refuses a file whose real path is
20
+ * outside the trusted source roots, writes only inside the containment root, checked by real path, and recreates a symlink only when it
21
+ * stays inside the containment root.
22
+ */
23
+ export declare function copyAppFiles(fileSet: ResolvedFileSet, packager: Pick<Packager, "cancellationToken">, transformer: FileTransformer, options?: CopyAppFilesOptions | null): Promise<void>;
11
24
  export interface ResolvedFileSet {
12
25
  src: string;
13
26
  destination: string;
@@ -1 +1 @@
1
- {"version":3,"file":"appFileCopier.d.ts","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,eAAe,EAA8F,MAAM,cAAc,CAAA;AAE9K,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAO1B,OAAO,EAA+B,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAgC,EAAE,EAAE,MAAM,mCAAmC,CAAA;AACpF,OAAO,EAAyC,aAAa,EAAE,MAAM,2CAA2C,CAAA;AAChH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGlE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,UAYxE;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,iBAyC5G;AAGD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IAEnB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACpB,QAAQ,EAAE,GAAG,CAAC,MAAM,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idConfigurationError, isEmptyOrSpaces, log, MAX_FILE_REQUESTS, statOrNull, walk } from "builder-util";
1
+ import { assertCopiedSymlinksContained, AsyncTaskManager, FileCopier, InvalidConfigurationError, isEmptyOrSpaces, log, MAX_FILE_REQUESTS, rebaseCopiedSymlinkTarget, statOrNull, walk, WriteContainment, } from "builder-util";
2
2
  import { DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES } from "../configuration.js";
3
3
  import fsExtra from "fs-extra";
4
- import { mkdir, readlink } from "fs/promises";
4
+ import { readlink } from "fs/promises";
5
5
  import * as path from "path";
6
6
  import asyncPool from "tiny-async-pool";
7
7
  import { isLibOrExe } from "../asar/unpackDetector.js";
8
8
  import { Platform } from "../core.js";
9
- import { DEFAULT_EXCLUDED_EXTENSIONS, FileMatcher } from "../fileMatcher.js";
9
+ import { FileMatcher, resolveExcludedExtensions } from "../fileMatcher.js";
10
10
  import { getCollectorByPackageManager, PM } from "../node-module-collector/index.js";
11
11
  import { LogMessageByKey, logMessageLevelByKey } from "../node-module-collector/moduleManager.js";
12
12
  import { AppFileWalker } from "./AppFileWalker.js";
13
13
  import { NodeModuleCopyHelper } from "./NodeModuleCopyHelper.js";
14
14
  import { archToNodeCpu } from "./archCompatibility.js";
15
+ import { assertSourceFileInTrustedRoots } from "./trustedSourceRoots.js";
15
16
  export function getDestinationPath(file, fileSet) {
16
17
  if (file === fileSet.src) {
17
18
  return fileSet.destination;
@@ -19,16 +20,22 @@ export function getDestinationPath(file, fileSet) {
19
20
  const src = fileSet.src;
20
21
  const dest = fileSet.destination;
21
22
  // get node_modules path relative to src and then append to dest
22
- if (file.startsWith(src)) {
23
+ if (file.startsWith(src + path.sep)) {
23
24
  return path.join(dest, path.relative(src, file));
24
25
  }
25
26
  return dest;
26
27
  }
27
- export async function copyAppFiles(fileSet, packager, transformer) {
28
+ /**
29
+ * Copies the files of the app when they are not packed into an asar archive. Like the asar packer, it refuses a file whose real path is
30
+ * outside the trusted source roots, writes only inside the containment root, checked by real path, and recreates a symlink only when it
31
+ * stays inside the containment root.
32
+ */
33
+ export async function copyAppFiles(fileSet, packager, transformer, options) {
28
34
  const metadata = fileSet.metadata;
29
35
  // search auto unpacked dir
30
36
  const taskManager = new AsyncTaskManager(packager.cancellationToken);
31
- const createdParentDirs = new Set();
37
+ const containment = new WriteContainment(options?.containmentRoot ?? fileSet.destination, "app file");
38
+ const trustedSourceRoots = options?.trustedSourceRoots;
32
39
  const fileCopier = new FileCopier(file => {
33
40
  return !isLibOrExe(file);
34
41
  }, transformer);
@@ -40,16 +47,16 @@ export async function copyAppFiles(fileSet, packager, transformer) {
40
47
  // dir
41
48
  continue;
42
49
  }
50
+ if (trustedSourceRoots != null) {
51
+ await assertSourceFileInTrustedRoots(sourceFile, trustedSourceRoots, options?.externalLinks);
52
+ }
43
53
  const destinationFile = getDestinationPath(sourceFile, fileSet);
44
54
  if (stat.isSymbolicLink()) {
45
- links.push({ file: destinationFile, link: await readlink(sourceFile) });
55
+ links.push({ file: destinationFile, link: rebaseCopiedSymlinkTarget(fileSet.src, sourceFile, await readlink(sourceFile)), source: sourceFile });
46
56
  continue;
47
57
  }
48
- const fileParent = path.dirname(destinationFile);
49
- if (!createdParentDirs.has(fileParent)) {
50
- createdParentDirs.add(fileParent);
51
- await mkdir(fileParent, { recursive: true });
52
- }
58
+ // creates the directory once, checked by its real path, and removes a symlink planted at the destination
59
+ await containment.prepareFile(destinationFile);
53
60
  taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat));
54
61
  if (taskManager.tasks.length > MAX_FILE_REQUESTS) {
55
62
  await taskManager.awaitTasks();
@@ -58,7 +65,12 @@ export async function copyAppFiles(fileSet, packager, transformer) {
58
65
  if (taskManager.tasks.length > 0) {
59
66
  await taskManager.awaitTasks();
60
67
  }
61
- await asyncPool(MAX_FILE_REQUESTS, links, it => fsExtra.ensureSymlink(it.link, it.file));
68
+ await asyncPool(MAX_FILE_REQUESTS, links, async (it) => {
69
+ await containment.prepareFile(it.file);
70
+ await fsExtra.ensureSymlink(it.link, it.file);
71
+ });
72
+ // the walker follows a symlink that leaves the app directory and copies what it points to, so a symlink kept as it is has to stay inside
73
+ await assertCopiedSymlinksContained(containment, links, [], "app file", options?.externalLinks);
62
74
  }
63
75
  // used only for ASAR, if no asar, file transformed on the fly
64
76
  export async function transformFiles(transformer, fileSet) {
@@ -109,12 +121,9 @@ export async function computeFileSets(matchers, transformer, platformPackager) {
109
121
  }
110
122
  return fileSets;
111
123
  }
112
- function getNodeModuleExcludedExts(platformPackager) {
124
+ function getNodeModuleExcludedExts(platformPackager, platformSpecificBuildOptions) {
113
125
  // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)
114
- const result = DEFAULT_EXCLUDED_EXTENSIONS.map(it => `.${it}`);
115
- if (platformPackager.config.includePdb !== true) {
116
- result.push(".pdb");
117
- }
126
+ const result = resolveExcludedExtensions(platformPackager.config, platformSpecificBuildOptions).map(it => `.${it}`);
118
127
  if (platformPackager.platform !== Platform.WINDOWS) {
119
128
  // https://github.com/electron-userland/electron-builder/issues/1738
120
129
  result.push(".dll");
@@ -129,9 +138,10 @@ function validateFileSet(fileSet) {
129
138
  return fileSet;
130
139
  }
131
140
  /** @internal */
132
- export async function computeNodeModuleFileSets(platformPackager, mainMatcher, arch, applyArchFilter = true) {
141
+ export async function computeNodeModuleFileSets(platformPackager, platformSpecificBuildOptions, mainMatcher, arch, applyArchFilter = true) {
133
142
  const deps = await collectNodeModulesWithLogging(platformPackager, applyArchFilter ? arch : null);
134
- const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager);
143
+ // the options this pack uses for the app files too (e.g. mac → mas → masDev cascaded), not always the platform section's own
144
+ const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager, platformSpecificBuildOptions);
135
145
  // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure
136
146
  const result = new Array();
137
147
  let index = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"appFileCopier.js","sourceRoot":"","sources":["../../src/util/app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WAAW,CAAC,CAAA;IAErD,OAAO,IAAI,CAAC,WAAW,CAAA;AACzB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,4BAA4B,GAA2B;IAC3D,mBAAmB,EAAE,4DAA4D;IACjF,kBAAkB,EAAE,0EAA0E;IAC9F,kBAAkB,EAAE,sFAAsF;CAC3G,CAAA;AAED,SAAS,mCAAmC,CAAC,WAAwD;IACnG,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,IAAI,IAAI,4BAA4B,CAAC,CAAA;IACjG,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,OAAO,EAAE,CAAC;QAC/B,GAAG,CAAC,IAAI,CACN,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,IAAI,mEAAmE,EAAE,EAC/G,GAAG,IAAI,qEAAqE,4BAA4B,CAAC,IAAI,CAAC,KAAK;YACjH,4GAA4G;YAC5G,4IAA4I,CAC/I,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import { Arch, AsyncTaskManager, FileCopier, FileTransformer, InvalidConfigurationError, isEmptyOrSpaces, Link, log, MAX_FILE_REQUESTS, statOrNull, walk } from \"builder-util\"\nimport { DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES } from \"../configuration.js\"\nimport { Stats } from \"fs\"\nimport fsExtra from \"fs-extra\"\nimport { mkdir, readlink } from \"fs/promises\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { isLibOrExe } from \"../asar/unpackDetector.js\"\nimport { Platform } from \"../core.js\"\nimport { DEFAULT_EXCLUDED_EXTENSIONS, FileMatcher } from \"../fileMatcher.js\"\nimport { getCollectorByPackageManager, PM } from \"../node-module-collector/index.js\"\nimport { LogMessageByKey, logMessageLevelByKey, ModuleManager } from \"../node-module-collector/moduleManager.js\"\nimport { Packager } from \"../packager.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { AppFileWalker } from \"./AppFileWalker.js\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper.js\"\nimport { NodeModuleInfo } from \"../node-module-collector/types.js\"\nimport { archToNodeCpu } from \"./archCompatibility.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n\n const src = fileSet.src\n const dest = fileSet.destination\n // get node_modules path relative to src and then append to dest\n if (file.startsWith(src)) {\n return path.join(dest, path.relative(src, file))\n }\n return dest\n}\n\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const createdParentDirs = new Set<string>()\n\n const fileCopier = new FileCopier(file => {\n return !isLibOrExe(file)\n }, transformer)\n const links: Array<Link> = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({ file: destinationFile, link: await readlink(sourceFile) })\n continue\n }\n\n const fileParent = path.dirname(destinationFile)\n if (!createdParentDirs.has(fileParent)) {\n createdParentDirs.add(fileParent)\n await mkdir(fileParent, { recursive: true })\n }\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n await asyncPool(MAX_FILE_REQUESTS, links, it => fsExtra.ensureSymlink(it.link, it.file))\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array<string>\n metadata: Map<string, Stats>\n transformedFiles?: Map<number, string | Buffer> | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void> {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n const filesPromise = fileSet.files.map(async (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise<any>).then(it => {\n if (it != null) {\n transformedFiles!.set(index, it)\n }\n return\n })\n }\n transformedFiles!.set(index, transformedValue as string | Buffer)\n return\n })\n // `asyncPool` doesn't provide `index` in it's handler, so we `map` first before using it\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n}\n\nexport async function computeFileSets(matchers: Array<FileMatcher>, transformer: FileTransformer | null, platformPackager: PlatformPackager<any>): Promise<Array<ResolvedFileSet>> {\n const fileSets: Array<ResolvedFileSet> = []\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, platformPackager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({ directory: matcher.from, reason: \"doesn't exist\" }, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({ src: matcher.from, files, metadata, destination: matcher.to }))\n }\n\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager<any>) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = DEFAULT_EXCLUDED_EXTENSIONS.map(it => `.${it}`)\n if (platformPackager.config.includePdb !== true) {\n result.push(\".pdb\")\n }\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(\n platformPackager: PlatformPackager<any>,\n mainMatcher: FileMatcher,\n arch: Arch,\n applyArchFilter = true\n): Promise<Array<ResolvedFileSet>> {\n const deps = await collectNodeModulesWithLogging(platformPackager, applyArchFilter ? arch : null)\n\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager)\n // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure\n const result = new Array<ResolvedFileSet>()\n let index = 0\n const NODE_MODULES = \"node_modules\"\n\n const collectNodeModules = async (dep: NodeModuleInfo, destination: string) => {\n // Ignore excluded dependencies.\n if (dep.excluded) {\n return\n }\n\n const source = dep.dir\n const matcher = new FileMatcher(source, destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager)\n const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts, path.relative(mainMatcher.to, destination))\n result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })\n\n log.debug({ dep: dep.name, from: log.filePath(source), to: log.filePath(destination), filesCount: files.length }, \"identified module\")\n\n if (dep.dependencies) {\n for (const c of dep.dependencies) {\n await collectNodeModules(c, path.join(destination, NODE_MODULES, c.name))\n }\n }\n }\n\n for (const dep of deps) {\n const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name)\n await collectNodeModules(dep, destination)\n }\n return result\n}\n\ntype CollectedNodeModules = { nodeModules: NodeModuleInfo[]; logSummary: ModuleManager[\"logSummary\"] }\n\n/** Runs a single package-manager collector against a single directory. */\ntype CollectorRunner = (pm: PM, dir: string) => Promise<CollectedNodeModules>\n\n// `workspace:`/`file:`/`link:`/`portal:` dependencies are symlinked into place rather than\n// installed as standalone, hoistable packages, so they may legitimately be absent from a\n// collected tree and cannot be used to validate it.\nconst LOCAL_DEPENDENCY_SPEC = /^(?:workspace|file|link|portal):/\n\n// Log-summary buckets in which a collector reports a declared dependency it deliberately or\n// unavoidably left out of the collected tree. A direct dependency recorded in one of these is\n// accounted for even though it is absent from the top level of an otherwise correct collection.\nconst ACCOUNTED_ABSENT_DEPENDENCY_KEYS: ReadonlyArray<LogMessageByKey> = [\n // dropped by the target arch/platform filter (`archFilter`, package.json `cpu`/`os`)\n LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM,\n // not installed / not resolvable on disk — whether that is fatal is decided afterwards by\n // `allowMissingDependencies` (see enforceAllowMissingDependencies), not by collection matching\n LogMessageByKey.PKG_NOT_FOUND,\n LogMessageByKey.PKG_NOT_ON_DISK,\n LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED,\n LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED,\n // excluded via `ignoredProductionDependencies` (such modules normally stay in the tree flagged\n // `excluded`, so this only matters if a collector ever drops them instead)\n LogMessageByKey.PKG_EXCLUDED_IGNORED,\n // a dependency that resolves to the package itself is skipped rather than collected\n LogMessageByKey.PKG_SELF_REF,\n]\n\n/**\n * Determines whether a collected module tree actually describes the package being built.\n *\n * A package-manager `list` invocation can resolve to the wrong project root — most notably when\n * electron-builder is run from a workspace sub-package whose dependencies are hoisted to the\n * workspace root (#9945) — or a collector can resolve the root node to the wrong package (e.g. an\n * app named like one of its own dependencies, #10277). In both cases the collector returns a\n * non-empty but wrong tree. Accepting it would suppress the manual-traversal fallback that resolves\n * the correct modules, so we need to tell a matching collection from a mismatched one.\n *\n * Only the package's declared external (registry-installed, non-`workspace:`/`file:`/`link:`/`portal:`)\n * production `dependencies` are checked; they are always placed at the top level of a correct\n * collection. A collection matches when:\n * - at least one of them is present at the top level, and\n * - every one of them is either present at the top level (including modules flagged `excluded` by\n * `ignoredProductionDependencies`) or reported in the collection's own `logSummary` as\n * legitimately absent: dropped by the arch/platform filter, missing on disk (enforced later by\n * `allowMissingDependencies`), a missing optional/platform-specific package, excluded as ignored,\n * or a self-reference.\n *\n * When the package declares no external production dependencies there is nothing to validate\n * against, so any non-empty collection is accepted.\n */\nexport function collectionMatchesAppDependencies(\n nodeModules: NodeModuleInfo[],\n dependencies: Record<string, string> | undefined,\n logSummary?: ModuleManager[\"logSummary\"]\n): boolean {\n const requiredExternalDeps = Object.entries(dependencies ?? {})\n .filter(([, spec]) => !LOCAL_DEPENDENCY_SPEC.test(spec))\n .map(([name]) => name)\n if (requiredExternalDeps.length === 0) {\n return true\n }\n const collected = new Set(nodeModules.map(it => it.name))\n if (!requiredExternalDeps.some(name => collected.has(name))) {\n return false\n }\n const accountedAbsent = new Set(ACCOUNTED_ABSENT_DEPENDENCY_KEYS.flatMap(key => logSummary?.[key] ?? []).map(dependencyNameFromSummaryId))\n return requiredExternalDeps.every(name => collected.has(name) || accountedAbsent.has(name))\n}\n\n/**\n * Walks the candidate (package-manager, directory) combinations and returns the first collection\n * that both contains modules and matches the package being built (see\n * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a\n * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a\n * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.\n *\n * An approach that throws (e.g. the package manager exited without producing its dependency tree,\n * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every\n * approach fails to produce a collection and at least one threw, the first error is rethrown rather\n * than silently reporting \"no node modules\".\n */\nexport async function resolveFirstMatchingCollection(options: {\n pmApproaches: PM[]\n searchDirectories: string[]\n dependencies: Record<string, string> | undefined\n run: CollectorRunner\n}): Promise<CollectedNodeModules | undefined> {\n const { pmApproaches, searchDirectories, dependencies, run } = options\n let fallback: CollectedNodeModules | undefined\n let firstError: Error | undefined\n\n for (const pm of pmApproaches) {\n for (const dir of searchDirectories) {\n log.info({ pm, searchDir: dir }, \"searching for node modules\")\n let deps: CollectedNodeModules\n try {\n deps = await run(pm, dir)\n } catch (error: any) {\n log.warn({ pm, searchDir: dir, error: error?.message ?? String(error) }, \"node module collection failed, trying next search directory/approach\")\n firstError ??= error instanceof Error ? error : new Error(String(error))\n continue\n }\n if (deps.nodeModules.length === 0) {\n log.info({ pm, searchDir: dir }, \"no node modules found in collection, trying next search directory\")\n continue\n }\n if (collectionMatchesAppDependencies(deps.nodeModules, dependencies, deps.logSummary)) {\n log.debug({ pm, searchDir: dir, depCount: deps.nodeModules.length }, \"collected node modules\")\n return deps\n }\n log.info({ pm, searchDir: dir }, \"collected node modules do not match the target package, trying next search directory/approach\")\n fallback ??= deps\n }\n }\n if (fallback == null && firstError != null) {\n throw firstError\n }\n return fallback\n}\n\n/** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */\nfunction dependencyNameFromSummaryId(id: string): string {\n let at: number\n if (id.startsWith(\"@\")) {\n // Scoped package: the version separator is the first `@` after the scope's `/`\n const slashIndex = id.indexOf(\"/\")\n if (slashIndex === -1) {\n return id\n }\n at = id.indexOf(\"@\", slashIndex + 1)\n } else {\n at = id.indexOf(\"@\")\n }\n return at > 0 ? id.slice(0, at) : id\n}\n\n/**\n * Enforces {@link CommonConfiguration.allowMissingDependencies} against the finished collection\n * summary (issue #10058). Runs only after collection completes, so the error reports the COMPLETE\n * set of missing production dependencies at once instead of failing on the first one.\n *\n * Fail-closed by default: `false`, `null` and omitted all fail the build when a production\n * dependency is missing; `true` restores the historical warn-only behavior. When the option is a\n * `string[]`, only the listed dependency names are allowed to be missing — matched against the\n * package name parsed from the summary's `name@version` entries (scoped names included), with an\n * exact-entry match accepted as well.\n *\n * Only genuinely missing production dependencies (`PKG_NOT_FOUND` / `PKG_NOT_ON_DISK`) are fatal;\n * missing optional dependencies (`PKG_OPTIONAL_NOT_INSTALLED` / `PKG_OPTIONAL_PLATFORM_NOT_INSTALLED`)\n * never fail the build.\n *\n * @internal exported for tests\n */\nexport function enforceAllowMissingDependencies(allowMissingDependencies: boolean | Array<string> | null | undefined, logSummary: ModuleManager[\"logSummary\"] | undefined): void {\n if (allowMissingDependencies === true) {\n return\n }\n const missing = new Set<string>([...(logSummary?.[LogMessageByKey.PKG_NOT_FOUND] ?? []), ...(logSummary?.[LogMessageByKey.PKG_NOT_ON_DISK] ?? [])])\n const allowed = new Set(Array.isArray(allowMissingDependencies) ? allowMissingDependencies : [])\n const fatal = Array.from(missing)\n .filter(id => !allowed.has(dependencyNameFromSummaryId(id)) && !allowed.has(id))\n .sort()\n if (fatal.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The following production dependencies could not be resolved during node-module collection:\\n` +\n fatal.map(id => ` - ${id}`).join(\"\\n\") +\n `\\nInstall the missing dependencies, list names in \\`allowMissingDependencies\\` to allow specific ones to be missing, or set \\`allowMissingDependencies\\` to true to only warn (electron-builder <= 26 behavior).`\n )\n}\n\n/** @internal */\nexport async function collectNodeModulesWithLogging(platformPackager: PlatformPackager<any>, arch: Arch | null) {\n const { tempDirManager, appDir, projectDir } = platformPackager\n\n // Drop packages whose `package.json` `cpu`/`os` is incompatible with the target arch/platform while\n // collecting (e.g. exclude `@esbuild/darwin-arm64` from the x64 slice). See NodeModulesCollector.\n // `null` arch (universal slices) disables the filter so both slices stay symmetric for the merge.\n const archFilter = arch == null ? undefined : { cpu: archToNodeCpu(arch), os: platformPackager.platform.nodeName }\n\n const searchDirectories = Array.from(new Set([appDir, projectDir, await platformPackager.getWorkspaceRoot()])).filter((it): it is string => isEmptyOrSpaces(it) === false)\n const pmApproaches = [await platformPackager.getPackageManager(), PM.TRAVERSAL]\n\n // The default-ignored packages are excluded from the copied `node_modules` — together with any\n // transitive dependency they alone require — because electron-builder already provides them another\n // way (the Electron runtime is embedded separately), so copying them would be redundant. They remain\n // valid production dependencies for tooling such as SBOM generation. See NodeModulesCollector.getNodeModules.\n const configuredIgnored = platformPackager.config.ignoredProductionDependencies\n const ignoredDependencies = configuredIgnored == null ? DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES : configuredIgnored\n\n // An app that declares no production dependencies at all (neither as-installed nor via\n // `extraMetadata`) has nothing to bundle. Without this guard the search would skip the app's\n // empty `node_modules`, climb to the workspace root, and the vacuous match in\n // `collectionMatchesAppDependencies` would accept the entire hoisted workspace tree (#10033).\n const declaredDependencies = Object.keys({ ...platformPackager.originalMetadata.dependencies, ...platformPackager.metadata.dependencies })\n if (declaredDependencies.length === 0) {\n log.info(null, \"app has no production dependencies, skipping node_modules bundling\")\n return []\n }\n\n // Validate against the as-declared (pre-extraMetadata) production dependencies so a configured\n // `extraMetadata.dependencies` entry that isn't installed cannot reject a correct collection.\n const deps = await resolveFirstMatchingCollection({\n pmApproaches,\n searchDirectories,\n dependencies: platformPackager.originalMetadata.dependencies,\n run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({ packageName: platformPackager.nodePackageName, archFilter, ignoredDependencies }),\n })\n\n if (!deps?.nodeModules?.length) {\n log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, \"no node modules returned while searching directories\")\n return []\n }\n\n const summary = Object.entries(deps.logSummary ?? {}).filter(([, dependencies]) => Array.isArray(dependencies) && dependencies.length > 0)\n for (const [errorMessage, dependencies] of summary) {\n const logLevel = logMessageLevelByKey[errorMessage as LogMessageByKey] || \"debug\"\n log[logLevel]({ dependencies }, errorMessage)\n }\n\n // Fail-closed enforcement (issue #10058): collection is complete and the summary above has reached\n // the log, so failing here reports every missing production dependency at once.\n enforceAllowMissingDependencies(platformPackager.config.allowMissingDependencies, deps.logSummary)\n\n // Tripwire: the default-ignored packages are excluded because electron-builder already provides them\n // (e.g. the embedded Electron runtime), so a copy in `node_modules` is redundant. They only reach this\n // point unflagged when a user has removed them from `ignoredProductionDependencies`; record any that\n // are therefore about to be copied (present but not marked `excluded`) so the summary below warns.\n const bundledDefaultIgnored = deps.nodeModules.filter(it => !it.excluded && DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES.includes(it.name)).map(it => it.name)\n if (bundledDefaultIgnored.length > 0) {\n log.warn({ dependencies: bundledDefaultIgnored }, \"copied dependencies that shouldn't be needed, see ignoredProductionDependencies\")\n }\n\n warnAboutDeprecatedElectronPackages(deps.nodeModules)\n\n return deps.nodeModules\n}\n\n/**\n * Long-deprecated Electron packages that v26 rejected outright as production dependencies.\n *\n * v27 dropped that guard without adding them to the default ignore list, so they are now copied into\n * the app instead of failing the build — and `electron-prebuilt` drags a full second Electron binary\n * (hundreds of MB) into app.asar with nothing in the log to explain the size jump.\n */\nconst DEPRECATED_ELECTRON_PACKAGES: Record<string, string> = {\n \"electron-prebuilt\": \"renamed to `electron` in 2016 — replace it with `electron`\",\n \"electron-rebuild\": \"moved to `@electron/rebuild` — replace it and move it to devDependencies\",\n \"electron-nightly\": \"a full Electron distribution — move it to devDependencies if it is not meant to ship\",\n}\n\nfunction warnAboutDeprecatedElectronPackages(nodeModules: Array<{ name: string; excluded?: boolean }>): void {\n const bundled = nodeModules.filter(it => !it.excluded && it.name in DEPRECATED_ELECTRON_PACKAGES)\n for (const { name } of bundled) {\n log.warn(\n { dependency: name, solution: `add \"${name}\" to ignoredProductionDependencies, or move it to devDependencies` },\n `${name} is declared in dependencies and is being packaged into your app (${DEPRECATED_ELECTRON_PACKAGES[name]}). ` +\n \"electron-builder <= 26 rejected this outright; v27 removed that guard and does not exclude it by default. \" +\n \"See https://www.electron.build/docs/migration/v27-breaking-changes#electron-prebuilt-electron-rebuild-no-longer-error-and-are-not-excluded\"\n )\n }\n}\n"]}
1
+ {"version":3,"file":"appFileCopier.js","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,6BAA6B,EAC7B,gBAAgB,EAEhB,UAAU,EAEV,yBAAyB,EACzB,eAAe,EAEf,GAAG,EACH,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,IAAI,EACJ,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,uCAAuC,EAAE,MAAM,qBAAqB,CAAA;AAE7E,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,QAAQ,EA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C,GAAG,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,qBAAqB,EAAE,EAAE,iFAAiF,CAAC,CAAA;IACtI,CAAC;IAED,mCAAmC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAErD,OAAO,IAAI,CAAC,WAAW,CAAA;AACzB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,4BAA4B,GAA2B;IAC3D,mBAAmB,EAAE,4DAA4D;IACjF,kBAAkB,EAAE,0EAA0E;IAC9F,kBAAkB,EAAE,sFAAsF;CAC3G,CAAA;AAED,SAAS,mCAAmC,CAAC,WAAwD;IACnG,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,IAAI,IAAI,4BAA4B,CAAC,CAAA;IACjG,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,OAAO,EAAE,CAAC;QAC/B,GAAG,CAAC,IAAI,CACN,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,IAAI,mEAAmE,EAAE,EAC/G,GAAG,IAAI,qEAAqE,4BAA4B,CAAC,IAAI,CAAC,KAAK;YACjH,4GAA4G;YAC5G,4IAA4I,CAC/I,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import {\n Arch,\n assertCopiedSymlinksContained,\n AsyncTaskManager,\n ExternalLinkPolicy,\n FileCopier,\n FileTransformer,\n InvalidConfigurationError,\n isEmptyOrSpaces,\n Link,\n log,\n MAX_FILE_REQUESTS,\n rebaseCopiedSymlinkTarget,\n statOrNull,\n walk,\n WriteContainment,\n} from \"builder-util\"\nimport { DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES } from \"../configuration.js\"\nimport { Stats } from \"fs\"\nimport fsExtra from \"fs-extra\"\nimport { readlink } from \"fs/promises\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { isLibOrExe } from \"../asar/unpackDetector.js\"\nimport { Platform } from \"../core.js\"\nimport { FileMatcher, resolveExcludedExtensions } from \"../fileMatcher.js\"\nimport { getCollectorByPackageManager, PM } from \"../node-module-collector/index.js\"\nimport { LogMessageByKey, logMessageLevelByKey, ModuleManager } from \"../node-module-collector/moduleManager.js\"\nimport { Packager } from \"../packager.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { AppFileWalker } from \"./AppFileWalker.js\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper.js\"\nimport { NodeModuleInfo } from \"../node-module-collector/types.js\"\nimport { PlatformSpecificBuildOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport { archToNodeCpu } from \"./archCompatibility.js\"\nimport { assertSourceFileInTrustedRoots } from \"./trustedSourceRoots.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n\n const src = fileSet.src\n const dest = fileSet.destination\n // get node_modules path relative to src and then append to dest\n if (file.startsWith(src + path.sep)) {\n return path.join(dest, path.relative(src, file))\n }\n return dest\n}\n\nexport interface CopyAppFilesOptions {\n /** Every file, directory and symlink is written inside it, checked by its real path: the resources directory of the app. */\n readonly containmentRoot: string\n /** The real paths files may be copied from, see `getTrustedSourceRoots`. Each file is checked when given. */\n readonly trustedSourceRoots?: ReadonlyArray<string> | null\n /** The `fileOptions.allowExternalLinks` build option: allows a file outside the trusted source roots, or a kept symlink that leaves the containment root. */\n readonly externalLinks?: ExternalLinkPolicy | null\n}\n\n/**\n * Copies the files of the app when they are not packed into an asar archive. Like the asar packer, it refuses a file whose real path is\n * outside the trusted source roots, writes only inside the containment root, checked by real path, and recreates a symlink only when it\n * stays inside the containment root.\n */\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Pick<Packager, \"cancellationToken\">, transformer: FileTransformer, options?: CopyAppFilesOptions | null) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const containment = new WriteContainment(options?.containmentRoot ?? fileSet.destination, \"app file\")\n const trustedSourceRoots = options?.trustedSourceRoots\n\n const fileCopier = new FileCopier(file => {\n return !isLibOrExe(file)\n }, transformer)\n const links: Array<Link & { source: string }> = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n if (trustedSourceRoots != null) {\n await assertSourceFileInTrustedRoots(sourceFile, trustedSourceRoots, options?.externalLinks)\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({ file: destinationFile, link: rebaseCopiedSymlinkTarget(fileSet.src, sourceFile, await readlink(sourceFile)), source: sourceFile })\n continue\n }\n\n // creates the directory once, checked by its real path, and removes a symlink planted at the destination\n await containment.prepareFile(destinationFile)\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n await asyncPool(MAX_FILE_REQUESTS, links, async it => {\n await containment.prepareFile(it.file)\n await fsExtra.ensureSymlink(it.link, it.file)\n })\n // the walker follows a symlink that leaves the app directory and copies what it points to, so a symlink kept as it is has to stay inside\n await assertCopiedSymlinksContained(containment, links, [], \"app file\", options?.externalLinks)\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array<string>\n metadata: Map<string, Stats>\n transformedFiles?: Map<number, string | Buffer> | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void> {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n const filesPromise = fileSet.files.map(async (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise<any>).then(it => {\n if (it != null) {\n transformedFiles!.set(index, it)\n }\n return\n })\n }\n transformedFiles!.set(index, transformedValue as string | Buffer)\n return\n })\n // `asyncPool` doesn't provide `index` in it's handler, so we `map` first before using it\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n}\n\nexport async function computeFileSets(matchers: Array<FileMatcher>, transformer: FileTransformer | null, platformPackager: PlatformPackager<any>): Promise<Array<ResolvedFileSet>> {\n const fileSets: Array<ResolvedFileSet> = []\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, platformPackager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({ directory: matcher.from, reason: \"doesn't exist\" }, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({ src: matcher.from, files, metadata, destination: matcher.to }))\n }\n\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager<any>, platformSpecificBuildOptions: PlatformSpecificBuildOptions) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = resolveExcludedExtensions(platformPackager.config, platformSpecificBuildOptions).map(it => `.${it}`)\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(\n platformPackager: PlatformPackager<any>,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n mainMatcher: FileMatcher,\n arch: Arch,\n applyArchFilter = true\n): Promise<Array<ResolvedFileSet>> {\n const deps = await collectNodeModulesWithLogging(platformPackager, applyArchFilter ? arch : null)\n\n // the options this pack uses for the app files too (e.g. mac → mas → masDev cascaded), not always the platform section's own\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager, platformSpecificBuildOptions)\n // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure\n const result = new Array<ResolvedFileSet>()\n let index = 0\n const NODE_MODULES = \"node_modules\"\n\n const collectNodeModules = async (dep: NodeModuleInfo, destination: string) => {\n // Ignore excluded dependencies.\n if (dep.excluded) {\n return\n }\n\n const source = dep.dir\n const matcher = new FileMatcher(source, destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager)\n const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts, path.relative(mainMatcher.to, destination))\n result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })\n\n log.debug({ dep: dep.name, from: log.filePath(source), to: log.filePath(destination), filesCount: files.length }, \"identified module\")\n\n if (dep.dependencies) {\n for (const c of dep.dependencies) {\n await collectNodeModules(c, path.join(destination, NODE_MODULES, c.name))\n }\n }\n }\n\n for (const dep of deps) {\n const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name)\n await collectNodeModules(dep, destination)\n }\n return result\n}\n\ntype CollectedNodeModules = { nodeModules: NodeModuleInfo[]; logSummary: ModuleManager[\"logSummary\"] }\n\n/** Runs a single package-manager collector against a single directory. */\ntype CollectorRunner = (pm: PM, dir: string) => Promise<CollectedNodeModules>\n\n// `workspace:`/`file:`/`link:`/`portal:` dependencies are symlinked into place rather than\n// installed as standalone, hoistable packages, so they may legitimately be absent from a\n// collected tree and cannot be used to validate it.\nconst LOCAL_DEPENDENCY_SPEC = /^(?:workspace|file|link|portal):/\n\n// Log-summary buckets in which a collector reports a declared dependency it deliberately or\n// unavoidably left out of the collected tree. A direct dependency recorded in one of these is\n// accounted for even though it is absent from the top level of an otherwise correct collection.\nconst ACCOUNTED_ABSENT_DEPENDENCY_KEYS: ReadonlyArray<LogMessageByKey> = [\n // dropped by the target arch/platform filter (`archFilter`, package.json `cpu`/`os`)\n LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM,\n // not installed / not resolvable on disk — whether that is fatal is decided afterwards by\n // `allowMissingDependencies` (see enforceAllowMissingDependencies), not by collection matching\n LogMessageByKey.PKG_NOT_FOUND,\n LogMessageByKey.PKG_NOT_ON_DISK,\n LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED,\n LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED,\n // excluded via `ignoredProductionDependencies` (such modules normally stay in the tree flagged\n // `excluded`, so this only matters if a collector ever drops them instead)\n LogMessageByKey.PKG_EXCLUDED_IGNORED,\n // a dependency that resolves to the package itself is skipped rather than collected\n LogMessageByKey.PKG_SELF_REF,\n]\n\n/**\n * Determines whether a collected module tree actually describes the package being built.\n *\n * A package-manager `list` invocation can resolve to the wrong project root — most notably when\n * electron-builder is run from a workspace sub-package whose dependencies are hoisted to the\n * workspace root (#9945) — or a collector can resolve the root node to the wrong package (e.g. an\n * app named like one of its own dependencies, #10277). In both cases the collector returns a\n * non-empty but wrong tree. Accepting it would suppress the manual-traversal fallback that resolves\n * the correct modules, so we need to tell a matching collection from a mismatched one.\n *\n * Only the package's declared external (registry-installed, non-`workspace:`/`file:`/`link:`/`portal:`)\n * production `dependencies` are checked; they are always placed at the top level of a correct\n * collection. A collection matches when:\n * - at least one of them is present at the top level, and\n * - every one of them is either present at the top level (including modules flagged `excluded` by\n * `ignoredProductionDependencies`) or reported in the collection's own `logSummary` as\n * legitimately absent: dropped by the arch/platform filter, missing on disk (enforced later by\n * `allowMissingDependencies`), a missing optional/platform-specific package, excluded as ignored,\n * or a self-reference.\n *\n * When the package declares no external production dependencies there is nothing to validate\n * against, so any non-empty collection is accepted.\n */\nexport function collectionMatchesAppDependencies(\n nodeModules: NodeModuleInfo[],\n dependencies: Record<string, string> | undefined,\n logSummary?: ModuleManager[\"logSummary\"]\n): boolean {\n const requiredExternalDeps = Object.entries(dependencies ?? {})\n .filter(([, spec]) => !LOCAL_DEPENDENCY_SPEC.test(spec))\n .map(([name]) => name)\n if (requiredExternalDeps.length === 0) {\n return true\n }\n const collected = new Set(nodeModules.map(it => it.name))\n if (!requiredExternalDeps.some(name => collected.has(name))) {\n return false\n }\n const accountedAbsent = new Set(ACCOUNTED_ABSENT_DEPENDENCY_KEYS.flatMap(key => logSummary?.[key] ?? []).map(dependencyNameFromSummaryId))\n return requiredExternalDeps.every(name => collected.has(name) || accountedAbsent.has(name))\n}\n\n/**\n * Walks the candidate (package-manager, directory) combinations and returns the first collection\n * that both contains modules and matches the package being built (see\n * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a\n * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a\n * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.\n *\n * An approach that throws (e.g. the package manager exited without producing its dependency tree,\n * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every\n * approach fails to produce a collection and at least one threw, the first error is rethrown rather\n * than silently reporting \"no node modules\".\n */\nexport async function resolveFirstMatchingCollection(options: {\n pmApproaches: PM[]\n searchDirectories: string[]\n dependencies: Record<string, string> | undefined\n run: CollectorRunner\n}): Promise<CollectedNodeModules | undefined> {\n const { pmApproaches, searchDirectories, dependencies, run } = options\n let fallback: CollectedNodeModules | undefined\n let firstError: Error | undefined\n\n for (const pm of pmApproaches) {\n for (const dir of searchDirectories) {\n log.info({ pm, searchDir: dir }, \"searching for node modules\")\n let deps: CollectedNodeModules\n try {\n deps = await run(pm, dir)\n } catch (error: any) {\n log.warn({ pm, searchDir: dir, error: error?.message ?? String(error) }, \"node module collection failed, trying next search directory/approach\")\n firstError ??= error instanceof Error ? error : new Error(String(error))\n continue\n }\n if (deps.nodeModules.length === 0) {\n log.info({ pm, searchDir: dir }, \"no node modules found in collection, trying next search directory\")\n continue\n }\n if (collectionMatchesAppDependencies(deps.nodeModules, dependencies, deps.logSummary)) {\n log.debug({ pm, searchDir: dir, depCount: deps.nodeModules.length }, \"collected node modules\")\n return deps\n }\n log.info({ pm, searchDir: dir }, \"collected node modules do not match the target package, trying next search directory/approach\")\n fallback ??= deps\n }\n }\n if (fallback == null && firstError != null) {\n throw firstError\n }\n return fallback\n}\n\n/** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */\nfunction dependencyNameFromSummaryId(id: string): string {\n let at: number\n if (id.startsWith(\"@\")) {\n // Scoped package: the version separator is the first `@` after the scope's `/`\n const slashIndex = id.indexOf(\"/\")\n if (slashIndex === -1) {\n return id\n }\n at = id.indexOf(\"@\", slashIndex + 1)\n } else {\n at = id.indexOf(\"@\")\n }\n return at > 0 ? id.slice(0, at) : id\n}\n\n/**\n * Enforces {@link CommonConfiguration.allowMissingDependencies} against the finished collection\n * summary (issue #10058). Runs only after collection completes, so the error reports the COMPLETE\n * set of missing production dependencies at once instead of failing on the first one.\n *\n * Fail-closed by default: `false`, `null` and omitted all fail the build when a production\n * dependency is missing; `true` restores the historical warn-only behavior. When the option is a\n * `string[]`, only the listed dependency names are allowed to be missing — matched against the\n * package name parsed from the summary's `name@version` entries (scoped names included), with an\n * exact-entry match accepted as well.\n *\n * Only genuinely missing production dependencies (`PKG_NOT_FOUND` / `PKG_NOT_ON_DISK`) are fatal;\n * missing optional dependencies (`PKG_OPTIONAL_NOT_INSTALLED` / `PKG_OPTIONAL_PLATFORM_NOT_INSTALLED`)\n * never fail the build.\n *\n * @internal exported for tests\n */\nexport function enforceAllowMissingDependencies(allowMissingDependencies: boolean | Array<string> | null | undefined, logSummary: ModuleManager[\"logSummary\"] | undefined): void {\n if (allowMissingDependencies === true) {\n return\n }\n const missing = new Set<string>([...(logSummary?.[LogMessageByKey.PKG_NOT_FOUND] ?? []), ...(logSummary?.[LogMessageByKey.PKG_NOT_ON_DISK] ?? [])])\n const allowed = new Set(Array.isArray(allowMissingDependencies) ? allowMissingDependencies : [])\n const fatal = Array.from(missing)\n .filter(id => !allowed.has(dependencyNameFromSummaryId(id)) && !allowed.has(id))\n .sort()\n if (fatal.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The following production dependencies could not be resolved during node-module collection:\\n` +\n fatal.map(id => ` - ${id}`).join(\"\\n\") +\n `\\nInstall the missing dependencies, list names in \\`allowMissingDependencies\\` to allow specific ones to be missing, or set \\`allowMissingDependencies\\` to true to only warn (electron-builder <= 26 behavior).`\n )\n}\n\n/** @internal */\nexport async function collectNodeModulesWithLogging(platformPackager: PlatformPackager<any>, arch: Arch | null) {\n const { tempDirManager, appDir, projectDir } = platformPackager\n\n // Drop packages whose `package.json` `cpu`/`os` is incompatible with the target arch/platform while\n // collecting (e.g. exclude `@esbuild/darwin-arm64` from the x64 slice). See NodeModulesCollector.\n // `null` arch (universal slices) disables the filter so both slices stay symmetric for the merge.\n const archFilter = arch == null ? undefined : { cpu: archToNodeCpu(arch), os: platformPackager.platform.nodeName }\n\n const searchDirectories = Array.from(new Set([appDir, projectDir, await platformPackager.getWorkspaceRoot()])).filter((it): it is string => isEmptyOrSpaces(it) === false)\n const pmApproaches = [await platformPackager.getPackageManager(), PM.TRAVERSAL]\n\n // The default-ignored packages are excluded from the copied `node_modules` — together with any\n // transitive dependency they alone require — because electron-builder already provides them another\n // way (the Electron runtime is embedded separately), so copying them would be redundant. They remain\n // valid production dependencies for tooling such as SBOM generation. See NodeModulesCollector.getNodeModules.\n const configuredIgnored = platformPackager.config.ignoredProductionDependencies\n const ignoredDependencies = configuredIgnored == null ? DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES : configuredIgnored\n\n // An app that declares no production dependencies at all (neither as-installed nor via\n // `extraMetadata`) has nothing to bundle. Without this guard the search would skip the app's\n // empty `node_modules`, climb to the workspace root, and the vacuous match in\n // `collectionMatchesAppDependencies` would accept the entire hoisted workspace tree (#10033).\n const declaredDependencies = Object.keys({ ...platformPackager.originalMetadata.dependencies, ...platformPackager.metadata.dependencies })\n if (declaredDependencies.length === 0) {\n log.info(null, \"app has no production dependencies, skipping node_modules bundling\")\n return []\n }\n\n // Validate against the as-declared (pre-extraMetadata) production dependencies so a configured\n // `extraMetadata.dependencies` entry that isn't installed cannot reject a correct collection.\n const deps = await resolveFirstMatchingCollection({\n pmApproaches,\n searchDirectories,\n dependencies: platformPackager.originalMetadata.dependencies,\n run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({ packageName: platformPackager.nodePackageName, archFilter, ignoredDependencies }),\n })\n\n if (!deps?.nodeModules?.length) {\n log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, \"no node modules returned while searching directories\")\n return []\n }\n\n const summary = Object.entries(deps.logSummary ?? {}).filter(([, dependencies]) => Array.isArray(dependencies) && dependencies.length > 0)\n for (const [errorMessage, dependencies] of summary) {\n const logLevel = logMessageLevelByKey[errorMessage as LogMessageByKey] || \"debug\"\n log[logLevel]({ dependencies }, errorMessage)\n }\n\n // Fail-closed enforcement (issue #10058): collection is complete and the summary above has reached\n // the log, so failing here reports every missing production dependency at once.\n enforceAllowMissingDependencies(platformPackager.config.allowMissingDependencies, deps.logSummary)\n\n // Tripwire: the default-ignored packages are excluded because electron-builder already provides them\n // (e.g. the embedded Electron runtime), so a copy in `node_modules` is redundant. They only reach this\n // point unflagged when a user has removed them from `ignoredProductionDependencies`; record any that\n // are therefore about to be copied (present but not marked `excluded`) so the summary below warns.\n const bundledDefaultIgnored = deps.nodeModules.filter(it => !it.excluded && DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES.includes(it.name)).map(it => it.name)\n if (bundledDefaultIgnored.length > 0) {\n log.warn({ dependencies: bundledDefaultIgnored }, \"copied dependencies that shouldn't be needed, see ignoredProductionDependencies\")\n }\n\n warnAboutDeprecatedElectronPackages(deps.nodeModules)\n\n return deps.nodeModules\n}\n\n/**\n * Long-deprecated Electron packages that v26 rejected outright as production dependencies.\n *\n * v27 dropped that guard without adding them to the default ignore list, so they are now copied into\n * the app instead of failing the build — and `electron-prebuilt` drags a full second Electron binary\n * (hundreds of MB) into app.asar with nothing in the log to explain the size jump.\n */\nconst DEPRECATED_ELECTRON_PACKAGES: Record<string, string> = {\n \"electron-prebuilt\": \"renamed to `electron` in 2016 — replace it with `electron`\",\n \"electron-rebuild\": \"moved to `@electron/rebuild` — replace it and move it to devDependencies\",\n \"electron-nightly\": \"a full Electron distribution — move it to devDependencies if it is not meant to ship\",\n}\n\nfunction warnAboutDeprecatedElectronPackages(nodeModules: Array<{ name: string; excluded?: boolean }>): void {\n const bundled = nodeModules.filter(it => !it.excluded && it.name in DEPRECATED_ELECTRON_PACKAGES)\n for (const { name } of bundled) {\n log.warn(\n { dependency: name, solution: `add \"${name}\" to ignoredProductionDependencies, or move it to devDependencies` },\n `${name} is declared in dependencies and is being packaged into your app (${DEPRECATED_ELECTRON_PACKAGES[name]}). ` +\n \"electron-builder <= 26 rejected this outright; v27 removed that guard and does not exclude it by default. \" +\n \"See https://www.electron.build/docs/migration/v27-breaking-changes#electron-prebuilt-electron-rebuild-no-longer-error-and-are-not-excluded\"\n )\n }\n}\n"]}
@@ -8,7 +8,7 @@ export declare function getConfig(projectDir: string, configPath: string | null,
8
8
  * `doMergeConfigs` takes configs in the order you would pass them to
9
9
  * Object.assign as sources.
10
10
  */
11
- export declare function doMergeConfigs(configs: Configuration[]): Configuration;
11
+ export declare function doMergeConfigs(inputConfigs: Configuration[]): Configuration;
12
12
  export declare function validateConfiguration(config: Configuration, debugLogger: DebugLogger): Promise<void>;
13
13
  export declare function computeDefaultAppDirectory(projectDir: string, userAppDir: string | Nullish): Promise<string>;
14
14
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/util/config/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiE,MAAM,cAAc,CAAA;AAGzG,OAAO,EAA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