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

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 (457) hide show
  1. package/dist/Framework.d.ts +2 -0
  2. package/dist/Framework.d.ts.map +1 -1
  3. package/dist/Framework.js.map +1 -1
  4. package/dist/appInfo.d.ts +1 -1
  5. package/dist/appInfo.d.ts.map +1 -1
  6. package/dist/appInfo.js +3 -3
  7. package/dist/appInfo.js.map +1 -1
  8. package/dist/asar/asar.js.map +1 -1
  9. package/dist/asar/asarFileChecker.d.ts +4 -2
  10. package/dist/asar/asarFileChecker.d.ts.map +1 -1
  11. package/dist/asar/asarFileChecker.js +2 -3
  12. package/dist/asar/asarFileChecker.js.map +1 -1
  13. package/dist/asar/asarUtil.js +21 -11
  14. package/dist/asar/asarUtil.js.map +1 -1
  15. package/dist/codeSign/certInfo.d.ts +14 -0
  16. package/dist/codeSign/certInfo.d.ts.map +1 -1
  17. package/dist/codeSign/certInfo.js +49 -0
  18. package/dist/codeSign/certInfo.js.map +1 -1
  19. package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
  20. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  21. package/dist/codeSign/mac/macCodeSign.js +50 -25
  22. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  23. package/dist/codeSign/signResult.d.ts +26 -0
  24. package/dist/codeSign/signResult.d.ts.map +1 -0
  25. package/dist/codeSign/signResult.js +12 -0
  26. package/dist/codeSign/signResult.js.map +1 -0
  27. package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
  28. package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
  29. package/dist/codeSign/win/hsmSignManager.js +50 -0
  30. package/dist/codeSign/win/hsmSignManager.js.map +1 -0
  31. package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
  32. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
  33. package/dist/codeSign/win/pkcs11SignManager.js +82 -0
  34. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
  35. package/dist/codeSign/win/signManager.d.ts +17 -0
  36. package/dist/codeSign/win/signManager.d.ts.map +1 -0
  37. package/dist/codeSign/win/signManager.js +19 -0
  38. package/dist/codeSign/win/signManager.js.map +1 -0
  39. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +95 -0
  40. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
  41. package/dist/codeSign/win/signtoolBaseSignManager.js +507 -0
  42. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
  43. package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
  44. package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
  45. package/dist/codeSign/win/windowsCodeSign.js +22 -8
  46. package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
  47. package/dist/codeSign/win/windowsSignAzureManager.d.ts +11 -4
  48. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  49. package/dist/codeSign/win/windowsSignAzureManager.js +142 -37
  50. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  51. package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
  52. package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
  53. package/dist/codeSign/win/windowsSignToolManager.js +3 -363
  54. package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
  55. package/dist/configuration.d.ts +228 -163
  56. package/dist/configuration.d.ts.map +1 -1
  57. package/dist/configuration.js +11 -1
  58. package/dist/configuration.js.map +1 -1
  59. package/dist/core.d.ts +14 -0
  60. package/dist/core.d.ts.map +1 -1
  61. package/dist/core.js +11 -0
  62. package/dist/core.js.map +1 -1
  63. package/dist/electron/ElectronFramework.d.ts +3 -3
  64. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  65. package/dist/electron/ElectronFramework.js +60 -61
  66. package/dist/electron/ElectronFramework.js.map +1 -1
  67. package/dist/electron/electronArchSupport.d.ts +12 -0
  68. package/dist/electron/electronArchSupport.d.ts.map +1 -0
  69. package/dist/electron/electronArchSupport.js +58 -0
  70. package/dist/electron/electronArchSupport.js.map +1 -0
  71. package/dist/electron/electronVersion.d.ts.map +1 -1
  72. package/dist/electron/electronVersion.js +1 -11
  73. package/dist/electron/electronVersion.js.map +1 -1
  74. package/dist/electron/injectFFMPEG.js +2 -2
  75. package/dist/electron/injectFFMPEG.js.map +1 -1
  76. package/dist/electron/mac/electronMac.js +24 -35
  77. package/dist/electron/mac/electronMac.js.map +1 -1
  78. package/dist/electron/mac/electronMacUtils.d.ts +24 -0
  79. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
  80. package/dist/electron/mac/electronMacUtils.js +42 -0
  81. package/dist/electron/mac/electronMacUtils.js.map +1 -0
  82. package/dist/electron/win/electronWin.js +2 -2
  83. package/dist/electron/win/electronWin.js.map +1 -1
  84. package/dist/fileMatcher.d.ts +42 -2
  85. package/dist/fileMatcher.d.ts.map +1 -1
  86. package/dist/fileMatcher.js +246 -18
  87. package/dist/fileMatcher.js.map +1 -1
  88. package/dist/index.d.ts +11 -5
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +17 -1
  91. package/dist/index.js.map +1 -1
  92. package/dist/indexInternal.d.ts +19 -8
  93. package/dist/indexInternal.d.ts.map +1 -1
  94. package/dist/indexInternal.js +18 -7
  95. package/dist/indexInternal.js.map +1 -1
  96. package/dist/linuxPackager.d.ts.map +1 -1
  97. package/dist/linuxPackager.js +19 -1
  98. package/dist/linuxPackager.js.map +1 -1
  99. package/dist/macPackager.d.ts +31 -14
  100. package/dist/macPackager.d.ts.map +1 -1
  101. package/dist/macPackager.js +236 -147
  102. package/dist/macPackager.js.map +1 -1
  103. package/dist/node-module-collector/index.d.ts.map +1 -1
  104. package/dist/node-module-collector/index.js +47 -16
  105. package/dist/node-module-collector/index.js.map +1 -1
  106. package/dist/node-module-collector/moduleManager.d.ts +11 -2
  107. package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
  108. package/dist/node-module-collector/moduleManager.js +34 -14
  109. package/dist/node-module-collector/moduleManager.js.map +1 -1
  110. package/dist/node-module-collector/nodeModulesCollector.d.ts +47 -26
  111. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  112. package/dist/node-module-collector/nodeModulesCollector.js +157 -142
  113. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  114. package/dist/node-module-collector/packageManager.js +1 -1
  115. package/dist/node-module-collector/packageManager.js.map +1 -1
  116. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +90 -1
  117. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
  118. package/dist/node-module-collector/pnpmNodeModulesCollector.js +325 -25
  119. package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  120. package/dist/node-module-collector/types.d.ts +4 -0
  121. package/dist/node-module-collector/types.d.ts.map +1 -1
  122. package/dist/node-module-collector/types.js.map +1 -1
  123. package/dist/options/FuseOptionsV1.d.ts +137 -0
  124. package/dist/options/FuseOptionsV1.d.ts.map +1 -0
  125. package/dist/options/FuseOptionsV1.js +2 -0
  126. package/dist/options/FuseOptionsV1.js.map +1 -0
  127. package/dist/options/MsixOptions.d.ts +126 -0
  128. package/dist/options/MsixOptions.d.ts.map +1 -0
  129. package/dist/options/MsixOptions.js +2 -0
  130. package/dist/options/MsixOptions.js.map +1 -0
  131. package/dist/options/PlatformSpecificBuildOptions.d.ts +55 -9
  132. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  133. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  134. package/dist/options/SnapOptions.d.ts +23 -17
  135. package/dist/options/SnapOptions.d.ts.map +1 -1
  136. package/dist/options/SnapOptions.js.map +1 -1
  137. package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
  138. package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
  139. package/dist/options/SquirrelWindowsOptions.js.map +1 -1
  140. package/dist/options/linuxOptions.d.ts +8 -12
  141. package/dist/options/linuxOptions.d.ts.map +1 -1
  142. package/dist/options/linuxOptions.js.map +1 -1
  143. package/dist/options/macOptions.d.ts +113 -131
  144. package/dist/options/macOptions.d.ts.map +1 -1
  145. package/dist/options/macOptions.js.map +1 -1
  146. package/dist/options/pkgOptions.d.ts +1 -1
  147. package/dist/options/pkgOptions.js.map +1 -1
  148. package/dist/options/winOptions.d.ts +282 -70
  149. package/dist/options/winOptions.d.ts.map +1 -1
  150. package/dist/options/winOptions.js +12 -1
  151. package/dist/options/winOptions.js.map +1 -1
  152. package/dist/packager.d.ts +6 -1
  153. package/dist/packager.d.ts.map +1 -1
  154. package/dist/packager.js +121 -40
  155. package/dist/packager.js.map +1 -1
  156. package/dist/packagerApi.d.ts +10 -1
  157. package/dist/packagerApi.d.ts.map +1 -1
  158. package/dist/packagerApi.js.map +1 -1
  159. package/dist/platformPackager.d.ts +49 -3
  160. package/dist/platformPackager.d.ts.map +1 -1
  161. package/dist/platformPackager.js +130 -17
  162. package/dist/platformPackager.js.map +1 -1
  163. package/dist/publish/PublishManager.d.ts +36 -2
  164. package/dist/publish/PublishManager.d.ts.map +1 -1
  165. package/dist/publish/PublishManager.js +387 -23
  166. package/dist/publish/PublishManager.js.map +1 -1
  167. package/dist/publish/updateInfoBuilder.d.ts +1 -1
  168. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  169. package/dist/publish/updateInfoBuilder.js +110 -32
  170. package/dist/publish/updateInfoBuilder.js.map +1 -1
  171. package/dist/targets/ArchiveTarget.d.ts +1 -0
  172. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  173. package/dist/targets/ArchiveTarget.js +6 -3
  174. package/dist/targets/ArchiveTarget.js.map +1 -1
  175. package/dist/targets/archive.d.ts +33 -2
  176. package/dist/targets/archive.d.ts.map +1 -1
  177. package/dist/targets/archive.js +109 -29
  178. package/dist/targets/archive.js.map +1 -1
  179. package/dist/targets/blockmap/blockmap.d.ts +43 -3
  180. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  181. package/dist/targets/blockmap/blockmap.js +141 -15
  182. package/dist/targets/blockmap/blockmap.js.map +1 -1
  183. package/dist/targets/blockmap/verbatimRange.d.ts +44 -0
  184. package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -0
  185. package/dist/targets/blockmap/verbatimRange.js +117 -0
  186. package/dist/targets/blockmap/verbatimRange.js.map +1 -0
  187. package/dist/targets/differentialUpdateInfoBuilder.d.ts +28 -2
  188. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  189. package/dist/targets/differentialUpdateInfoBuilder.js +75 -6
  190. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  191. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  192. package/dist/targets/linux/FlatpakTarget.js +13 -3
  193. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  194. package/dist/targets/linux/FpmTarget.d.ts +14 -0
  195. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  196. package/dist/targets/linux/FpmTarget.js +86 -10
  197. package/dist/targets/linux/FpmTarget.js.map +1 -1
  198. package/dist/targets/linux/LinuxTargetHelper.d.ts +15 -0
  199. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  200. package/dist/targets/linux/LinuxTargetHelper.js +54 -59
  201. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  202. package/dist/targets/linux/appimage/AppImageTarget.d.ts +2 -0
  203. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  204. package/dist/targets/linux/appimage/AppImageTarget.js +16 -15
  205. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  206. package/dist/targets/linux/appimage/appImageUtil.d.ts +5 -1
  207. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  208. package/dist/targets/linux/appimage/appImageUtil.js +14 -7
  209. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  210. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  211. package/dist/targets/linux/appimage/appLauncher.js +5 -11
  212. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  213. package/dist/targets/linux/launcherScript.d.ts +32 -0
  214. package/dist/targets/linux/launcherScript.d.ts.map +1 -0
  215. package/dist/targets/linux/launcherScript.js +24 -0
  216. package/dist/targets/linux/launcherScript.js.map +1 -0
  217. package/dist/targets/linux/snap/SnapTarget.d.ts +1 -1
  218. package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -1
  219. package/dist/targets/linux/snap/SnapTarget.js +23 -1
  220. package/dist/targets/linux/snap/SnapTarget.js.map +1 -1
  221. package/dist/targets/linux/snap/core24.d.ts +30 -1
  222. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  223. package/dist/targets/linux/snap/core24.js +146 -70
  224. package/dist/targets/linux/snap/core24.js.map +1 -1
  225. package/dist/targets/linux/snap/coreCustom.d.ts +1 -1
  226. package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -1
  227. package/dist/targets/linux/snap/coreCustom.js +2 -2
  228. package/dist/targets/linux/snap/coreCustom.js.map +1 -1
  229. package/dist/targets/linux/snap/coreLegacy.d.ts +3 -3
  230. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  231. package/dist/targets/linux/snap/coreLegacy.js +12 -12
  232. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  233. package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
  234. package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
  235. package/dist/targets/linux/snap/snapCommand.js +21 -0
  236. package/dist/targets/linux/snap/snapCommand.js.map +1 -0
  237. package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
  238. package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
  239. package/dist/targets/linux/snap/snapcraft.js +11 -0
  240. package/dist/targets/linux/snap/snapcraft.js.map +1 -0
  241. package/dist/targets/linux/snap/snapcraftBuilder.d.ts +7 -1
  242. package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
  243. package/dist/targets/linux/snap/snapcraftBuilder.js +57 -20
  244. package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
  245. package/dist/targets/mac/MacTargetHelper.d.ts +146 -14
  246. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  247. package/dist/targets/mac/MacTargetHelper.js +485 -91
  248. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  249. package/dist/targets/mac/pkg.d.ts +16 -0
  250. package/dist/targets/mac/pkg.d.ts.map +1 -1
  251. package/dist/targets/mac/pkg.js +31 -5
  252. package/dist/targets/mac/pkg.js.map +1 -1
  253. package/dist/targets/targetFactory.d.ts +7 -0
  254. package/dist/targets/targetFactory.d.ts.map +1 -1
  255. package/dist/targets/targetFactory.js +28 -0
  256. package/dist/targets/targetFactory.js.map +1 -1
  257. package/dist/targets/win/AppxTarget.d.ts +1 -2
  258. package/dist/targets/win/AppxTarget.d.ts.map +1 -1
  259. package/dist/targets/win/AppxTarget.js +37 -314
  260. package/dist/targets/win/AppxTarget.js.map +1 -1
  261. package/dist/targets/win/MsiTarget.d.ts.map +1 -1
  262. package/dist/targets/win/MsiTarget.js +13 -13
  263. package/dist/targets/win/MsiTarget.js.map +1 -1
  264. package/dist/targets/win/MsixTarget.d.ts +22 -0
  265. package/dist/targets/win/MsixTarget.d.ts.map +1 -0
  266. package/dist/targets/win/MsixTarget.js +214 -0
  267. package/dist/targets/win/MsixTarget.js.map +1 -0
  268. package/dist/targets/win/nsis/Defines.d.ts +3 -0
  269. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  270. package/dist/targets/win/nsis/Defines.js.map +1 -1
  271. package/dist/targets/win/nsis/NsisTarget.d.ts +57 -3
  272. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  273. package/dist/targets/win/nsis/NsisTarget.js +252 -113
  274. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  275. package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
  276. package/dist/targets/win/nsis/WebInstallerTarget.js +23 -12
  277. package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
  278. package/dist/targets/win/nsis/nsisOptions.d.ts +56 -48
  279. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  280. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  281. package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
  282. package/dist/targets/win/nsis/nsisScriptGenerator.js +4 -3
  283. package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
  284. package/dist/targets/win/nsis/nsisUtil.d.ts +17 -2
  285. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  286. package/dist/targets/win/nsis/nsisUtil.js +143 -41
  287. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  288. package/dist/targets/win/nsis/progId.d.ts +21 -0
  289. package/dist/targets/win/nsis/progId.d.ts.map +1 -0
  290. package/dist/targets/win/nsis/progId.js +60 -0
  291. package/dist/targets/win/nsis/progId.js.map +1 -0
  292. package/dist/targets/win/winAppUtil.d.ts +115 -0
  293. package/dist/targets/win/winAppUtil.d.ts.map +1 -0
  294. package/dist/targets/win/winAppUtil.js +407 -0
  295. package/dist/targets/win/winAppUtil.js.map +1 -0
  296. package/dist/toolsets/7zip.d.ts +32 -0
  297. package/dist/toolsets/7zip.d.ts.map +1 -1
  298. package/dist/toolsets/7zip.js +39 -11
  299. package/dist/toolsets/7zip.js.map +1 -1
  300. package/dist/toolsets/appimage.d.ts +3 -3
  301. package/dist/toolsets/appimage.d.ts.map +1 -1
  302. package/dist/toolsets/appimage.js +9 -6
  303. package/dist/toolsets/appimage.js.map +1 -1
  304. package/dist/toolsets/custom.d.ts +2 -3
  305. package/dist/toolsets/custom.d.ts.map +1 -1
  306. package/dist/toolsets/custom.js +67 -149
  307. package/dist/toolsets/custom.js.map +1 -1
  308. package/dist/toolsets/fpm.d.ts.map +1 -1
  309. package/dist/toolsets/fpm.js +11 -5
  310. package/dist/toolsets/fpm.js.map +1 -1
  311. package/dist/toolsets/icons.d.ts.map +1 -1
  312. package/dist/toolsets/icons.js +17 -3
  313. package/dist/toolsets/icons.js.map +1 -1
  314. package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
  315. package/dist/toolsets/linuxToolsMac.js +17 -4
  316. package/dist/toolsets/linuxToolsMac.js.map +1 -1
  317. package/dist/toolsets/nsis.d.ts +5 -0
  318. package/dist/toolsets/nsis.d.ts.map +1 -1
  319. package/dist/toolsets/nsis.js +20 -4
  320. package/dist/toolsets/nsis.js.map +1 -1
  321. package/dist/toolsets/version.d.ts +12 -0
  322. package/dist/toolsets/version.d.ts.map +1 -0
  323. package/dist/toolsets/version.js +13 -0
  324. package/dist/toolsets/version.js.map +1 -0
  325. package/dist/toolsets/winCodeSign.d.ts +56 -3
  326. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  327. package/dist/toolsets/winCodeSign.js +125 -42
  328. package/dist/toolsets/winCodeSign.js.map +1 -1
  329. package/dist/toolsets/wine.d.ts +2 -1
  330. package/dist/toolsets/wine.d.ts.map +1 -1
  331. package/dist/toolsets/wine.js +31 -15
  332. package/dist/toolsets/wine.js.map +1 -1
  333. package/dist/util/NodeModuleCopyHelper.js +14 -6
  334. package/dist/util/NodeModuleCopyHelper.js.map +1 -1
  335. package/dist/util/appFileCopier.d.ts +52 -0
  336. package/dist/util/appFileCopier.d.ts.map +1 -1
  337. package/dist/util/appFileCopier.js +221 -21
  338. package/dist/util/appFileCopier.js.map +1 -1
  339. package/dist/util/archCompatibility.d.ts +42 -0
  340. package/dist/util/archCompatibility.d.ts.map +1 -0
  341. package/dist/util/archCompatibility.js +202 -0
  342. package/dist/util/archCompatibility.js.map +1 -0
  343. package/dist/util/checksum.d.ts +36 -0
  344. package/dist/util/checksum.d.ts.map +1 -0
  345. package/dist/util/checksum.js +48 -0
  346. package/dist/util/checksum.js.map +1 -0
  347. package/dist/util/config/config.d.ts +1 -0
  348. package/dist/util/config/config.d.ts.map +1 -1
  349. package/dist/util/config/config.js +8 -1
  350. package/dist/util/config/config.js.map +1 -1
  351. package/dist/util/config/legacyConfigGuard.d.ts +7 -0
  352. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
  353. package/dist/util/config/legacyConfigGuard.js +187 -0
  354. package/dist/util/config/legacyConfigGuard.js.map +1 -0
  355. package/dist/util/config/legacyOptions.d.ts +75 -0
  356. package/dist/util/config/legacyOptions.d.ts.map +1 -0
  357. package/dist/util/config/legacyOptions.js +399 -0
  358. package/dist/util/config/legacyOptions.js.map +1 -0
  359. package/dist/util/config/load.d.ts +2 -2
  360. package/dist/util/config/load.d.ts.map +1 -1
  361. package/dist/util/config/load.js +3 -12
  362. package/dist/util/config/load.js.map +1 -1
  363. package/dist/util/config/schemaValidator.d.ts.map +1 -1
  364. package/dist/util/config/schemaValidator.js +26 -3
  365. package/dist/util/config/schemaValidator.js.map +1 -1
  366. package/dist/util/electronGet.d.ts +30 -32
  367. package/dist/util/electronGet.d.ts.map +1 -1
  368. package/dist/util/electronGet.js +359 -129
  369. package/dist/util/electronGet.js.map +1 -1
  370. package/dist/util/flags.d.ts +5 -5
  371. package/dist/util/flags.d.ts.map +1 -1
  372. package/dist/util/flags.js +124 -16
  373. package/dist/util/flags.js.map +1 -1
  374. package/dist/util/hash.d.ts +1 -1
  375. package/dist/util/hash.d.ts.map +1 -1
  376. package/dist/util/hash.js +1 -15
  377. package/dist/util/hash.js.map +1 -1
  378. package/dist/util/installOrRebuild.d.ts +44 -0
  379. package/dist/util/installOrRebuild.d.ts.map +1 -0
  380. package/dist/util/installOrRebuild.js +276 -0
  381. package/dist/util/installOrRebuild.js.map +1 -0
  382. package/dist/util/langs.d.ts.map +1 -1
  383. package/dist/util/langs.js +1 -0
  384. package/dist/util/langs.js.map +1 -1
  385. package/dist/util/license.d.ts.map +1 -1
  386. package/dist/util/license.js +4 -1
  387. package/dist/util/license.js.map +1 -1
  388. package/dist/util/mac/macosIconComposer.d.ts +2 -1
  389. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  390. package/dist/util/mac/macosIconComposer.js +40 -58
  391. package/dist/util/mac/macosIconComposer.js.map +1 -1
  392. package/dist/util/mac/macosVersion.d.ts +0 -1
  393. package/dist/util/mac/macosVersion.d.ts.map +1 -1
  394. package/dist/util/mac/macosVersion.js +0 -3
  395. package/dist/util/mac/macosVersion.js.map +1 -1
  396. package/dist/util/mac/plist.d.ts +1 -1
  397. package/dist/util/mac/plist.d.ts.map +1 -1
  398. package/dist/util/mac/plist.js +5 -0
  399. package/dist/util/mac/plist.js.map +1 -1
  400. package/dist/util/nativeBinaryVerifier.d.ts +40 -0
  401. package/dist/util/nativeBinaryVerifier.d.ts.map +1 -0
  402. package/dist/util/nativeBinaryVerifier.js +381 -0
  403. package/dist/util/nativeBinaryVerifier.js.map +1 -0
  404. package/dist/util/packageMetadata.js +57 -31
  405. package/dist/util/packageMetadata.js.map +1 -1
  406. package/dist/util/repositoryInfo.js +6 -3
  407. package/dist/util/repositoryInfo.js.map +1 -1
  408. package/dist/util/resolve.js +1 -1
  409. package/dist/util/resolve.js.map +1 -1
  410. package/dist/util/streamSpawnToFile.d.ts +47 -0
  411. package/dist/util/streamSpawnToFile.d.ts.map +1 -0
  412. package/dist/util/streamSpawnToFile.js +110 -0
  413. package/dist/util/streamSpawnToFile.js.map +1 -0
  414. package/dist/util/toolsetLock.d.ts +2 -0
  415. package/dist/util/toolsetLock.d.ts.map +1 -1
  416. package/dist/util/toolsetLock.js +31 -5
  417. package/dist/util/toolsetLock.js.map +1 -1
  418. package/dist/version.d.ts +1 -1
  419. package/dist/version.d.ts.map +1 -1
  420. package/dist/version.js +1 -1
  421. package/dist/version.js.map +1 -1
  422. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  423. package/dist/vm/ParallelsVm.js +29 -3
  424. package/dist/vm/ParallelsVm.js.map +1 -1
  425. package/dist/vm/vm.d.ts +2 -0
  426. package/dist/vm/vm.d.ts.map +1 -1
  427. package/dist/vm/vm.js +29 -6
  428. package/dist/vm/vm.js.map +1 -1
  429. package/dist/winPackager.d.ts +6 -5
  430. package/dist/winPackager.d.ts.map +1 -1
  431. package/dist/winPackager.js +45 -39
  432. package/dist/winPackager.js.map +1 -1
  433. package/package.json +19 -18
  434. package/scheme.json +1731 -961
  435. package/templates/appx/appxmanifest.xml +2 -3
  436. package/templates/entitlements.mac.adhoc.plist +15 -0
  437. package/templates/entitlements.mac.plist +9 -6
  438. package/templates/msix/appxmanifest.xml +45 -0
  439. package/templates/nsis/assistedMessages.yml +17 -0
  440. package/templates/nsis/common.nsh +2 -2
  441. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +96 -13
  442. package/templates/nsis/include/extractAppPackage.nsh +5 -2
  443. package/templates/nsis/include/installUtil.nsh +2 -2
  444. package/templates/nsis/include/installer.nsh +88 -50
  445. package/templates/nsis/include/webPackage.nsh +52 -27
  446. package/templates/nsis/installSection.nsh +29 -0
  447. package/templates/nsis/installer.nsi +1 -1
  448. package/templates/nsis/messages.yml +5 -0
  449. package/templates/nsis/multiUserUi.nsh +1 -1
  450. package/dist/codeSign/signManager.d.ts +0 -14
  451. package/dist/codeSign/signManager.d.ts.map +0 -1
  452. package/dist/codeSign/signManager.js +0 -2
  453. package/dist/codeSign/signManager.js.map +0 -1
  454. package/dist/util/yarn.d.ts +0 -23
  455. package/dist/util/yarn.d.ts.map +0 -1
  456. package/dist/util/yarn.js +0 -153
  457. package/dist/util/yarn.js.map +0 -1
