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

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