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,30 +1,57 @@
1
- import { Arch, asArray, AsyncTaskManager, spawnAndWriteWithOutput, exists, generateKsuid, getArchSuffix, getPlatformIconFileName, InvalidConfigurationError, log, statOrNull, use, walk, } from "builder-util";
1
+ import { Arch, asArray, AsyncTaskManager, ensureNotBusy, exists, spawnAndWriteWithOutput, generateKsuid, getArchSuffix, getPlatformIconFileName, InvalidConfigurationError, log, statOrNull, use, walk, } from "builder-util";
2
2
  import { CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME, deepAssign, sleep, UUID } from "builder-util-runtime";
3
3
  import _debug from "debug";
4
- import * as fs from "fs";
5
4
  import * as path from "path";
6
5
  import { Target } from "../../../core.js";
7
6
  import { DesktopShortcutCreationPolicy, getEffectiveOptions } from "../../../options/CommonWindowsInstallerConfiguration.js";
8
7
  import { chooseNotNull, computeSafeArtifactNameIfNeeded, normalizeExt } from "../../../platformPackager.js";
9
8
  import { hashFile } from "../../../util/hash.js";
10
- import { isMacOsCatalina } from "../../../util/mac/macosVersion.js";
11
9
  import { time } from "../../../util/timer.js";
12
- import { WineVmManager } from "../../../vm/WineVm.js";
13
10
  import { archive } from "../../archive.js";
14
- import { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo } from "../../differentialUpdateInfoBuilder.js";
11
+ import { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo, locateStoredMemberRegions, toBlockMapOptions, } from "../../differentialUpdateInfoBuilder.js";
15
12
  import { getWindowsInstallationAppPackageName, getWindowsInstallationDirName } from "../../targetUtil.js";
16
13
  import { addCustomMessageFileInclude, createAddLangsMacro, LangConfigurator } from "./nsisLang.js";
17
14
  import { computeLicensePage } from "./nsisLicense.js";
18
15
  import { NsisScriptGenerator, nsisEscapeString } from "./nsisScriptGenerator.js";
19
- import { getMakeNsisPath, getNsisPluginsPath } from "../../../toolsets/nsis.js";
16
+ import { ELECTRON_BUILDER_NS_UUID, ProgIdMaker } from "./progId.js";
17
+ import { assertInstallerDebugLoggingSupported, getMakeNsisPath, getNsisPluginsPath } from "../../../toolsets/nsis.js";
20
18
  import { nsisTemplatesDir, UninstallerReader } from "./nsisUtil.js";
21
19
  import { checkMakensisOutput, verifyInstallerSize } from "./nsisValidation.js";
22
20
  import _fsExtra from "fs-extra";
23
21
  const { readFile, stat, unlink } = _fsExtra;
24
22
  const debug = _debug("electron-builder:nsis");
25
- // noinspection SpellCheckingInspection
26
- const ELECTRON_BUILDER_NS_UUID = UUID.parse("50e065bc-3134-11e6-9bab-38c9862bdaf3");
23
+ /** The member `differentialPackage: "store-asar"` keeps uncompressed in the app package, relative to the unpacked app dir. */
24
+ export const STORED_ASAR_PATH = "resources/app.asar";
25
+ /**
26
+ * The `archive()` options `buildAppPackage` packages the unpacked app with, before the differential-aware
27
+ * adjustments of `configureDifferentialAwareArchiveOptions`. Exported so the benchmark
28
+ * (`test/src/differentialOneLineBenchTest.ts`) packages exactly like a real build instead of copying these.
29
+ */
30
+ export function createAppPackageArchiveOptions(compression, excluded, storedPaths) {
31
+ return {
32
+ withoutDir: true,
33
+ compression,
34
+ // The install-time Nsis7z extractor only decodes plain LZMA2/Copy and single-stream BCJ — not
35
+ // the CPU branch converters modern 7za applies to executables (BCJ2 on x86/x64, ARM64 on
36
+ // arm64), which it silently skips, dropping the main exe and every native binary from the
37
+ // install. Pin the payload to a filter it can decode. See #9983.
38
+ installTimeDecodable: true,
39
+ excluded,
40
+ storedPaths,
41
+ };
42
+ }
27
43
  const USE_NSIS_BUILT_IN_COMPRESSOR = false;