@@ -1,16 +1,18 @@
1
- import { Arch, asArray, AsyncTaskManager, exists, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml } from "builder-util";
2
- import { getS3LikeProviderBaseUrl, githubTagPrefix, githubUrl, } from "builder-util-runtime";
1
+ import { Arch, asArray, AsyncTaskManager, derivePublicKeyPem, exists, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml, } from "builder-util";
2
+ import { computeUpdateManifestKeyId, getS3LikeProviderBaseUrl, githubTagPrefix, githubUrl, normalizePublicKeyList, } from "builder-util-runtime";
3
3
  import _debug from "debug";
4
- import { BitbucketPublisher, getCiTag, GitHubPublisher, GitlabPublisher, KeygenPublisher, S3Publisher, SnapStorePublisher, SpacesPublisher, } from "electron-publish";
4
+ import { BitbucketPublisher, getCiTag, GitHubPublisher, GitlabPublisher, KeygenPublisher, R2Publisher, S3Publisher, SnapStorePublisher, SpacesPublisher, } from "electron-publish";
5
5
  import { MultiProgress } from "electron-publish/internal";
6
- import { readFile, writeFile } from "fs/promises";
6
+ import { readFile } from "fs/promises";
7
+ import _fsExtra from "fs-extra";
8
+ const { outputFile } = _fsExtra;
7
9
  import * as path from "path";