44
+ /**
45
+ * Whether a packed app can use the copy of the installer that the NSIS installer keeps in the updater cache
46
+ * (`APP_INSTALLER_STORE_FILE`). Only electron-updater reads it, as the base for a differential download, and
47
+ * electron-updater finds that cache through the `app-update.yml` written into the app's resources when
48
+ * publishing is configured. Without that file nothing reads the copy, so the installer does not write it
49
+ * (and the uninstaller does not leave it behind, #9505).
50
+ */
51
+ export async function hasUpdaterConfig(packager, archs) {
52
+ const found = await Promise.all(Array.from(archs.values(), appOutDir => statOrNull(path.join(packager.getResourcesDir(appOutDir), "app-update.yml"))));
53
+ return found.some(it => it != null);
54
+ }
28
55
  export class NsisTarget extends Target {
29
56
  constructor(packager, outDir, targetName, packageHelper) {
30
57
  super(targetName);
@@ -34,6 +61,7 @@ export class NsisTarget extends Target {
34
61
  /** @private */
35
62
  this.archs = new Map();
36
63
  this.isAsyncSupported = false;
64
+ this.storeAsarChecked = false;
37
65
  this.packageHelper.refCount++;
38
66
  this.options =
39
67
  targetName === "portable"
@@ -45,10 +73,22 @@ export class NsisTarget extends Target {
45
73
  if (targetName !== "nsis") {
46
74
  deepAssign(this.options, this.packager.config[targetName === "nsis-web" ? "nsisWeb" : targetName]);
47
75
  }
76
+ // Fails before packaging rather than when makensis rejects LogSet. Portable has no such option (its template never logs).
77
+ if (this.options.installerDebugLogging === true) {
78
+ assertInstallerDebugLoggingSupported(this.packager.config.toolsets?.nsis, this.name);
79
+ }
48
80
  const deps = packager.metadata.dependencies;
49
81
  if (deps != null && deps["electron-squirrel-startup"] != null) {
50
82
  log.warn('"electron-squirrel-startup" dependency is not required for NSIS');
51
83
  }
84
+ if (this.options.useZip === true && !this.isZipPayload) {
85
+ if (this.isWebInstaller) {
86
+ log.warn({ target: this.name, solution: "useZip only applies to the nsis and portable targets" }, "useZip is ignored because the web installer always uses a 7z package");
87
+ }
88
+ else {
89
+ log.warn({ target: this.name, solution: "set differentialPackage: false to get a zip payload" }, "useZip is ignored because differential-aware builds always use a 7z payload");
90
+ }
91
+ }
52
92
  }
53
93
  get shouldBuildUniversalInstaller() {
54
94
  const buildSeparateInstallers = this.options.buildUniversalInstaller === false;
@@ -64,42 +104,121 @@ export class NsisTarget extends Target {
64
104
  get isBuildDifferentialAware() {
65
105
  return !this.isPortable && this.options.differentialPackage !== false;
66
106
  }
107
+ // Single source of truth for the payload format: the archive written in buildAppPackage and the
108
+ // extractor selected by the ZIP_COMPRESSION / COMPRESSION_METHOD defines must never disagree.
109
+ // The web installer's download/extract path only handles 7z, so it never gets a zip package.
110
+ get isZipPayload() {
111
+ return !this.isWebInstaller && !this.isBuildDifferentialAware && this.options.useZip === true;
112
+ }
113
+ get isStoreAsar() {
114
+ return this.isBuildDifferentialAware && this.options.differentialPackage === "store-asar";
115
+ }
116
+ /**
117
+ * Everything that makes buildAppPackage's archive differ between targets. Targets sharing an
118
+ * AppPackageHelper (nsis + portable) reuse one app package per arch only when this key matches,
119
+ * so a target never embeds an archive whose format or layout was chosen by another target.
120
+ * @private
121
+ */
122
+ get appPackageCacheKey() {
123
+ const options = this.options;
124
+ return JSON.stringify({
125
+ format: this.isZipPayload ? "zip" : "7z",
126
+ differentialAware: this.isBuildDifferentialAware,
127
+ storeAsar: this.isStoreAsar,
128
+ excluded: this.getPreCompressedFileExtensions(),
129
+ // mirrors CopyElevateHelper's per-target packElevateHelper / perMachine resolution
130
+ elevate: options.packElevateHelper !== false || options.perMachine === true,
131
+ blockmap: this.isBuildDifferentialAware && this.isWebInstaller,
132
+ });
133
+ }
67
134
  getPreCompressedFileExtensions() {
68
135
  const result = this.isWebInstaller ? null : this.options.preCompressedFileExtensions;
69
136
  return result == null ? null : asArray(result).map(it => (it.startsWith(".") ? it : `.${it}`));
70
137
  }
71
- /** @private */
72
- async buildAppPackage(appOutDir, arch) {
73
- const options = this.options;
138
+ /**
139
+ * @private
140
+ * @returns the package file info plus the absolute source paths of the members stored verbatim in it
141
+ * (`storedMemberFiles`, empty unless `differentialPackage` is `"store-asar"`).
142
+ */
143
+ async buildAppPackage(appOutDir, arch, elevateHelper, fileNameSuffix = "") {
74
144
  const packager = this.packager;
75
145
  const isBuildDifferentialAware = this.isBuildDifferentialAware;
76
- const format = !isBuildDifferentialAware && options.useZip ? "zip" : "7z";
77
- const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}.nsis.${format}`);
146
+ const format = this.isZipPayload ? "zip" : "7z";
147
+ const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}${fileNameSuffix}.nsis.${format}`);
78
148
  const preCompressedFileExtensions = this.getPreCompressedFileExtensions();
79
- const archiveOptions = {
80
- withoutDir: true,
81
- compression: packager.compression,
82
- excluded: preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`),
83
- };
149
+ const isStoreAsar = this.isStoreAsar;
150
+ if (isStoreAsar) {
151
+ await this.warnIfStoreAsarHasNoAsar(appOutDir);
152
+ }
153
+ // Opt-in via differentialPackage: "store-asar" — keep the asar a byte-stable Copy member so a
154
+ // differential update pays only for its changed blocks instead of re-downloading the whole
155
+ // recompressed asar (see nsisOptions docs). The blockmap chunks these verbatim bytes finer.
156
+ const storedPaths = isStoreAsar ? [STORED_ASAR_PATH] : null;
157
+ // archive() skips a stored path that does not exist (e.g. `asar: false`, warned about above), so
158
+ // only the members that really end up in the package are located in it for the block map.
159
+ const storedMemberFiles = [];
160
+ for (const storedPath of storedPaths ?? []) {
161
+ const memberFile = path.join(appOutDir, storedPath);
162
+ if (await exists(memberFile)) {
163
+ storedMemberFiles.push(memberFile);
164
+ }
165
+ }
166
+ const archiveOptions = createAppPackageArchiveOptions(packager.compression, preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`), storedPaths);
167
+ // 7za stores what a symlink points to: one that leaves the app fails the package unless fileOptions.allowExternalLinks allows it
168
+ archiveOptions.externalLinks = await packager.getExternalLinkPolicy();
84
169
  const timer = time(`nsis package, ${Arch[arch]}`);
85
170
  await archive(format, archiveFile, appOutDir, isBuildDifferentialAware ? configureDifferentialAwareArchiveOptions(archiveOptions) : archiveOptions);
86
171
  timer.end();
172
+ // Inject elevate.exe into the archive via a temp staging dir, never by mutating appOutDir
173
+ // during packaging. The copy into win-unpacked is deferred until all targets finish, so
174
+ // concurrent targets (Squirrel, ZIP, etc.) never pick up elevate.exe non-deterministically.
175
+ // `archiveOptions` was mutated in place by configureDifferentialAwareArchiveOptions above
176
+ // (when differential-aware), so it already reflects the effective compression settings.
177
+ if (elevateHelper) {
178
+ await elevateHelper.addToArchive(archiveFile, this, format, archiveOptions, appOutDir);
179
+ }
87
180
  if (isBuildDifferentialAware && this.isWebInstaller) {
88
- const data = await appendBlockmap(archiveFile);
181
+ const regions = await locateStoredMemberRegions(archiveFile, storedMemberFiles);
182
+ const data = await appendBlockmap(archiveFile, toBlockMapOptions(regions));
89
183
  return {
90
- ...data,
91
- path: archiveFile,
184
+ fileInfo: {
185
+ ...data,
186
+ path: archiveFile,
187
+ },
188
+ storedMemberFiles,
92
189
  };
93
190
  }
94
191
  else {
95
- return await createPackageFileInfo(archiveFile);
192
+ return { fileInfo: await createPackageFileInfo(archiveFile), storedMemberFiles };
96
193
  }
97
194
  }
195
+ /**
196
+ * `archive()` silently skips stored paths that don't exist, so without an asar (e.g. `asar: false`)
197
+ * "store-asar" would do nothing unnoticed. The fallback is harmless — the differential package is
198
+ * non-solid, so each unpacked file is already its own block — but say so once per target.
199
+ * @private
200
+ */
201
+ async warnIfStoreAsarHasNoAsar(appOutDir) {
202
+ // every arch is packaged with the same asar setting, so checking the first one is enough (and
203
+ // flagging before the await keeps concurrent per-arch packaging from warning twice)
204
+ if (this.storeAsarChecked) {
205
+ return;
206
+ }
207
+ this.storeAsarChecked = true;
208
+ const asarFile = path.join(appOutDir, STORED_ASAR_PATH);
209
+ if (await exists(asarFile)) {
210
+ return;
211
+ }
212
+ log.warn({ reason: `${STORED_ASAR_PATH} not found (e.g. asar is disabled)`, file: log.filePath(asarFile) }, 'differentialPackage "store-asar" has no effect, the app package is compressed normally');
213
+ }
98
214
  installerFilenamePattern(primaryArch, defaultArch) {
99
215
  const setupText = this.isPortable ? "" : "Setup ";
100
216
  const archSuffix = !this.shouldBuildUniversalInstaller && primaryArch != null ? getArchSuffix(primaryArch, defaultArch) : "";
101
217
  return "${productName} " + setupText + "${version}" + archSuffix + ".${ext}";
102
218
  }
219
+ get writesUpdateInfo() {
220
+ return !this.isPortable;
221
+ }
103
222
  get isPortable() {
104
223
  return this.name === "portable";
105
224
  }
@@ -125,6 +244,9 @@ export class NsisTarget extends Target {
125
244
  await this.packageHelper.finishBuild();
126
245
  }
127
246
  }
247
+ get appGuid() {
248
+ return this.options.guid || UUID.v5(this.packager.appInfo.id, ELECTRON_BUILDER_NS_UUID);
249
+ }
128
250
  async buildInstaller(archs) {
129
251
  const primaryArch = archs.size === 1 ? (archs.keys().next().value ?? null) : null;
130
252
  const packager = this.packager;
@@ -151,11 +273,10 @@ export class NsisTarget extends Target {
151
273
  file: installerPath,
152
274
  arch: primaryArch,
153
275
  }, logFields);
154
- const guid = options.guid || UUID.v5(appInfo.id, ELECTRON_BUILDER_NS_UUID);
155
- const uninstallAppKey = guid.replace(/\\/g, " - ");
276
+ const uninstallAppKey = this.appGuid.replace(/\\/g, " - ");
156
277
  const defines = {
157
278
  APP_ID: appInfo.id,
158
- APP_GUID: guid,
279
+ APP_GUID: this.appGuid,
159
280
  // Windows bug - entry in Software\Microsoft\Windows\CurrentVersion\Uninstall cannot have \ symbols (dir)
160
281
  UNINSTALL_APP_KEY: uninstallAppKey,
161
282
  PRODUCT_NAME: appInfo.productName,
@@ -167,11 +288,11 @@ export class NsisTarget extends Target {
167
288
  BUILD_RESOURCES_DIR: packager.buildResourcesDir,
168
289
  APP_PACKAGE_NAME: getWindowsInstallationAppPackageName(appInfo.name),
169
290
  };
170
- if (options.customNsisBinary?.debugLogging) {
291
+ if (options.installerDebugLogging === true) {
171
292
  defines.ENABLE_LOGGING_ELECTRON_BUILDER = null;
172
293
  }
173
- if (uninstallAppKey !== guid) {
174
- defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${guid}`;
294
+ if (uninstallAppKey !== this.appGuid) {
295
+ defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${this.appGuid}`;
175
296
  }
176
297
  const { homepage } = this.packager.metadata;
177
298
  use(options.uninstallUrlHelp || homepage, it => (defines.UNINSTALL_URL_HELP = it));
@@ -195,8 +316,20 @@ export class NsisTarget extends Target {
195
316
  defines.MUI_UNICON = iconPath;
196
317
  }
197
318
  }
198
- const { packageFiles, estimatedSize } = await this.resolveArchPackageFiles(archs, defines, packager);
319
+ const { packageFiles, estimatedSize, storedMemberFiles } = await this.resolveArchPackageFiles(archs, defines, packager);
199
320
  this.configureDefinesForAllTypeOfInstaller(defines);
321
+ // the web installer has no copy of itself to keep, and the portable template never writes one
322
+ if (!this.isWebInstaller && !isPortable) {
323
+ if (await hasUpdaterConfig(packager, archs)) {
324
+ defines.KEEP_INSTALLER_FOR_UPDATER = null;
325
+ }
326
+ else {
327
+ // logged once per target, not once per installer (per-arch installers share the packed apps' publish setup)
328
+ log
329
+ .once("nsis-updater-config-missing", this)
330
+ .info({ reason: "resources/app-update.yml not found (no publish configuration)" }, "installer copy for electron-updater's differential download cache is skipped, so an app that sets updateConfigPath elsewhere will download updates in full");
331
+ }
332
+ }
200
333
  if (isPortable) {
201
334
  const { unpackDirName, requestExecutionLevel, splashImage } = options;
202
335
  defines.REQUEST_EXECUTION_LEVEL = requestExecutionLevel || "user";
@@ -264,9 +397,15 @@ export class NsisTarget extends Target {
264
397
  updateInfo = createNsisWebDifferentialUpdateInfo(installerPath, packageFiles);
265
398
  }
266
399
  else if (this.isBuildDifferentialAware) {
267
- updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName);
400
+ // Every arch package is embedded verbatim in the installer (SetCompress off), so the stored
401
+ // members of all of them sit verbatim in the signed installer too; locate them there.
402
+ const regions = await locateStoredMemberRegions(installerPath, storedMemberFiles);
403
+ updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName, primaryArch, toBlockMapOptions(regions));
268
404
  }
269
- if (updateInfo != null && isPerMachine && (oneClick || options.packElevateHelper)) {
405
+ // a per-machine build always packs elevate.exe (see CopyElevateHelper), unless the framework has no elevate helper
406
+ if (isPerMachine && packager.framework.isCopyElevateHelper) {
407
+ // without a blockmap (`differentialPackage: false`), the update info of the installer is only its checksum
408
+ updateInfo ??= { sha512: await hashFile(installerPath) };
270
409
  updateInfo.isAdminRightsRequired = true;
271
410
  }
272
411
  await packager.emitArtifactBuildCompleted({
@@ -282,6 +421,8 @@ export class NsisTarget extends Target {
282
421
  }
283
422
  async resolveArchPackageFiles(archs, defines, packager) {
284
423
  const packageFiles = {};
424
+ // stored (Copy) members of every arch package, to be located in the installer for its block map
425
+ const storedMemberFiles = [];
285
426
  let estimatedSize = 0;
286
427
  const options = this.options;
287
428
  if (this.isPortable && options.useZip) {
@@ -295,7 +436,8 @@ export class NsisTarget extends Target {
295
436
  }
296
437
  else {
297
438
  await Promise.all(Array.from(archs.keys()).map(async (arch) => {
298
- const { fileInfo, unpackedSize } = await this.packageHelper.packArch(arch, this);
439
+ const { fileInfo, unpackedSize, storedMemberFiles: archStoredMemberFiles } = await this.packageHelper.packArch(arch, this);
440
+ storedMemberFiles.push(...archStoredMemberFiles);
299
441
  const file = fileInfo.path;
300
442
  const defineKey = arch === Arch.x64 ? "APP_64" : arch === Arch.arm64 ? "APP_ARM64" : "APP_32";
301
443
  defines[defineKey] = file;
@@ -317,7 +459,7 @@ export class NsisTarget extends Target {
317
459
  estimatedSize += unpackedSize;
318
460
  }));
319
461
  }
320
- return { packageFiles, estimatedSize };
462
+ return { packageFiles, estimatedSize, storedMemberFiles };
321
463
  }
322
464
  generateGitHubInstallerName(primaryArch, defaultArch) {
323
465
  const appInfo = this.packager.appInfo;
@@ -347,27 +489,14 @@ export class NsisTarget extends Target {
347
489
  defines.BUILD_UNINSTALLER = null;
348
490
  defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join("Z:", uninstallerPath);
349
491
  await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, false, archs)));
350
- // http://forums.winamp.com/showthread.php?p=3078545
351
- // TODO: remove workaround when wine is fully upgraded to 11
352
- if (isMacOsCatalina()) {
353
- try {
354
- await UninstallerReader.exec(installerPath, uninstallerPath);
355
- }
356
- catch (error) {
357
- log.warn(`packager.vm is used: ${error.message}`);
358
- const vm = await packager.vm.value;
359
- await vm.exec(installerPath, []);
360
- // Parallels VM can exit after command execution, but NSIS continue to be running
361
- let i = 0;
362
- while (!(await exists(uninstallerPath)) && i++ < 100) {
363
- // noinspection JSUnusedLocalSymbols
364
- await sleep(300);
365
- }
366
- }
492
+ // The uninstaller is extracted from the installer in JS, emulating what NSIS `WriteUninstaller` does, and verified with the NSIS CRC check.
493
+ // Running the installer (natively, via wine or in a VM) is only a fallback, e.g. for solid compression or `!uninstfinalize`.
494
+ try {
495
+ await UninstallerReader.exec(installerPath, uninstallerPath);
367
496
  }
368
- else {
369
- const wineVm = new WineVmManager(packager.config.toolsets?.wine, packager.buildResourcesDir);
370
- await wineVm.exec(installerPath, [], { env: { __COMPAT_LAYER: "RunAsInvoker" } });
497
+ catch (error) {
498
+ log.warn({ reason: error.message }, "cannot extract uninstaller from installer, running installer to write it instead");
499
+ await this.runInstallerToWriteUninstaller(installerPath, uninstallerPath);
371
500
  }
372
501
  await packager.signIf(uninstallerPath);
373
502
  delete defines.BUILD_UNINSTALLER;
@@ -375,6 +504,17 @@ export class NsisTarget extends Target {
375
504
  defines.UNINSTALLER_OUT_FILE = uninstallerPath;
376
505
  return { script, isCustomScript: false };
377
506
  }
507
+ async runInstallerToWriteUninstaller(installerPath, uninstallerPath) {
508
+ const vm = await this.packager.execVm.value;
509
+ // explicit timeout (2 minutes, as WineVmManager defaults to), so a stuck installer fails the build instead of hanging it on any host
510
+ await vm.exec(installerPath, [], { env: { __COMPAT_LAYER: "RunAsInvoker" }, timeout: 120 * 1000 });
511
+ // Parallels VM can exit after command execution, but NSIS continue to be running
512
+ let i = 0;
513
+ while (!(await exists(uninstallerPath)) && i++ < 100) {
514
+ // noinspection JSUnusedLocalSymbols
515
+ await sleep(300);
516
+ }
517
+ }
378
518
  computeVersionKey(short = false) {
379
519
  // Error: invalid VIProductVersion format, should be X.X.X.X
380
520
  // so, we must strip beta
@@ -502,11 +642,10 @@ export class NsisTarget extends Target {
502
642
  defines.APP_INSTALLER_STORE_FILE = `${appInfo.updaterCacheDirName}\\${CURRENT_APP_INSTALLER_FILE_NAME}`;
503
643
  }
504
644
  if (!this.isWebInstaller && defines.APP_BUILD_DIR == null) {
505
- const options = this.options;
506
- if (options.useZip) {
645
+ if (this.isZipPayload) {
507
646
  defines.ZIP_COMPRESSION = null;
508
647
  }
509
- defines.COMPRESSION_METHOD = options.useZip ? "zip" : "7z";
648
+ defines.COMPRESSION_METHOD = this.isZipPayload ? "zip" : "7z";
510
649
  }
511
650
  }
512
651
  async executeMakensis(defines, commands, script, opts = {}) {
@@ -523,9 +662,9 @@ export class NsisTarget extends Target {
523
662
  // would terminate the current script line and let whatever follows
524
663
  // be parsed as a new preprocessor directive (e.g. !system, !include).
525
664
  // 2. bare $ → escaped to $$; unescaped $ in a define value would cause
526
- // NSIS to expand an unintended variable reference. ${...} references
527
- // are left intact so NSIS compile-time defines like ${NSISDIR} still
528
- // expand correctly.
665
+ // NSIS to expand an unintended variable reference. ${...} define
666
+ // references (e.g. ${NSISDIR}) and $(...) LangString references
667
+ // (e.g. $(customSN)) are left intact so they still expand correctly.
529
668
  // 3. " chars → escaped to $\"; an unescaped " would break out of
530
669
  // double-quoted NSIS string literals where ${DEFINE} is expanded.
531
670
  args.push(`-D${name}=${nsisEscapeString(String(value))}`);
@@ -575,36 +714,91 @@ export class NsisTarget extends Target {
575
714
  scriptGenerator.include(path.join(nsisTemplatesDir, "include", "StdUtils.nsh"));
576
715
  const includeDir = path.join(nsisTemplatesDir, "include");
577
716
  scriptGenerator.addIncludeDir(includeDir);
717
+ // allow custom scripts to `!include` sibling files from the build resources directory
718
+ scriptGenerator.addIncludeDir(packager.buildResourcesDir);
578
719
  scriptGenerator.flags(["updated", "force-run", "keep-shortcuts", "no-desktop-shortcut", "delete-app-data", "allusers", "currentuser"]);
579
720
  createAddLangsMacro(scriptGenerator, langConfigurator);
580
721
  const taskManager = new AsyncTaskManager(packager.cancellationToken);
581
- const pluginArch = this.isUnicodeEnabled ? "x86-unicode" : "x86-ansi";
722
+ const bundledPluginArch = this.isUnicodeEnabled ? "x86-unicode" : "x86-ansi";
582
723
  taskManager.add(async () => {
583
- scriptGenerator.addPluginDir(pluginArch, path.join(await getNsisPluginsPath(this.packager.config.toolsets?.nsis, this.packager.buildResourcesDir), pluginArch));
724
+ scriptGenerator.addPluginDir(bundledPluginArch, path.join(await getNsisPluginsPath(this.packager.config.toolsets?.nsis, this.packager.buildResourcesDir), bundledPluginArch));
584
725
  });
585
- taskManager.add(async () => {
586
- const userPluginDir = path.join(packager.buildResourcesDir, pluginArch);
587
- const stat = await statOrNull(userPluginDir);
588
- if (stat != null && stat.isDirectory()) {
589
- scriptGenerator.addPluginDir(pluginArch, userPluginDir);
590
- }
591
- });
592
- taskManager.addTask(addCustomMessageFileInclude("messages.yml", packager, scriptGenerator, langConfigurator));
593
- if (!this.isPortable) {
594
- if (options.oneClick === false) {
595
- taskManager.addTask(addCustomMessageFileInclude("assistedMessages.yml", packager, scriptGenerator, langConfigurator));
596
- }
726
+ for (const pluginArch of ["x86-unicode", "x86-ansi"]) {
597
727
  taskManager.add(async () => {
598
- const customInclude = await packager.getResource(this.options.include, "installer.nsh");
599
- if (customInclude != null) {
600
- scriptGenerator.addIncludeDir(packager.buildResourcesDir);
601
- scriptGenerator.include(customInclude);
728
+ const userPluginDir = path.join(packager.buildResourcesDir, pluginArch);
729
+ const stat = await statOrNull(userPluginDir);
730
+ if (stat != null && stat.isDirectory()) {
731
+ scriptGenerator.addPluginDir(pluginArch, userPluginDir);
602
732
  }
603
733
  });
604
734
  }
735
+ taskManager.addTask(addCustomMessageFileInclude("messages.yml", packager, scriptGenerator, langConfigurator));
736
+ if (!this.isPortable && options.oneClick === false) {
737
+ taskManager.addTask(addCustomMessageFileInclude("assistedMessages.yml", packager, scriptGenerator, langConfigurator));
738
+ }
739
+ taskManager.add(async () => {
740
+ for (const customInclude of await this.resolveCustomIncludes()) {
741
+ scriptGenerator.include(customInclude);
742
+ }
743
+ });
605
744
  await taskManager.awaitTasks();
606
745
  return scriptGenerator.build();
607
746
  }
747
+ /**
748
+ * Resolves the `include` option to a list of NSIS script paths.
749
+ *
750
+ * `include` may be a single path or an array of paths — each is resolved relative to the build resources directory first and then relative to the project directory.
751
+ * When the option is not set, `build/installer.nsh` is auto-discovered — except for the portable target, which only ever includes explicitly configured scripts
752
+ * (an auto-discovered `installer.nsh` is usually written for the installer target and must not silently leak into portable builds).
753
+ */
754
+ async resolveCustomIncludes() {
755
+ const include = this.options.include;
756
+ if (Array.isArray(include)) {
757
+ const result = [];
758
+ for (const entry of include) {
759
+ const resolved = await this.packager.getResource(entry);
760
+ if (resolved != null) {
761
+ result.push(resolved);
762
+ }
763
+ }
764
+ return result;
765
+ }
766
+ if (this.isPortable && include == null) {
767
+ return [];
768
+ }
769
+ const resolved = this.isPortable ? await this.packager.getResource(include) : await this.packager.getResource(include, "installer.nsh");
770
+ return resolved == null ? [] : [resolved];
771
+ }
772
+ /**
773
+ * v27 registers each file association under a generated ProgID instead of the association name or
774
+ * extension verbatim, so the old value could collide with an unrelated app. Nothing needs to change
775
+ * in config — but a custom NSIS script that hard-codes the old ProgID to add shell verbs or extra
776
+ * registry entries now writes them under a key nothing reads.
777
+ *
778
+ * Only warns when a custom script is actually supplied; the generated ProgID is invisible otherwise.
779
+ */
780
+ async warnAboutProgIdFormatChange(fileAssociations, progIdMaker) {
781
+ // checked first: resolving the custom script is not free, and computeFinalScript runs for every installer script
782
+ const limited = log.once("nsis-progid-format-change", this);
783
+ if (limited.isExhausted) {
784
+ return;
785
+ }
786
+ const packager = this.packager;
787
+ const hasCustomScript = (await this.resolveCustomIncludes()).length > 0 || (await packager.getResource(this.options.script, "installer.nsi")) != null;
788
+ if (!hasCustomScript) {
789
+ return;
790
+ }
791
+ const examples = fileAssociations
792
+ .slice(0, 3)
793
+ .map(item => {
794
+ const ext = asArray(item.ext).map(normalizeExt)[0];
795
+ return `${item.name || ext} -> ${progIdMaker.progId(item.name || ext)}`;
796
+ })
797
+ .join(", ");
798
+ limited.warn({ progIds: examples, solution: "update any registry keys, shell verbs, or external tooling that references the old ProgID" }, "NSIS file associations now register a generated ProgID instead of the association name or extension. " +
799
+ "You ship a custom NSIS script (nsis.include / nsis.script), which may reference the old value. " +
800
+ "See https://www.electron.build/docs/migration/v27-breaking-changes#nsis-file-association-progid-format-changed");
801
+ }
608
802
  async computeFinalScript(originalScript, isInstaller, archs) {
609
803
  const packager = this.packager;
610
804
  const options = this.options;
@@ -628,6 +822,8 @@ export class NsisTarget extends Target {
628
822
  const fileAssociations = packager.fileAssociations;
629
823
  if (fileAssociations.length !== 0) {
630
824
  scriptGenerator.include(path.join(path.join(nsisTemplatesDir, "include"), "FileAssociation.nsh"));
825
+ const progIdMaker = new ProgIdMaker(this.appGuid, packager.appInfo.productFilename);
826
+ await this.warnAboutProgIdFormatChange(fileAssociations, progIdMaker);
631
827
  if (isInstaller) {
632
828
  const registerFileAssociationsScript = new NsisScriptGenerator();
633
829
  for (const item of fileAssociations) {
@@ -639,10 +835,11 @@ export class NsisTarget extends Target {
639
835
  installedIconPath = `$INSTDIR\\resources\\${nsisEscapeString(path.basename(customIcon))}`;
640
836
  registerFileAssociationsScript.file(installedIconPath, customIcon);
641
837
  }
838
+ const progID = progIdMaker.progId(item.name || ext);
642
839
  const icon = `"${installedIconPath}"`;
643
840
  const commandText = `"Open with ${nsisEscapeString(packager.appInfo.productName)}"`;
644
841
  const command = '"$appExe $\\"%1$\\""';
645
- registerFileAssociationsScript.insertMacro("APP_ASSOCIATE", `"${nsisEscapeString(ext)}" "${nsisEscapeString(item.name || ext)}" "${nsisEscapeString(item.description || "")}" ${icon} ${commandText} ${command}`);
842
+ registerFileAssociationsScript.insertMacro("APP_ASSOCIATE", `"${nsisEscapeString(ext)}" "${progID}" "${nsisEscapeString(item.description || "")}" ${icon} ${commandText} ${command}`);
646
843
  }
647
844
  }
648
845
  scriptGenerator.macro("registerFileAssociations", registerFileAssociationsScript);
@@ -650,8 +847,8 @@ export class NsisTarget extends Target {
650
847
  else {
651
848
  const unregisterFileAssociationsScript = new NsisScriptGenerator();
652
849
  for (const item of fileAssociations) {
653
- for (const ext of asArray(item.ext)) {
654
- unregisterFileAssociationsScript.insertMacro("APP_UNASSOCIATE", `"${normalizeExt(ext)}" "${item.name || ext}"`);
850
+ for (const ext of asArray(item.ext).map(normalizeExt)) {
851
+ unregisterFileAssociationsScript.insertMacro("APP_UNASSOCIATE", `"${nsisEscapeString(ext)}" "${progIdMaker.progId(item.name || ext)}"`);
655
852
  }
656
853
  }
657
854
  scriptGenerator.macro("unregisterFileAssociations", unregisterFileAssociationsScript);
@@ -683,39 +880,6 @@ async function generateForPreCompressed(preCompressedFileExtensions, dir, arch,
683
880
  scriptGenerator.macro(`customFiles_${Arch[arch]}`, macro);
684
881
  }
685
882
  }
686
- async function ensureNotBusy(outFile) {
687
- function isBusy(wasBusyBefore) {
688
- return new Promise((resolve, reject) => {
689
- fs.open(outFile, "r+", (error, fd) => {
690
- try {
691
- if (error != null && error.code === "EBUSY") {
692
- if (!wasBusyBefore) {
693
- log.info({}, "output file is locked for writing (maybe by virus scanner) => waiting for unlock...");
694
- }
695
- resolve(false);
696
- }
697
- else if (fd == null) {
698
- resolve(true);
699
- }
700
- else {
701
- fs.close(fd, () => resolve(true));
702
- }
703
- }
704
- catch (error) {
705
- reject(error);
706
- }
707
- });
708
- }).then(result => {
709
- if (result) {
710
- return true;
711
- }
712
- else {
713
- return sleep(2000).then(() => isBusy(true));
714
- }
715
- });
716
- }
717
- await isBusy(false);
718
- }
719
883
  async function createPackageFileInfo(file) {
720
884
  return {
721
885
  path: file,