8
10
  import { Platform } from "../core.js";
9
11
  import { createUpdateInfoTasks, writeUpdateInfoFiles } from "./updateInfoBuilder.js";
10
12
  import { resolveModule } from "../util/resolve.js";
11
13
  import { parseUrl } from "../util/pathManager.js";
12
14
  import { isPublishForPullRequest } from "../util/flags.js";
13
- const publishForPrWarning = "There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)" +
15
+ const publishForPrWarning = "There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/guides/integration/oss/#pass-secrets-to-builds-from-forked-pull-requests) for details)" +
14
16
  "\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.";
15
17
  const debug = _debug("electron-builder:publish");
16
18
  function checkOptions(publishPolicy) {
@@ -20,6 +22,64 @@ function checkOptions(publishPolicy) {
20
22
  }
21
23
  }
22
24
  }
25
+ /** Emitted once per feed (the url without its query) per process — app-update.yml is written for every pack, and platforms may use different feeds. */
26
+ const feedQueryWarnedFeeds = new Set();
27
+ /**
28
+ * electron-updater 7 adds the query string of a generic feed url (typically a token), like the credential headers, only to
29
+ * downloads on the feed's origin. An app whose latest*.yml points downloads at another origin that relies on that query gets
30
+ * 401/403 at update time, inside a shipped app, with nothing at build time saying why — `migrate-schema` prints the same advisory,
31
+ * but cannot be relied on to have been run. Only the query parameter names are logged, never the url or the values.
32
+ *
33
+ * @internal exported for tests
34
+ */
35
+ export function warnAboutGenericFeedQuery(publishConfig) {
36
+ const url = publishConfig.provider === "generic" ? publishConfig.url : null;
37
+ const queryStart = typeof url === "string" ? url.indexOf("?") : -1;
38
+ if (queryStart < 0) {
39
+ return;
40
+ }
41
+ const feed = url.slice(0, queryStart);
42
+ if (feedQueryWarnedFeeds.has(feed)) {
43
+ return;
44
+ }
45
+ feedQueryWarnedFeeds.add(feed);
46
+ const queryParameters = [...new Set(new URLSearchParams(url.slice(queryStart + 1).split("#")[0]).keys())];
47
+ log.warn({
48
+ queryParameters: queryParameters.length === 0 ? "(none)" : queryParameters.join(", "),
49
+ solution: "serve the update files from the feed origin (relative files[].url, the default) or use pre-signed URLs",
50
+ }, "the generic publish url has a query string. electron-updater 7 (electron-builder v27) adds it, and sends the credential headers from requestHeaders / addAuthHeader, " +
51
+ "only to downloads on the feed's origin (scheme, host and port): a download url in latest*.yml on another origin is requested without them. " +
52
+ "Nothing changes for the relative URLs electron-builder writes. " +
53
+ "See https://www.electron.build/docs/migration/v27-breaking-changes#update-credentials-stay-on-the-feeds-origin");
54
+ }
55
+ /** @internal exported for tests — re-arms the once-per-feed warning. */
56
+ export function resetGenericFeedQueryWarning() {
57
+ feedQueryWarnedFeeds.clear();
58
+ }
59
+ /**
60
+ * v26 published implicitly when it detected a CI tag; v27 requires an explicit `--publish` policy.
61
+ * Without a signal, a tagged release pipeline goes green and uploads nothing — the build looks
62
+ * identical to a successful publish. Only warns when the project actually looks like it wanted to
63
+ * publish (a tag is present and a publish target is configured), so ordinary local builds stay quiet.
64
+ */
65
+ function warnIfImplicitPublishExpected(packager) {
66
+ const tag = getCiTag();
67
+ if (tag == null) {
68
+ return;
69
+ }
70
+ const config = packager.config;
71
+ const hasPublishConfig = config.publish != null ||
72
+ ["mac", "win", "linux"].some(platform => {
73
+ const platformConfig = config[platform];
74
+ return platformConfig != null && platformConfig.publish != null;
75
+ });
76
+ if (!hasPublishConfig) {
77
+ return;
78
+ }
79
+ log.warn({ tag, solution: "pass --publish <always|onTag|onTagOrDraft|never>, or set the `publish` policy in your build configuration" }, "a publish configuration and a CI tag are present, but no publish policy was given — nothing will be uploaded. " +
80
+ "electron-builder v27 removed implicit publishing (v26 auto-published when it detected a CI tag). " +
81
+ "See https://www.electron.build/docs/migration/v27-breaking-changes#implicit-publish-removed");
82
+ }
23
83
  export class PublishManager {
24
84
  constructor(packager, publishOptions, cancellationToken = packager.cancellationToken) {
25
85
  this.packager = packager;
@@ -38,6 +98,9 @@ export class PublishManager {
38
98
  if (this.isPublish && forcePublishForPr) {
39
99
  log.warn(publishForPrWarning);
40
100
  }
101
+ if (publishPolicy == null) {
102
+ warnIfImplicitPublishExpected(packager);
103
+ }
41
104
  }
42
105
  else if (publishOptions.publish !== "never") {
43
106
  log.info({
@@ -45,6 +108,7 @@ export class PublishManager {
45
108
  solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\n${publishForPrWarning}`,
46
109
  }, "publishing will be skipped");
47
110
  }
111
+ packager.onTargetsCreated(plan => this.requireSigningKeysForPlannedTargets(plan));
48
112
  packager.onAfterPack(async (event) => {
49
113
  const packager = event.packager;
50
114
  if (event.electronPlatformName === "darwin") {
@@ -57,9 +121,20 @@ export class PublishManager {
57
121
  return;
58
122
  }
59
123
  }
60
- const publishConfig = await getAppUpdatePublishConfiguration(packager, null, event.arch, this.isPublish);
124
+ // app-update.yml is written for every pack, from the publish settings of the pack's targets that emit a manifest
125
+ // (see resolvePackAppUpdatePublishConfigs) - so a manifest signed under a target-level `publish` always ships with
126
+ // the key that verifies it, except when the pack's targets disagree about the feed (an error when publishing, a
127
+ // warning and no app-update.yml otherwise). The signing requirement (the error when publishing, the advisory
128
+ // otherwise) only applies when a target emits a manifest - the same per-target resolution as the build-start
129
+ // preflight. A snap-, flatpak- or mas-only pack has none (Linux and mas are not filtered above), nor has an
130
+ // installer whose target-level `publish` is `null` or waived.
131
+ const { publishConfigs, emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, event.targets, event.arch, this.isPublish);
132
+ if (emitsManifest) {
133
+ await packager.requireUpdateSigningKeys(this.isPublish);
134
+ }
135
+ const publishConfig = await createAppUpdateConfiguration(packager, publishConfigs, this.isPublish, false);
61
136
  if (publishConfig != null) {
62
- await writeFile(path.join(packager.getResourcesDir(event.appOutDir), "app-update.yml"), serializeToYaml(publishConfig));
137
+ await writeAppUpdateYaml(packager.getResourcesDir(event.appOutDir), publishConfig);
63
138
  }
64
139
  });
65
140
  packager.onArtifactCreated(async (event) => {
@@ -75,6 +150,30 @@ export class PublishManager {
75
150
  }
76
151
  });
77
152
  }
153
+ /**
154
+ * Build-start preflight: enforces update-manifest signing for every target of every platform and arch that will
155
+ * emit update info, before anything is packed. The per-artifact check in artifactCreatedWithoutExplicitPublishConfig
156
+ * only stops that artifact's own upload; by then an earlier target (a portable exe, another arch, another platform)
157
+ * may already be uploading. Same resolution as the per-artifact path - target-level `publish` first, `null` means
158
+ * none, `publishAutoUpdate: false` on every provider waives it - which stays in place for targets that do not
159
+ * declare `writesUpdateInfo`. Each planned platform x arch is one pack, so targets of a pack that disagree about the
160
+ * app-update.yml feed fail here too, before anything is packed (also for a prepackaged app, which has no afterPack).
161
+ */
162
+ async requireSigningKeysForPlannedTargets(plan) {
163
+ if (!this.isPublish) {
164
+ return;
165
+ }
166
+ for (const { packager, arch, targets } of plan) {
167
+ // resolving publish configs is async: a build cancelled meanwhile stops instead of failing on a missing key
168
+ if (this.cancellationToken.cancelled) {
169
+ return;
170
+ }
171
+ const { emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, true);
172
+ if (emitsManifest && !this.cancellationToken.cancelled) {
173
+ await packager.requireUpdateSigningKeys(true);
174
+ }
175
+ }
176
+ }
78
177
  getAppInfo(platformPackager) {
79
178
  return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo;
80
179
  }
@@ -119,7 +218,17 @@ export class PublishManager {
119
218
  }
120
219
  return;
121
220
  }
221
+ const writesUpdateInfo = event.isWriteUpdateInfo === true && target != null && eventFile != null && (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target));
122
222
  if (this.isPublish) {
223
+ // Enforce the signing requirement before this artifact is uploaded, not only in writeUpdateInfoFiles, which runs
224
+ // after every upload has been awaited. The build-start preflight and onAfterPack already fail early for targets
225
+ // that declare `writesUpdateInfo`; this also covers a custom target that emits update info without declaring it.
226
+ if (writesUpdateInfo) {
227
+ const updateInfoConfigs = await getPublishConfigsForUpdateInfo(platformPackager, publishConfigs, event.arch);
228
+ if (updateInfoConfigs?.some(it => it.publishAutoUpdate !== false)) {
229
+ await platformPackager.requireUpdateSigningKeys(true);
230
+ }
231
+ }
123
232
  for (const publishConfig of publishConfigs) {
124
233
  if (this.cancellationToken.cancelled) {
125
234
  log.debug({ file: event.file, reason: "cancelled" }, "not published");
@@ -128,22 +237,25 @@ export class PublishManager {
128
237
  await this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager));
129
238
  }
130
239
  }
131
- if (event.isWriteUpdateInfo &&
132
- target != null &&
133
- eventFile != null &&
134
- !this.cancellationToken.cancelled &&
135
- (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target))) {
240
+ if (writesUpdateInfo && !this.cancellationToken.cancelled) {
136
241
  this.taskManager.addTask(createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)));
137
242
  }
138
243
  }
139
- async getOrCreatePublisher(publishConfig, appInfo) {
244
+ getOrCreatePublisher(publishConfig, appInfo) {
140
245
  // to not include token into cache key
141
246
  const providerCacheKey = safeStringifyJson(publishConfig);
142
247
  let publisher = this.nameToPublisher.get(providerCacheKey);
143
248
  if (publisher == null) {
144
- publisher = await createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager);
249
+ publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager).then(it => {
250
+ if (it != null) {
251
+ log.info({ publisher: it.toString() }, "publishing");
252
+ }
253
+ return it;
254
+ });
255
+ // cache the pending promise synchronously — concurrent scheduleUpload calls must share one publisher (and thus one release) instead of racing to create duplicates
145
256
  this.nameToPublisher.set(providerCacheKey, publisher);
146
- log.info({ publisher: publisher.toString() }, "publishing");
257
+ // on failure, evict so that a subsequent call can retry (the rejection still propagates to the caller)
258
+ publisher.catch(() => this.nameToPublisher.delete(providerCacheKey));
147
259
  }
148
260
  return publisher;
149
261
  }
@@ -158,12 +270,136 @@ export class PublishManager {
158
270
  if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {
159
271
  return;
160
272
  }
161
- await writeUpdateInfoFiles(updateInfoFileTasks, this.packager);
273
+ await writeUpdateInfoFiles(updateInfoFileTasks, this.packager, this.isPublish);
162
274
  await this.taskManager.awaitTasks();
163
275
  }
164
276
  }
165
- export async function getAppUpdatePublishConfiguration(packager, targetSpecificOptions, arch, errorIfCannot) {
166
- const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, errorIfCannot), arch);
277
+ /**
278
+ * The `app-update.yml` config for a single target with the given target-specific options (`null` for none): the
279
+ * target's own publish settings when it emits a manifest under them, otherwise the platform/root ones - the rule of
280
+ * {@link getPackAppUpdatePublishConfiguration} for a pack of one target.
281
+ */
282
+ export async function getAppUpdatePublishConfiguration(packager, targetSpecificOptions, arch,
283
+ /**
284
+ * Whether this is the publish path. Gates both publish-credential resolution and the update-manifest signing
285
+ * requirement. The Linux targets that write `app-update.yml` into the package pass `false`, since for them
286
+ * "validation will be done on publish step" - and that is exactly when signing is enforced too.
287
+ */
288
+ isPublish,
289
+ /**
290
+ * Set when the caller has already applied the signing requirement for the targets this config is embedded for;
291
+ * the configs resolved here then only decide the embedded trust list, and neither enforce nor warn.
292
+ */
293
+ signingRequirementApplied = false) {
294
+ const own = await getEmittingUpdateInfoPublishConfigs(packager, targetSpecificOptions, arch, isPublish);
295
+ const publishConfigs = own ?? (await getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish));
296
+ return await createAppUpdateConfiguration(packager, publishConfigs, isPublish, own != null && !signingRequirementApplied);
297
+ }
298
+ /**
299
+ * The `app-update.yml` config of a packed app dir, which every target built from it ships: see
300
+ * {@link resolvePackAppUpdatePublishConfigs}. Used by the targets that (re)write the file themselves (AppImage,
301
+ * deb/rpm/pacman), so they embed the same feed as PublishManager's afterPack handler - or, for a prepackaged app, any
302
+ * feed at all - and do not race each other with different content.
303
+ */
304
+ export async function getPackAppUpdatePublishConfiguration(packager, targets, arch, isPublish) {
305
+ const { publishConfigs, emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPublish);
306
+ return await createAppUpdateConfiguration(packager, publishConfigs, isPublish, emitsManifest);
307
+ }
308
+ /**
309
+ * The publish configs whose first provider becomes the `app-update.yml` shared by all targets of one pack (for a
310
+ * manifest-emitting target, the first provider that receives its manifest - see getEmittingUpdateInfoPublishConfigs):
311
+ *
312
+ * - the targets that emit a manifest (`writesUpdateInfo`, and on Windows an electron-updater-aware one) under their
313
+ * own effective publish settings - target-level `publish` first, then platform, then root - decide it;
314
+ * - if several do, their first providers must be the same feed ({@link appUpdateFeedIdentity}: publish-only options
315
+ * may differ): one app dir holds one `app-update.yml`, so otherwise some installs would poll a feed that never
316
+ * receives their manifest. That is a configuration error;
317
+ * - with none (a snap-only pack, or `nsis.publish: null`), it comes from the platform/root settings, as before -
318
+ * including the GitHub fallback from repository info when no level configures `publish` at all.
319
+ *
320
+ * `emitsManifest` tells whether any target of the pack emits one, i.e. whether the signing requirement applies.
321
+ */
322
+ async function resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPublish) {
323
+ const writers = [];
324
+ for (const target of targets) {
325
+ const publishConfigs = await getTargetManifestPublishConfigs(packager, target, arch, isPublish);
326
+ if (publishConfigs != null) {
327
+ writers.push({ target, publishConfigs });
328
+ }
329
+ }
330
+ if (writers.length === 0) {
331
+ return { publishConfigs: await getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish), emitsManifest: false };
332
+ }
333
+ const embedded = appUpdateFeedIdentity(writers[0].publishConfigs[0]);
334
+ if (writers.some(it => appUpdateFeedIdentity(it.publishConfigs[0]) !== embedded)) {
335
+ reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish);
336
+ // not publishing: no app-update.yml, the same package the error would have prevented - picking one of the feeds
337
+ // would silently ship installs that poll a feed without their manifest
338
+ return { publishConfigs: null, emitsManifest: true };
339
+ }
340
+ return { publishConfigs: writers[0].publishConfigs, emitsManifest: true };
341
+ }
342
+ // keyed by platform packager (one per platform and build): afterPack and the targets writing app-update.yml themselves
343
+ // resolve the same pack, and every arch usually repeats the same conflict - report each one once
344
+ const reportedFeedConflicts = new WeakMap();
345
+ /**
346
+ * Targets of one pack resolve different app-update.yml feeds: an InvalidConfigurationError when publishing, otherwise
347
+ * a warning that says so, so the misconfiguration surfaces before a release is built with it.
348
+ */
349
+ function reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish) {
350
+ const targets = writers.map(it => `"${it.target.name}"`).join(", ");
351
+ const feeds = writers.map(it => `${it.target.name} -> ${it.publishConfigs[0]?.provider ?? "none"}`).join(", ");
352
+ const problem = `targets ${targets} are built from the same ${packager.platform.name} ${Arch[arch]} app, which holds a single app-update.yml, ` +
353
+ `but their publish settings resolve to different auto-update feeds (${feeds}; the first provider of each that receives the manifest is embedded)`;
354
+ const solution = `configure \`publish\` once at the platform level (\`${packager.platform.buildConfigurationKey}.publish\`) and remove the target-level overrides, or point their first providers at the same feed`;
355
+ if (isPublish) {
356
+ throw new InvalidConfigurationError(`${problem}. To fix it, ${solution}.`);
357
+ }
358
+ let reported = reportedFeedConflicts.get(packager);
359
+ if (reported == null) {
360
+ reported = new Set();
361
+ reportedFeedConflicts.set(packager, reported);
362
+ }
363
+ if (reported.has(feeds)) {
364
+ return;
365
+ }
366
+ reported.add(feeds);
367
+ log.warn({ solution }, `${problem}. No app-update.yml is written, so installed apps get neither an update feed nor the update-manifest public key. ` +
368
+ "Publishing this configuration fails with an InvalidConfigurationError.");
369
+ }
370
+ // Options that only the publisher reads (the upload itself), never electron-updater, so they cannot make two otherwise
371
+ // identical first providers different feeds. Everything else is compared - including fields of custom providers and
372
+ // options such as `requestHeaders`, `token` or `private` that change how or whether the updater can read the feed.
373
+ const PUBLISH_ONLY_OPTIONS = new Set(["publishAutoUpdate", "timeout"]);
374
+ const S3_PUBLISH_ONLY_OPTIONS = new Set(["acl", "storageClass", "encryption"]);
375
+ /**
376
+ * What makes two first providers the same app-update.yml feed: the provider and every option that decides where, or
377
+ * how, electron-updater reads the manifest (url, bucket, region, path, owner, repo, channel, ...). Publish-only options
378
+ * and unset (nullish) values are left out, and key order does not matter - so `publishAutoUpdate: true` against an
379
+ * absent flag is the same feed, a different url or bucket is not.
380
+ */
381
+ function appUpdateFeedIdentity(config) {
382
+ if (config == null) {
383
+ return "null";
384
+ }
385
+ const isS3Like = config.provider === "s3" || config.provider === "spaces" || config.provider === "r2";
386
+ const identity = Object.fromEntries(Object.entries(config).filter(([key, value]) => value != null && !PUBLISH_ONLY_OPTIONS.has(key) && !(isS3Like && S3_PUBLISH_ONLY_OPTIONS.has(key))));
387
+ // key order does not make two configs different feeds
388
+ return JSON.stringify(identity, (_key, value) => value != null && typeof value === "object" && !Array.isArray(value)
389
+ ? Object.fromEntries(Object.keys(value)
390
+ .sort()
391
+ .map(key => [key, value[key]]))
392
+ : value);
393
+ }
394
+ async function getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish) {
395
+ return await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, isPublish), arch);
396
+ }
397
+ /**
398
+ * The embedded `app-update.yml` config (first provider, updater cache dir, Windows publisher name, manifest trust
399
+ * list) for already-resolved publish configs. `requireSigning` applies the update-manifest signing requirement
400
+ * (error when publishing, advisory otherwise) before the trust list is derived.
401
+ */
402
+ async function createAppUpdateConfiguration(packager, publishConfigs, isPublish, requireSigning) {
167
403
  if (publishConfigs == null || publishConfigs.length === 0) {
168
404
  return null;
169
405
  }
@@ -171,6 +407,7 @@ export async function getAppUpdatePublishConfiguration(packager, targetSpecificO
171
407
  ...publishConfigs[0],
172
408
  updaterCacheDirName: packager.appInfo.updaterCacheDirName,
173
409
  };
410
+ warnAboutGenericFeedQuery(publishConfig);
174
411
  if (packager.platform === Platform.WINDOWS && publishConfig.publisherName == null) {
175
412
  const winPackager = packager;
176
413
  const publisherName = winPackager.isForceCodeSigningVerification ? await (await winPackager.signingManager.value).computedPublisherName.value : undefined;
@@ -178,8 +415,67 @@ export async function getAppUpdatePublishConfiguration(packager, targetSpecificO
178
415
  publishConfig.publisherName = publisherName;
179
416
  }
180
417
  }
418
+ // Embed the update-manifest trust list so the updater can verify signed manifests. An explicit
419
+ // `publicKey` list wins as-is; otherwise the public half of every configured signing key is derived
420
+ // so the user only manages the secrets. One key is written as a plain string (byte-identical to the
421
+ // single-key format), several as a YAML list.
422
+ const updateManifestConfig = packager.updateManifestOptions;
423
+ // `updateManifestPublicKey` is only ever assigned right below, on this fresh copy, so a value that is
424
+ // already present can only have come from the user's `publish` configuration. Rejecting it (rather than
425
+ // taking it as-is) keeps the trust list on the single validated path and stops a stale hand-copied key
426
+ // from silently shadowing the derived one.
427
+ if (publishConfig.updateManifestPublicKey != null) {
428
+ throw new InvalidConfigurationError("publish.updateManifestPublicKey is managed by electron-builder and must not be set; configure updateManifest.publicKey instead");
429
+ }
430
+ // The very same keys updateInfoBuilder signs `latest*.yml` with, so env-var-only signing
431
+ // (no `updateManifest` config block) embeds the matching public keys too, and the two sides
432
+ // cannot disagree about whether signing is enabled.
433
+ // Whether the requirement applies was decided by the caller from the manifest-emitting targets (a publish target
434
+ // with `publishAutoUpdate: false` on every provider emits none, so it is waived there) - the trust list is still
435
+ // embedded if keys happen to be configured. Only app-update.yml is limited to the first provider:
436
+ // createUpdateInfoTasks writes a manifest for every configured one, so the waiver must hold for all of them.
437
+ const signingKeys = requireSigning ? await packager.requireUpdateSigningKeys(isPublish) : await packager.updateSigningKeys.value;
438
+ // `false` is the opt-out and carries no config object to read `publicKey` from
439
+ const explicitKeys = updateManifestConfig === false ? [] : normalizeExplicitPublicKeys(updateManifestConfig?.publicKey);
440
+ const trustedKeys = explicitKeys.length > 0 ? explicitKeys : signingKeys.map(derivePublicKeyPem);
441
+ if (trustedKeys.length > 0) {
442
+ publishConfig.updateManifestPublicKey = trustedKeys.length === 1 ? trustedKeys[0] : trustedKeys;
443
+ }
444
+ if (signingKeys.length > 0 && explicitKeys.length > 0) {
445
+ const trustedIds = new Set(trustedKeys.map(computeUpdateManifestKeyId));
446
+ if (!signingKeys.some(key => trustedIds.has(computeUpdateManifestKeyId(key)))) {
447
+ log.warn({ platform: packager.platform.name, trustedKeys: trustedKeys.length }, "none of the update-manifest signing keys is in updateManifest.publicKey: installs of this release will not be able to verify manifests signed with the current key(s). " +
448
+ "Intended only for a deliberate bridge release; otherwise add the current public key to updateManifest.publicKey.");
449
+ }
450
+ }
181
451
  return publishConfig;
182
452
  }
453
+ /**
454
+ * Normalizes the configured `updateManifest.publicKey` (string, multi-PEM string, or array) into distinct,
455
+ * validated Ed25519 public keys, preserving order. Duplicates and non-Ed25519 keys are configuration errors.
456
+ */
457
+ function normalizeExplicitPublicKeys(value) {
458
+ const keys = normalizePublicKeyList(value);
459
+ const seen = new Map();
460
+ keys.forEach((key, index) => {
461
+ let keyId;
462
+ try {
463
+ keyId = computeUpdateManifestKeyId(key);
464
+ }
465
+ catch (e) {
466
+ throw new InvalidConfigurationError(`updateManifest.publicKey #${index + 1} is not a valid Ed25519 public key: ${e.message || e}`);
467
+ }
468
+ const previous = seen.get(keyId);
469
+ if (previous != null) {
470
+ throw new InvalidConfigurationError(`updateManifest.publicKey #${index + 1} duplicates entry #${previous + 1} (key id ${keyId}). List each trusted key once.`);
471
+ }
472
+ seen.set(keyId, index);
473
+ });
474
+ return keys;
475
+ }
476
+ export async function writeAppUpdateYaml(resourcesDir, publishConfig) {
477
+ await outputFile(path.join(resourcesDir, "app-update.yml"), serializeToYaml(publishConfig));
478
+ }
183
479
  export async function getPublishConfigsForUpdateInfo(packager, publishConfigs, arch) {
184
480
  if (publishConfigs === null) {
185
481
  return null;
@@ -265,6 +561,8 @@ async function requireProviderClass(provider, packager) {
265
561
  return SnapStorePublisher;
266
562
  case "spaces":
267
563
  return SpacesPublisher;
564
+ case "r2":
565
+ return R2Publisher;
268
566
  case "bitbucket":
269
567
  return BitbucketPublisher;
270
568
  default: {
@@ -361,6 +659,29 @@ async function resolvePublishConfigurations(publishers, platformPackager, arch,
361
659
  debug(`Explicit publish provider: ${safeStringifyJson(publishers)}`);
362
660
  return (await Promise.all(asArray(publishers).map(it => getResolvedPublishConfig(platformPackager, typeof it === "string" ? { provider: it } : it, arch, errorIfCannot, fallbackPackager))));
363
661
  }
662
+ /**
663
+ * The update-info publish configs `target` emits an auto-update manifest for under its own effective publish settings,
664
+ * else `null`: target-level `publish` first, `null` means none, and `publishAutoUpdate: false` on every provider means
665
+ * no manifest.
666
+ */
667
+ async function getTargetManifestPublishConfigs(packager, target, arch, errorIfCannot) {
668
+ if (!target.writesUpdateInfo || (packager.platform === Platform.WINDOWS && !isSuitableWindowsTarget(target))) {
669
+ return null;
670
+ }
671
+ return await getEmittingUpdateInfoPublishConfigs(packager, target.options, arch, errorIfCannot);
672
+ }
673
+ /**
674
+ * The update-info publish configs that receive a manifest, resolved for the given target-specific options (target,
675
+ * then platform, then root; GitHub from repository info when none configures `publish`), or `null` when they emit
676
+ * none: `publish: null`, or `publishAutoUpdate: false` on every provider. Providers with `publishAutoUpdate: false`
677
+ * are left out - writeUpdateInfoFiles writes no `latest*.yml` for them - so the first provider, the one embedded in
678
+ * app-update.yml, is always one the manifest is uploaded to.
679
+ */
680
+ async function getEmittingUpdateInfoPublishConfigs(packager, targetSpecificOptions, arch, errorIfCannot) {
681
+ const updateInfoConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, targetSpecificOptions, arch, errorIfCannot), arch);
682
+ const emitting = updateInfoConfigs?.filter(it => it.publishAutoUpdate !== false) ?? [];
683
+ return emitting.length === 0 ? null : emitting;
684
+ }
364
685
  function isSuitableWindowsTarget(target) {
365
686
  if (target.name === "appx" && target.options != null && target.options.electronUpdaterAware) {
366
687
  return true;
@@ -383,6 +704,44 @@ function isDetectUpdateChannel(platformSpecificConfiguration, configuration) {
383
704
  const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel;
384
705
  return value == null ? configuration.detectUpdateChannel !== false : value;
385
706
  }
707
+ // keyed by the build's CancellationToken (one instance per Packager) so that a build reports a given feed once - getResolvedPublishConfig
708
+ // is called per target and arch - without leaking state between programmatic builds running in the same process
709
+ const reportedInferredUpdateFeeds = new WeakMap();
710
+ /** @internal */
711
+ export function parseGithubRepoShorthand(repo) {
712
+ const separator = repo.indexOf("/");
713
+ return separator > 0 ? { owner: repo.substring(0, separator), repo: repo.substring(separator + 1) } : null;
714
+ }
715
+ // the inferred repository becomes the publish/update destination and, for auto-update-capable targets, is written
716
+ // verbatim into app-update.yml inside every shipped build as its permanent update feed - so the developer has to be
717
+ // told which repository they are committing to. A repository taken from package.json "repository" is deliberate
718
+ // configuration (info); one picked up from the CI environment or .git/config is not (warn).
719
+ function logInferredUpdateFeed(buildId, provider, owner, project, source, inferredFields) {
720
+ let reported = reportedInferredUpdateFeeds.get(buildId);
721
+ if (reported == null) {
722
+ reported = new Set();
723
+ reportedInferredUpdateFeeds.set(buildId, reported);
724
+ }
725
+ const feed = `${provider}:${owner}/${project}`;
726
+ if (reported.has(feed)) {
727
+ return;
728
+ }
729
+ reported.add(feed);
730
+ const fields = {
731
+ reason: `${inferredFields.join(" and ")} not specified in the publish configuration`,
732
+ source: source ?? "unknown",
733
+ provider,
734
+ owner,
735
+ ...(provider === "bitbucket" ? { slug: project } : { repo: project }),
736
+ };
737
+ const message = "update feed inferred from repository info; it will be used as the publish/update destination (written to app-update.yml in auto-update-capable targets) - specify it explicitly to be sure it stays under your control";
738
+ if (source === "package.json") {
739
+ log.info(fields, message);
740
+ }
741
+ else {
742
+ log.warn(fields, message);
743
+ }
744
+ }
386
745
  async function getResolvedPublishConfig(platformPackager, options, arch, errorIfCannot, fallbackPackager) {
387
746
  options = { ...options };
388
747
  expandPublishConfig(options, platformPackager, arch);
@@ -421,11 +780,10 @@ async function getResolvedPublishConfig(platformPackager, options, arch, errorIf
421
780
  let owner = isGithub ? options.owner : options.owner;
422
781
  let project = isGithub ? options.repo : options.slug;
423
782
  if (isGithub && owner == null && project != null) {
424
- const index = project.indexOf("/");
425
- if (index > 0) {
426
- const repo = project;
427
- project = repo.substring(0, index);
428
- owner = repo.substring(index + 1);
783
+ const shorthand = parseGithubRepoShorthand(project);
784
+ if (shorthand != null) {
785
+ owner = shorthand.owner;
786
+ project = shorthand.repo;
429
787
  }
430
788
  }
431
789
  async function getInfo() {
@@ -448,22 +806,28 @@ async function getResolvedPublishConfig(platformPackager, options, arch, errorIf
448
806
  if (info == null) {
449
807
  return null;
450
808
  }
809
+ const inferredFields = [];
451
810
  if (!owner) {
452
811
  owner = info.user;
812
+ inferredFields.push("owner");
453
813
  }
454
814
  if (!project) {
455
815
  project = info.project;
816
+ inferredFields.push(isGithub ? "repo" : "slug");
456
817
  }
818
+ logInferredUpdateFeed(ctx.cancellationToken, provider, owner, project, info.source, inferredFields);
457
819
  }
458
820
  if (isGithub) {
459
821
  if (options.token != null && !options.private) {
460
822
  log.warn('"token" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).');
461
823
  }
462
824
  //tslint:disable-next-line:no-object-literal-type-assertion
825
+ // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- required by the TS 5.1 that typescript-json-schema bundles (pnpm generate:schema)
463
826
  return { owner, repo: project, ...options };
464
827
  }
465
828
  else {
466
829
  //tslint:disable-next-line:no-object-literal-type-assertion
830
+ // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- required by the TS 5.1 that typescript-json-schema bundles (pnpm generate:schema)
467
831
  return { owner, slug: project, ...options };
468
832
  }
469
833
  }