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,40 +1,5 @@
1
1
  import { CommonWindowsInstallerConfiguration } from "../../../options/CommonWindowsInstallerConfiguration.js";
2
2
  import { TargetSpecificOptions } from "../../../core.js";
3
- export interface CustomNsisBinary {
4
- /**
5
- * @default https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.4.1/nsis-3.0.4.1.7z
6
- */
7
- readonly url: string | null;
8
- /**
9
- * @default VKMiizYdmNdJOWpRGz4trl4lD++BvYP2irAXpMilheUP0pc93iKlWAoP843Vlraj8YG19CVn0j+dCo/hURz9+Q==
10
- */
11
- readonly checksum?: string | null;
12
- /**
13
- * @default 3.0.4.1
14
- */
15
- readonly version?: string | null;
16
- /**
17
- * Whether or not to enable NSIS logging for debugging.
18
- * Note: Requires a debug-enabled NSIS build.
19
- * electron-builder's included `makensis` does not natively support debug-enabled NSIS installers currently, you must supply your own via `customNsisBinary?: CustomNsisBinary`
20
- * In your custom nsis scripts, you can leverage this functionality via `LogSet` and `LogText`
21
- */
22
- readonly debugLogging?: boolean | null;
23
- }
24
- export interface CustomNsisResources {
25
- /**
26
- * @default https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.4.1/nsis-resources-3.4.1.7z
27
- */
28
- readonly url: string;
29
- /**
30
- * @default Dqd6g+2buwwvoG1Vyf6BHR1b+25QMmPcwZx40atOT57gH27rkjOei1L0JTldxZu4NFoEmW4kJgZ3DlSWVON3+Q==
31
- */
32
- readonly checksum: string;
33
- /**
34
- * @default 3.4.1
35
- */
36
- readonly version: string;
37
- }
38
3
  export interface CommonNsisOptions {
39
4
  /**
40
5
  * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).
@@ -55,18 +20,10 @@ export interface CommonNsisOptions {
55
20
  */
56
21
  readonly warningsAsErrors?: boolean;
57
22
  /**
58
- * Forces zip compression format instead of LZMA. Used internally for differential update packages.
23
+ * Use zip instead of 7z (LZMA) for the embedded app package. Only applies to portable targets and to installers built with `differentialPackage: false`; ignored (with a warning) when `differentialPackage` is enabled and for `nsis-web`, which always use 7z.
59
24
  * @default false
60
25
  */
61
26
  readonly useZip?: boolean;
62
- /**
63
- * Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)
64
- */
65
- readonly customNsisBinary?: CustomNsisBinary | null;
66
- /**
67
- * Allows you to provide your own `nsis-resources`
68
- */
69
- readonly customNsisResources?: CustomNsisResources | null;
70
27
  }
71
28
  export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {
72
29
  /**
@@ -74,6 +31,17 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
74
31
  * @default true
75
32
  */
76
33
  readonly oneClick?: boolean;
34
+ /**
35
+ * Whether to enable NSIS logging in the installer and uninstaller (`LogSet on`, which writes `install.log` to the installation
36
+ * directory). In your custom NSIS scripts, write to the log via `${LogText}`.
37
+ *
38
+ * Requires a log-enabled NSIS: `makensis` and its stubs compiled with `NSIS_CONFIG_LOG=yes`. The default `toolsets.nsis` bundle
39
+ * is not log-enabled, so supply one as a custom `toolsets.nsis` bundle; the build fails otherwise.
40
+ * Replaces the v26 `customNsisBinary.debugLogging`.
41
+ * @see https://www.electron.build/docs/migration/v27-breaking-changes#customnsisbinary-and-customnsisresources-replaced-by-toolsetsnsis
42
+ * @default false
43
+ */
44
+ readonly installerDebugLogging?: boolean;
77
45
  /**
78
46
  * Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).
79
47
  *
@@ -158,9 +126,12 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
158
126
  */
159
127
  readonly uninstallUrlReadme?: string | null;
160
128
  /**
161
- * The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).
129
+ * The path to NSIS include script to customize installer, or an array of such paths to include multiple scripts. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).
130
+ *
131
+ * Each path is resolved relative to the [build resources directory](https://www.electron.build/docs/configuration#directories) first and then relative to the project directory.
132
+ * When an array is provided, all scripts are included in the specified order.
162
133
  */
163
- readonly include?: string | null;
134
+ readonly include?: string | Array<string> | null;
164
135
  /**
165
136
  * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).
166
137
  */
@@ -184,9 +155,29 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
184
155
  */
185
156
  readonly deleteAppDataOnUninstall?: boolean;
186
157
  /**
187
- * Marks the package as built with differential download support for the update server.
158
+ * Marks the package as built with differential download support for the update server, and selects how the
159
+ * app package is compressed:
160
+ *
161
+ * - `false` — no differential download support.
162
+ * - `"store-asar"` — differential-aware, with the app's `resources/app.asar` stored uncompressed (7-Zip
163
+ * `Copy`) inside the package. The differential updater diffs the *compressed* package with a
164
+ * content-defined blockmap, and the asar is a single compressed member — so any change to app code
165
+ * re-downloads the entire compressed asar (~100% of the member; its header rewrite alone diverges every
166
+ * block). Storing it keeps unchanged regions byte-identical between releases, making the delta
167
+ * proportional to what actually changed (measured on a ~32 MB asar: a one-line source change cost 0.2%
168
+ * instead of 100%). The stored asar's byte range is also chunked with finer content-defined blocks
169
+ * (4/8/16 KiB instead of the 8/16/32 KiB used for the rest of the installer), so a small change costs
170
+ * proportionally fewer bytes still. Trade-off: the installer and full package grow by roughly what
171
+ * compressing the asar saved. Without an `app.asar` (e.g. `asar` is disabled) there is nothing to store,
172
+ * so it behaves like `true`. Upgrading from an electron-builder without the finer chunking changes the
173
+ * block boundaries once: the first differential update from an installer built before it re-downloads
174
+ * close to the whole asar, and updates between installers built with it are proportional again. Pair it
175
+ * with `asar.contentAlignment` (e.g. `512`) so that a change which grows a file does not shift every
176
+ * later file's offset in the asar header.
177
+ * - anything else (`true`, `"compressed"`, unset) — differential-aware, whole package compressed.
178
+ * @default true
188
179
  */
189
- readonly differentialPackage?: boolean;
180
+ readonly differentialPackage?: boolean | "compressed" | "store-asar";
190
181
  /**
191
182
  * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).
192
183
  * @default false
@@ -248,6 +239,15 @@ export interface PortableOptions extends TargetSpecificOptions, CommonNsisOption
248
239
  * @default true
249
240
  */
250
241
  readonly buildUniversalInstaller?: boolean;
242
+ /**
243
+ * The path to NSIS include script to customize the portable launcher, or an array of such paths to include multiple scripts. See [Custom NSIS script](#custom-nsis-script).
244
+ *
245
+ * Each path is resolved relative to the [build resources directory](https://www.electron.build/docs/configuration#directories) first and then relative to the project directory.
246
+ * When an array is provided, all scripts are included in the specified order.
247
+ *
248
+ * Unlike the installer targets, the portable target does **not** fall back to `build/installer.nsh` — a custom script is only included when this option is explicitly set.
249
+ */
250
+ readonly include?: string | Array<string> | null;
251
251
  }
252
252
  /**
253
253
  * Web Installer options.
@@ -260,8 +260,18 @@ export interface NsisWebOptions extends NsisOptions {
260
260
  * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).
261
261
  *
262
262
  * Custom `X-Arch` http header is set to `32` or `64`.
263
+ *
264
+ * The installer does not checksum-verify a package downloaded from an explicit `appPackageUrl`; a package downloaded from the default (publish-derived) URL is verified against the packages built with the installer.
263
265
  */
264
266
  readonly appPackageUrl?: string | null;
267
+ /**
268
+ * Whether the web installer may install an app package that doesn't match any package built with it: a package passed via `--package-file`,
269
+ * or (when `appPackageUrl` is not set) the downloaded package. By default such a package aborts the installation.
270
+ *
271
+ * Enable only if you intentionally run one web installer with packages of other builds (e.g. a version-independent installer with `--package-file`).
272
+ * @default false
273
+ */
274
+ readonly allowUnverifiedAppPackage?: boolean;
265
275
  /**
266
276
  * The [artifact file name template](https://www.electron.build/docs/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.
267
277
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nsisOptions.d.ts","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,yDAAyD,CAAA;AAC7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEhC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CACvC;AACD,MAAM,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AAI,CAAA;CACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"nsisOptions.js","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { CommonWindowsInstallerConfiguration } from \"../../../options/CommonWindowsInstallerConfiguration.js\"\nimport { TargetSpecificOptions } from \"../../../core.js\"\n\nexport interface CustomNsisBinary {\n /**\n * @default https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.4.1/nsis-3.0.4.1.7z\n */\n readonly url: string | null\n\n /**\n * @default VKMiizYdmNdJOWpRGz4trl4lD++BvYP2irAXpMilheUP0pc93iKlWAoP843Vlraj8YG19CVn0j+dCo/hURz9+Q==\n */\n readonly checksum?: string | null\n\n /**\n * @default 3.0.4.1\n */\n readonly version?: string | null\n\n /**\n * Whether or not to enable NSIS logging for debugging.\n * Note: Requires a debug-enabled NSIS build.\n * electron-builder's included `makensis` does not natively support debug-enabled NSIS installers currently, you must supply your own via `customNsisBinary?: CustomNsisBinary`\n * In your custom nsis scripts, you can leverage this functionality via `LogSet` and `LogText`\n */\n readonly debugLogging?: boolean | null\n}\nexport interface CustomNsisResources {\n /**\n * @default https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.4.1/nsis-resources-3.4.1.7z\n */\n readonly url: string\n\n /**\n * @default Dqd6g+2buwwvoG1Vyf6BHR1b+25QMmPcwZx40atOT57gH27rkjOei1L0JTldxZu4NFoEmW4kJgZ3DlSWVON3+Q==\n */\n readonly checksum: string\n\n /**\n * @default 3.4.1\n */\n readonly version: string\n}\nexport interface CommonNsisOptions {\n /**\n * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).\n * @default true\n */\n readonly unicode?: boolean\n\n /**\n * The GUID for the installer. Used to identify the application for upgrade and uninstall operations.\n * If not specified, a deterministic GUID is generated from the app ID (`appId`) — but this means\n * changing your `appId` will break silent upgrades of existing installs.\n *\n * @see [GUID vs Application Name](https://www.electron.build/docs/nsis#guid-vs-application-name)\n */\n readonly guid?: string | null\n\n /**\n * If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.\n * @default true\n */\n readonly warningsAsErrors?: boolean\n\n /**\n * Forces zip compression format instead of LZMA. Used internally for differential update packages.\n * @default false\n */\n readonly useZip?: boolean\n\n /**\n * Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)\n */\n readonly customNsisBinary?: CustomNsisBinary | null\n\n /**\n * Allows you to provide your own `nsis-resources`\n */\n readonly customNsisResources?: CustomNsisResources | null\n}\n\nexport interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {\n /**\n * Whether to create one-click installer or assisted.\n * @default true\n */\n readonly oneClick?: boolean\n\n /**\n * Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).\n *\n * If `oneClick` is `true` (default): Whether to install per all users (per-machine).\n *\n * If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.\n *\n * If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.\n * @default false\n */\n readonly perMachine?: boolean\n\n /**\n * Whether to set per-machine or per-user installation as default selection on the install mode installer page.\n *\n * @default false\n */\n readonly selectPerMachineByDefault?: boolean\n\n /**\n * *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.\n * @default true\n */\n readonly allowElevation?: boolean\n\n /**\n * *assisted installer only.* Whether to allow user to change installation directory.\n * @default false\n */\n readonly allowToChangeInstallationDirectory?: boolean\n\n /**\n * *assisted installer only.* remove the default uninstall welcome page.\n * @default false\n */\n readonly removeDefaultUninstallWelcomePage?: boolean\n\n /**\n * The path to installer icon, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/installerIcon.ico` or application icon.\n */\n readonly installerIcon?: string | null\n /**\n * The path to uninstaller icon, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/uninstallerIcon.ico` or application icon.\n */\n readonly uninstallerIcon?: string | null\n /**\n * *assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * @default build/installerHeader.bmp\n */\n readonly installerHeader?: string | null\n /**\n * *one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/installerHeaderIcon.ico` or application icon.\n */\n readonly installerHeaderIcon?: string | null\n /**\n * *assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`. Image size 164 × 314 pixels.\n */\n readonly installerSidebar?: string | null\n /**\n * *assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`\n */\n readonly uninstallerSidebar?: string | null\n /**\n * The uninstaller display name in the control panel.\n * @default ${productName} ${version}\n */\n readonly uninstallDisplayName?: string | null\n /**\n * The URL to the uninstaller help page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlHelp?: string | null\n /**\n * The URL to the uninstaller info about page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlInfoAbout?: string | null\n /**\n * The URL to the uninstaller update info page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlUpdateInfo?: string | null\n /**\n * The URL to the uninstaller readme page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlReadme?: string | null\n\n /**\n * The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly include?: string | null\n /**\n * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly script?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt`, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n *\n * Multiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`). For example, create files `license_de.txt` and `license_en.txt` in the build resources.\n * If OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).\n *\n * Appropriate license file will be selected by user OS language.\n */\n readonly license?: string | null\n\n /**\n * The [artifact file name template](https://www.electron.build/docs/configuration#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n\n /**\n * *one-click installer only.* Whether to delete app data on uninstall.\n * @default false\n */\n readonly deleteAppDataOnUninstall?: boolean\n\n /**\n * Marks the package as built with differential download support for the update server.\n */\n readonly differentialPackage?: boolean\n\n /**\n * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).\n * @default false\n */\n readonly displayLanguageSelector?: boolean\n /**\n * The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what.\n */\n readonly installerLanguages?: Array<string> | string | null\n /**\n * [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).\n */\n readonly language?: string | null\n /**\n * Whether to create multi-language installer. Defaults to `unicode` option value.\n */\n readonly multiLanguageInstaller?: boolean\n /**\n * Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`.\n * @default true\n */\n readonly packElevateHelper?: boolean\n\n /**\n * The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files.\n * @default [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"]\n */\n readonly preCompressedFileExtensions?: Array<string> | string | null\n\n /**\n * Disable building an universal installer of the archs specified in the target configuration\n * *Not supported for nsis-web*\n * @default true\n */\n readonly buildUniversalInstaller?: boolean\n}\n\n/**\n * Portable options.\n */\nexport interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions {\n /**\n * The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows.\n * @default user\n */\n readonly requestExecutionLevel?: \"user\" | \"highest\" | \"admin\"\n\n /**\n * The unpack directory for the portable app resources.\n *\n * If set to a string, it will be the name in [TEMP](https://www.askvg.com/where-does-windows-store-temporary-files-and-how-to-change-temp-folder-location/) directory\n * If set explicitly to `false`, it will use the Windows temp directory ($PLUGINSDIR) that is unique to each launch of the portable application.\n *\n * Defaults to [uuid](https://github.com/segmentio/ksuid) of build (changed on each build of portable executable).\n */\n readonly unpackDirName?: string | boolean\n\n /**\n * The image to show while the portable executable is extracting. This image must be a bitmap (`.bmp`) image.\n */\n readonly splashImage?: string | null\n\n /**\n * Disable building an universal installer of the archs specified in the target configuration\n * @default true\n */\n readonly buildUniversalInstaller?: boolean\n}\n\n/**\n * Web Installer options.\n */\nexport interface NsisWebOptions extends NsisOptions {\n /**\n * The application package download URL. Optional — by default computed using publish configuration.\n *\n * URL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package).\n * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).\n *\n * Custom `X-Arch` http header is set to `32` or `64`.\n */\n readonly appPackageUrl?: string | null\n\n /**\n * The [artifact file name template](https://www.electron.build/docs/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n\n /**\n * Override for `NsisOptions.buildUniversalInstaller`. nsis-web requires universal installer\n * @default true\n */\n readonly buildUniversalInstaller?: true\n}\n"]}
1
+ {"version":3,"file":"nsisOptions.js","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { CommonWindowsInstallerConfiguration } from \"../../../options/CommonWindowsInstallerConfiguration.js\"\nimport { TargetSpecificOptions } from \"../../../core.js\"\n\nexport interface CommonNsisOptions {\n /**\n * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).\n * @default true\n */\n readonly unicode?: boolean\n\n /**\n * The GUID for the installer. Used to identify the application for upgrade and uninstall operations.\n * If not specified, a deterministic GUID is generated from the app ID (`appId`) — but this means\n * changing your `appId` will break silent upgrades of existing installs.\n *\n * @see [GUID vs Application Name](https://www.electron.build/docs/nsis#guid-vs-application-name)\n */\n readonly guid?: string | null\n\n /**\n * If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.\n * @default true\n */\n readonly warningsAsErrors?: boolean\n\n /**\n * Use zip instead of 7z (LZMA) for the embedded app package. Only applies to portable targets and to installers built with `differentialPackage: false`; ignored (with a warning) when `differentialPackage` is enabled and for `nsis-web`, which always use 7z.\n * @default false\n */\n readonly useZip?: boolean\n}\n\nexport interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {\n /**\n * Whether to create one-click installer or assisted.\n * @default true\n */\n readonly oneClick?: boolean\n\n /**\n * Whether to enable NSIS logging in the installer and uninstaller (`LogSet on`, which writes `install.log` to the installation\n * directory). In your custom NSIS scripts, write to the log via `${LogText}`.\n *\n * Requires a log-enabled NSIS: `makensis` and its stubs compiled with `NSIS_CONFIG_LOG=yes`. The default `toolsets.nsis` bundle\n * is not log-enabled, so supply one as a custom `toolsets.nsis` bundle; the build fails otherwise.\n * Replaces the v26 `customNsisBinary.debugLogging`.\n * @see https://www.electron.build/docs/migration/v27-breaking-changes#customnsisbinary-and-customnsisresources-replaced-by-toolsetsnsis\n * @default false\n */\n readonly installerDebugLogging?: boolean\n\n /**\n * Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).\n *\n * If `oneClick` is `true` (default): Whether to install per all users (per-machine).\n *\n * If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.\n *\n * If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.\n * @default false\n */\n readonly perMachine?: boolean\n\n /**\n * Whether to set per-machine or per-user installation as default selection on the install mode installer page.\n *\n * @default false\n */\n readonly selectPerMachineByDefault?: boolean\n\n /**\n * *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.\n * @default true\n */\n readonly allowElevation?: boolean\n\n /**\n * *assisted installer only.* Whether to allow user to change installation directory.\n * @default false\n */\n readonly allowToChangeInstallationDirectory?: boolean\n\n /**\n * *assisted installer only.* remove the default uninstall welcome page.\n * @default false\n */\n readonly removeDefaultUninstallWelcomePage?: boolean\n\n /**\n * The path to installer icon, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/installerIcon.ico` or application icon.\n */\n readonly installerIcon?: string | null\n /**\n * The path to uninstaller icon, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/uninstallerIcon.ico` or application icon.\n */\n readonly uninstallerIcon?: string | null\n /**\n * *assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * @default build/installerHeader.bmp\n */\n readonly installerHeader?: string | null\n /**\n * *one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/installerHeaderIcon.ico` or application icon.\n */\n readonly installerHeaderIcon?: string | null\n /**\n * *assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`. Image size 164 × 314 pixels.\n */\n readonly installerSidebar?: string | null\n /**\n * *assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](https://www.electron.build/docs/contents#extraresources) or to the project directory.\n * Defaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`\n */\n readonly uninstallerSidebar?: string | null\n /**\n * The uninstaller display name in the control panel.\n * @default ${productName} ${version}\n */\n readonly uninstallDisplayName?: string | null\n /**\n * The URL to the uninstaller help page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlHelp?: string | null\n /**\n * The URL to the uninstaller info about page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlInfoAbout?: string | null\n /**\n * The URL to the uninstaller update info page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlUpdateInfo?: string | null\n /**\n * The URL to the uninstaller readme page in the control panel. Defaults to [homepage](https://www.electron.build/docs/configuration#homepage) from application package.json.\n */\n readonly uninstallUrlReadme?: string | null\n\n /**\n * The path to NSIS include script to customize installer, or an array of such paths to include multiple scripts. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).\n *\n * Each path is resolved relative to the [build resources directory](https://www.electron.build/docs/configuration#directories) first and then relative to the project directory.\n * When an array is provided, all scripts are included in the specified order.\n */\n readonly include?: string | Array<string> | null\n /**\n * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly script?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt`, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n *\n * Multiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`). For example, create files `license_de.txt` and `license_en.txt` in the build resources.\n * If OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).\n *\n * Appropriate license file will be selected by user OS language.\n */\n readonly license?: string | null\n\n /**\n * The [artifact file name template](https://www.electron.build/docs/configuration#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n\n /**\n * *one-click installer only.* Whether to delete app data on uninstall.\n * @default false\n */\n readonly deleteAppDataOnUninstall?: boolean\n\n /**\n * Marks the package as built with differential download support for the update server, and selects how the\n * app package is compressed:\n *\n * - `false` — no differential download support.\n * - `\"store-asar\"` — differential-aware, with the app's `resources/app.asar` stored uncompressed (7-Zip\n * `Copy`) inside the package. The differential updater diffs the *compressed* package with a\n * content-defined blockmap, and the asar is a single compressed member — so any change to app code\n * re-downloads the entire compressed asar (~100% of the member; its header rewrite alone diverges every\n * block). Storing it keeps unchanged regions byte-identical between releases, making the delta\n * proportional to what actually changed (measured on a ~32 MB asar: a one-line source change cost 0.2%\n * instead of 100%). The stored asar's byte range is also chunked with finer content-defined blocks\n * (4/8/16 KiB instead of the 8/16/32 KiB used for the rest of the installer), so a small change costs\n * proportionally fewer bytes still. Trade-off: the installer and full package grow by roughly what\n * compressing the asar saved. Without an `app.asar` (e.g. `asar` is disabled) there is nothing to store,\n * so it behaves like `true`. Upgrading from an electron-builder without the finer chunking changes the\n * block boundaries once: the first differential update from an installer built before it re-downloads\n * close to the whole asar, and updates between installers built with it are proportional again. Pair it\n * with `asar.contentAlignment` (e.g. `512`) so that a change which grows a file does not shift every\n * later file's offset in the asar header.\n * - anything else (`true`, `\"compressed\"`, unset) — differential-aware, whole package compressed.\n * @default true\n */\n readonly differentialPackage?: boolean | \"compressed\" | \"store-asar\"\n\n /**\n * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).\n * @default false\n */\n readonly displayLanguageSelector?: boolean\n /**\n * The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what.\n */\n readonly installerLanguages?: Array<string> | string | null\n /**\n * [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).\n */\n readonly language?: string | null\n /**\n * Whether to create multi-language installer. Defaults to `unicode` option value.\n */\n readonly multiLanguageInstaller?: boolean\n /**\n * Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`.\n * @default true\n */\n readonly packElevateHelper?: boolean\n\n /**\n * The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files.\n * @default [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"]\n */\n readonly preCompressedFileExtensions?: Array<string> | string | null\n\n /**\n * Disable building an universal installer of the archs specified in the target configuration\n * *Not supported for nsis-web*\n * @default true\n */\n readonly buildUniversalInstaller?: boolean\n}\n\n/**\n * Portable options.\n */\nexport interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions {\n /**\n * The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows.\n * @default user\n */\n readonly requestExecutionLevel?: \"user\" | \"highest\" | \"admin\"\n\n /**\n * The unpack directory for the portable app resources.\n *\n * If set to a string, it will be the name in [TEMP](https://www.askvg.com/where-does-windows-store-temporary-files-and-how-to-change-temp-folder-location/) directory\n * If set explicitly to `false`, it will use the Windows temp directory ($PLUGINSDIR) that is unique to each launch of the portable application.\n *\n * Defaults to [uuid](https://github.com/segmentio/ksuid) of build (changed on each build of portable executable).\n */\n readonly unpackDirName?: string | boolean\n\n /**\n * The image to show while the portable executable is extracting. This image must be a bitmap (`.bmp`) image.\n */\n readonly splashImage?: string | null\n\n /**\n * Disable building an universal installer of the archs specified in the target configuration\n * @default true\n */\n readonly buildUniversalInstaller?: boolean\n\n /**\n * The path to NSIS include script to customize the portable launcher, or an array of such paths to include multiple scripts. See [Custom NSIS script](#custom-nsis-script).\n *\n * Each path is resolved relative to the [build resources directory](https://www.electron.build/docs/configuration#directories) first and then relative to the project directory.\n * When an array is provided, all scripts are included in the specified order.\n *\n * Unlike the installer targets, the portable target does **not** fall back to `build/installer.nsh` — a custom script is only included when this option is explicitly set.\n */\n readonly include?: string | Array<string> | null\n}\n\n/**\n * Web Installer options.\n */\nexport interface NsisWebOptions extends NsisOptions {\n /**\n * The application package download URL. Optional — by default computed using publish configuration.\n *\n * URL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package).\n * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).\n *\n * Custom `X-Arch` http header is set to `32` or `64`.\n *\n * The installer does not checksum-verify a package downloaded from an explicit `appPackageUrl`; a package downloaded from the default (publish-derived) URL is verified against the packages built with the installer.\n */\n readonly appPackageUrl?: string | null\n\n /**\n * Whether the web installer may install an app package that doesn't match any package built with it: a package passed via `--package-file`,\n * or (when `appPackageUrl` is not set) the downloaded package. By default such a package aborts the installation.\n *\n * Enable only if you intentionally run one web installer with packages of other builds (e.g. a version-independent installer with `--package-file`).\n * @default false\n */\n readonly allowUnverifiedAppPackage?: boolean\n\n /**\n * The [artifact file name template](https://www.electron.build/docs/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n\n /**\n * Override for `NsisOptions.buildUniversalInstaller`. nsis-web requires universal installer\n * @default true\n */\n readonly buildUniversalInstaller?: true\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nsisScriptGenerator.d.ts","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisScriptGenerator.ts"],"names":[],"mappings":"AAEA,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAE1C,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAI5C,OAAO,CAAC,IAAI,EAAE,MAAM;IAIpB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,mBAAmB;IAI9D,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM;IAI5C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAK5C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IAY1B,KAAK;CAGN;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CASlD"}
1
+ {"version":3,"file":"nsisScriptGenerator.d.ts","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisScriptGenerator.ts"],"names":[],"mappings":"AAEA,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAE1C,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAI5C,OAAO,CAAC,IAAI,EAAE,MAAM;IAIpB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,mBAAmB;IAI9D,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM;IAI5C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAK5C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IAY1B,KAAK;CAGN;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAUlD"}
@@ -24,7 +24,7 @@ export class NsisScriptGenerator {
24
24
  // without -- !!!
25
25
  flags(flags) {
26
26
  for (const flagName of flags) {
27
- const variableName = getVarNameForFlag(flagName).replace(/[-]+(\w|$)/g, (m, p1) => p1.toUpperCase());
27
+ const variableName = getVarNameForFlag(flagName).replace(/-+(\w)?/g, (m, p1) => (p1 ?? "").toUpperCase());
28
28
  this.lines.push(`!macro _${variableName} _a _b _t _f
29
29
  $\{StdUtils.TestParameter} $R9 "${flagName}"
30
30
  StrCmp "$R9" "true" \`$\{_t}\` \`$\{_f}\`
@@ -40,8 +40,9 @@ export class NsisScriptGenerator {
40
40
  export function nsisEscapeString(s) {
41
41
  const escaped = s
42
42
  .replace(/\r\n|\r|\n/g, " ") // newlines break NSIS string literals
43
- .replace(/\$(?!\{)/g, "$$$$") // bare $ → $$ (prevents NSIS variable expansion); ${...} references are left intact
44
- .replace(/"/g, '$\\"'); // " → $\" (NSIS escape for double-quote)
43
+ .replace(/\$(?![{(])/g, "$$$$") // bare $ → $$ (prevents NSIS variable expansion); ${...} define and $(...) LangString references are left intact
44
+ .replace(/"/g, '$\\"') // " → $\" (NSIS escape for double-quote)
45
+ .replace(/`/g, "$\\`"); // ` → $\` (NSIS escape for backtick, which delimits strings in macro bodies such as FileAssociation.nsh)
45
46
  if (escaped !== s) {
46
47
  log.debug({ original: s, final: escaped }, "nsis was escaped");
47
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nsisScriptGenerator.js","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisScriptGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAElC,MAAM,OAAO,mBAAmB;IAAhC;QACmB,UAAK,GAAkB,EAAE,CAAA;IA0C5C,CAAC;IAxCC,aAAa,CAAC,IAAY;QACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAA;IAC7C,CAAC;IAED,YAAY,CAAC,UAAkB,EAAE,GAAW;QAC1C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,UAAU,KAAK,GAAG,GAAG,CAAC,CAAA;IAC1D,CAAC;IAED,OAAO,CAAC,IAAY;QA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C,CAAS;IACxC,MAAM,OAAO,GAAG,CAAC;SACd,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,sCAAsC;SAClE,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,oFAAoF;SACjH,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA,CAAC,yCAAyC;IAClE,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,GAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kBAAkB,CAAC,CAAA;IAChE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC/B,OAAO,kBAAkB,CAAA;IAC3B,CAAC;IACD,OAAO,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC","sourcesContent":["import { log } from \"builder-util\"\n\nexport class NsisScriptGenerator {\n private readonly lines: Array<string> = []\n\n addIncludeDir(file: string) {\n this.lines.push(`!addincludedir \"${file}\"`)\n }\n\n addPluginDir(pluginArch: string, dir: string) {\n this.lines.push(`!addplugindir /${pluginArch} \"${dir}\"`)\n }\n\n include(file: string) {\n this.lines.push(`!include \"${file}\"`)\n }\n\n macro(name: string, lines: Array<string> | NsisScriptGenerator) {\n this.lines.push(`!macro ${name}`, ` ${(Array.isArray(lines) ? lines : lines.lines).join(\"\\n \")}`, `!macroend\\n`)\n }\n\n file(outputName: string | null, file: string) {\n this.lines.push(`File${outputName == null ? \"\" : ` \"/oname=${outputName}\"`} \"${file}\"`)\n }\n\n insertMacro(name: string, parameters: string) {\n this.lines.push(`!insertmacro ${name} ${parameters}`)\n }\n\n // without -- !!!\n flags(flags: Array<string>) {\n for (const flagName of flags) {\n const variableName = getVarNameForFlag(flagName).replace(/[-]+(\\w|$)/g, (m, p1) => p1.toUpperCase())\n this.lines.push(`!macro _${variableName} _a _b _t _f\n $\\{StdUtils.TestParameter} $R9 \"${flagName}\"\n StrCmp \"$R9\" \"true\" \\`$\\{_t}\\` \\`$\\{_f}\\`\n!macroend\n!define ${variableName} \\`\"\" ${variableName} \"\"\\`\n`)\n }\n }\n\n build() {\n return this.lines.join(\"\\n\") + \"\\n\"\n }\n}\n\nexport function nsisEscapeString(s: string): string {\n const escaped = s\n .replace(/\\r\\n|\\r|\\n/g, \" \") // newlines break NSIS string literals\n .replace(/\\$(?!\\{)/g, \"$$$$\") // bare $ → $$ (prevents NSIS variable expansion); ${...} references are left intact\n .replace(/\"/g, '$\\\\\"') // \" → $\\\" (NSIS escape for double-quote)\n if (escaped !== s) {\n log.debug({ original: s, final: escaped }, \"nsis was escaped\")\n }\n return escaped\n}\n\nfunction getVarNameForFlag(flagName: string): string {\n if (flagName === \"allusers\") {\n return \"isForAllUsers\"\n }\n if (flagName === \"currentuser\") {\n return \"isForCurrentUser\"\n }\n return \"is\" + flagName[0].toUpperCase() + flagName.substring(1)\n}\n"]}
1
+ {"version":3,"file":"nsisScriptGenerator.js","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisScriptGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAElC,MAAM,OAAO,mBAAmB;IAAhC;QACmB,UAAK,GAAkB,EAAE,CAAA;IA0C5C,CAAC;IAxCC,aAAa,CAAC,IAAY;QACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAA;IAC7C,CAAC;IAED,YAAY,CAAC,UAAkB,EAAE,GAAW;QAC1C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,UAAU,KAAK,GAAG,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AAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACrC,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,MAAM,OAAO,GAAG,CAAC;SACd,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,sCAAsC;SAClE,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,iHAAiH;SAChJ,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,yCAAyC;SAC/D,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA,CAAC,yGAAyG;IAClI,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,GAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kBAAkB,CAAC,CAAA;IAChE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC/B,OAAO,kBAAkB,CAAA;IAC3B,CAAC;IACD,OAAO,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC","sourcesContent":["import { log } from \"builder-util\"\n\nexport class NsisScriptGenerator {\n private readonly lines: Array<string> = []\n\n addIncludeDir(file: string) {\n this.lines.push(`!addincludedir \"${file}\"`)\n }\n\n addPluginDir(pluginArch: string, dir: string) {\n this.lines.push(`!addplugindir /${pluginArch} \"${dir}\"`)\n }\n\n include(file: string) {\n this.lines.push(`!include \"${file}\"`)\n }\n\n macro(name: string, lines: Array<string> | NsisScriptGenerator) {\n this.lines.push(`!macro ${name}`, ` ${(Array.isArray(lines) ? lines : lines.lines).join(\"\\n \")}`, `!macroend\\n`)\n }\n\n file(outputName: string | null, file: string) {\n this.lines.push(`File${outputName == null ? \"\" : ` \"/oname=${outputName}\"`} \"${file}\"`)\n }\n\n insertMacro(name: string, parameters: string) {\n this.lines.push(`!insertmacro ${name} ${parameters}`)\n }\n\n // without -- !!!\n flags(flags: Array<string>) {\n for (const flagName of flags) {\n const variableName = getVarNameForFlag(flagName).replace(/-+(\\w)?/g, (m, p1) => (p1 ?? \"\").toUpperCase())\n this.lines.push(`!macro _${variableName} _a _b _t _f\n $\\{StdUtils.TestParameter} $R9 \"${flagName}\"\n StrCmp \"$R9\" \"true\" \\`$\\{_t}\\` \\`$\\{_f}\\`\n!macroend\n!define ${variableName} \\`\"\" ${variableName} \"\"\\`\n`)\n }\n }\n\n build() {\n return this.lines.join(\"\\n\") + \"\\n\"\n }\n}\n\nexport function nsisEscapeString(s: string): string {\n const escaped = s\n .replace(/\\r\\n|\\r|\\n/g, \" \") // newlines break NSIS string literals\n .replace(/\\$(?![{(])/g, \"$$$$\") // bare $ → $$ (prevents NSIS variable expansion); ${...} define and $(...) LangString references are left intact\n .replace(/\"/g, '$\\\\\"') // \" → $\\\" (NSIS escape for double-quote)\n .replace(/`/g, \"$\\\\`\") // ` → $\\` (NSIS escape for backtick, which delimits strings in macro bodies such as FileAssociation.nsh)\n if (escaped !== s) {\n log.debug({ original: s, final: escaped }, \"nsis was escaped\")\n }\n return escaped\n}\n\nfunction getVarNameForFlag(flagName: string): string {\n if (flagName === \"allusers\") {\n return \"isForAllUsers\"\n }\n if (flagName === \"currentuser\") {\n return \"isForCurrentUser\"\n }\n return \"is\" + flagName[0].toUpperCase() + flagName.substring(1)\n}\n"]}
@@ -1,14 +1,22 @@
1
1
  import { Arch } from "builder-util";
2
2
  import { PackageFileInfo } from "builder-util-runtime";
3
+ import { ArchiveOptions } from "../../archive.js";
3
4
  import { NsisTarget } from "./NsisTarget.js";
4
5
  export declare const nsisTemplatesDir: string;
5
6
  export interface PackArchResult {
6
7
  fileInfo: PackageFileInfo;
7
8
  unpackedSize: number;
9
+ /**
10
+ * Absolute source paths of the members stored verbatim (`Copy`) in the app package — see
11
+ * `ArchiveOptions.storedPaths`. The package is embedded verbatim in the installer, so these are
12
+ * located again in the final installer to give the block map its finer-chunked regions.
13
+ */
14
+ storedMemberFiles: Array<string>;
8
15
  }
9
16
  export declare class AppPackageHelper {
10
17
  private readonly elevateHelper;
11
18
  private readonly archToResult;
19
+ private readonly archToPackageCount;
12
20
  private readonly infoToIsDelete;
13
21
  /** @private */
14
22
  refCount: number;
@@ -17,10 +25,17 @@ export declare class AppPackageHelper {
17
25
  finishBuild(): Promise<any>;
18
26
  }
19
27
  export declare class CopyElevateHelper {
20
- private readonly copied;
21
- copy(appOutDir: string, target: NsisTarget): Promise<any>;
28
+ private elevatePath;
29
+ private readonly stagedUnpackedCopies;
30
+ private resolve;
31
+ addToArchive(archiveFile: string, target: NsisTarget, format: string, archiveOptions: ArchiveOptions, appOutDir: string): Promise<void>;
22
32
  }
23
33
  export declare class UninstallerReader {
24
34
  static exec(installerPath: string, uninstallerPath: string): Promise<void>;
25
35
  }
36
+ /**
37
+ * Performs the same integrity check that the NSIS exehead runs on startup (loadHeaders in exehead/fileform.c),
38
+ * so a broken uninstaller fails the build instead of showing "Installer integrity check has failed" to the end user.
39
+ */
40
+ export declare function verifyNsisIntegrity(data: Buffer): void;
26
41
  //# sourceMappingURL=nsisUtil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nsisUtil.d.ts","sourceRoot":"","sources":["../../../../src/targets/win/nsis/nsisUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA0B,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAMtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,eAAO,MAAM,gBAAgB,QAA0B,CAAA;AAEvD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,eAAe,CAAA;IACzB,Y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A6C;IAC1E,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA0B;IAC7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsC;IAErE,eAAe;IACf,QAAQ,SAAI;gBAEiB,aAAa,EAAE,iBAAiB;IAEvD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IA4BjE,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC;CAclC;AAED,qBAAa,iBAAiB;IAE5B,OAAO,CAAC,WAAW,CAAsC;IAIzD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAoB;IAEzD,OAAO,CAAC,OAAO;IA0BT,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoC9I;AA6DD,qBAAa,iBAAiB;WAEf,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CA0FjE;AAyCD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAwBtD"}
@@ -1,30 +1,40 @@
1
- import { copyFile, dirSize, log } from "builder-util";
1
+ import { copyFile, debug7z, dirSize, exec, log, prepareFixedNameWrite } from "builder-util";
2
2
  import * as fs from "fs/promises";
3
3
  import * as path from "path";
4
4
  import * as zlib from "zlib";
5
+ import { isWindowsSigningDisabled } from "../../../options/winOptions.js";
5
6
  import { getNsisElevatePath } from "../../../toolsets/nsis.js";
7
+ import { getPath7za } from "../../../toolsets/7zip.js";
6
8
  import { getTemplatePath } from "../../../util/pathManager.js";
9
+ import { compute7zCompressArgs } from "../../archive.js";
7
10
  export const nsisTemplatesDir = getTemplatePath("nsis");
8
11
  export class AppPackageHelper {
9
12
  constructor(elevateHelper) {
10
13
  this.elevateHelper = elevateHelper;
14
+ // keyed by arch + the requesting target's appPackageCacheKey: targets only share an app package
15
+ // when packaging it for them would produce the same archive
11
16
  this.archToResult = new Map();
17
+ this.archToPackageCount = new Map();
12
18
  this.infoToIsDelete = new Map();
13
19
  /** @private */
14
20
  this.refCount = 0;
15
21
  }
16
22
  async packArch(arch, target) {
17
- let resultPromise = this.archToResult.get(arch);
23
+ const cacheKey = `${arch}:${target.appPackageCacheKey}`;
24
+ let resultPromise = this.archToResult.get(cacheKey);
18
25
  if (resultPromise == null) {
19
26
  const appOutDir = target.archs.get(arch);
20
- resultPromise = this.elevateHelper
21
- .copy(appOutDir, target)
22
- .then(() => target.buildAppPackage(appOutDir, arch))
23
- .then(async (fileInfo) => ({
27
+ // the first package of an arch keeps the usual file name; any further one (a target with
28
+ // different packaging settings) gets a distinct name so it never overwrites the other
29
+ const packageCount = (this.archToPackageCount.get(arch) ?? 0) + 1;
30
+ this.archToPackageCount.set(arch, packageCount);
31
+ const fileNameSuffix = packageCount === 1 ? "" : `-${packageCount}`;
32
+ resultPromise = target.buildAppPackage(appOutDir, arch, this.elevateHelper, fileNameSuffix).then(async ({ fileInfo, storedMemberFiles }) => ({
24
33
  fileInfo,
34
+ storedMemberFiles,
25
35
  unpackedSize: await dirSize(appOutDir),
26
36
  }));
27
- this.archToResult.set(arch, resultPromise);
37
+ this.archToResult.set(cacheKey, resultPromise);
28
38
  }
29
39
  const result = await resultPromise;
30
40
  const { fileInfo: info } = result;
@@ -51,11 +61,15 @@ export class AppPackageHelper {
51
61
  }
52
62
  export class CopyElevateHelper {
53
63
  constructor() {
54
- this.copied = new Map();
64
+ // Cached path resolution — shared across all arches since the source never changes per build.
65
+ this.elevatePath = null;
66
+ // appOutDirs whose win-unpacked copy of elevate.exe has already been deferred, so the same
67
+ // directory isn't queued twice when multiple NSIS targets (e.g. nsis + nsis-web) share an arch.
68
+ this.stagedUnpackedCopies = new Set();
55
69
  }
56
- copy(appOutDir, target) {
70
+ resolve(target) {
57
71
  if (!target.packager.framework.isCopyElevateHelper) {
58
- return Promise.resolve();
72
+ return Promise.resolve(null);
59
73
  }
60
74
  let isPackElevateHelper = target.options.packElevateHelper;
61
75
  if (isPackElevateHelper === false && target.options.perMachine === true) {
@@ -63,23 +77,48 @@ export class CopyElevateHelper {
63
77
  log.warn("`packElevateHelper = false` is ignored, because `perMachine` is set to `true`");
64
78
  }
65
79
  if (isPackElevateHelper === false) {
66
- return Promise.resolve();
67
- }
68
- let promise = this.copied.get(appOutDir);
69
- if (promise != null) {
70
- return promise;
71
- }
72
- promise = getNsisElevatePath(target.packager.config.toolsets?.nsis, target.packager.buildResourcesDir).then(elevatePath => {
73
- const outFile = path.join(appOutDir, "resources", "elevate.exe");
74
- const promise = copyFile(elevatePath, outFile, false);
75
- const { signAndEditExecutable, signExecutable } = target.packager.platformOptions;
76
- if (signAndEditExecutable !== false && signExecutable !== false) {
77
- return promise.then(() => target.packager.signIf(outFile));
78
- }
79
- return promise;
80
- });
81
- this.copied.set(appOutDir, promise);
82
- return promise;
80
+ return Promise.resolve(null);
81
+ }
82
+ if (this.elevatePath == null) {
83
+ this.elevatePath = getNsisElevatePath(target.packager.config.toolsets?.nsis, target.packager.buildResourcesDir);
84
+ }
85
+ return this.elevatePath;
86
+ }
87
+ // Injects elevate.exe directly into the already-built NSIS archive via a temp staging dir, and
88
+ // defers copying it into win-unpacked until every target has finished reading the shared
89
+ // appOutDir. This keeps elevate.exe in the dir-target output while guaranteeing concurrent
90
+ // targets (Squirrel, ZIP, appx, …) never capture it mid-build (fixes the #9852 race).
91
+ async addToArchive(archiveFile, target, format, archiveOptions, appOutDir) {
92
+ const elevatePath = await this.resolve(target);
93
+ if (!elevatePath) {
94
+ return;
95
+ }
96
+ const stagingDir = await target.packager.tempDirManager.getTempDir({ prefix: "elevate-staging" });
97
+ const resourcesDir = path.join(stagingDir, "resources");
98
+ await fs.mkdir(resourcesDir, { recursive: true });
99
+ const stagedElevate = path.join(resourcesDir, "elevate.exe");
100
+ await copyFile(elevatePath, stagedElevate, false);
101
+ if (!isWindowsSigningDisabled(target.packager.platformOptions)) {
102
+ await target.packager.signIf(stagedElevate);
103
+ }
104
+ // Reuse the parent archive's compression args so the appended entry is consistent with the
105
+ // rest of the archive (notably `store` and differential-aware builds, where bare `7za a`
106
+ // defaults — solid on, -mx=9, NTFS timestamps — would diverge from the original entries).
107
+ const args = compute7zCompressArgs(format, archiveOptions);
108
+ args.push(archiveFile, "resources/elevate.exe");
109
+ await exec(await getPath7za(), args, { cwd: stagingDir }, debug7z.enabled);
110
+ // Defer the win-unpacked copy: it must land after every concurrent target has packaged
111
+ // appOutDir, so it is never captured by Squirrel/zip/etc. The staged (and possibly signed)
112
+ // binary lives in tempDirManager, which is cleaned up only after the build finishes.
113
+ if (!this.stagedUnpackedCopies.has(appOutDir)) {
114
+ this.stagedUnpackedCopies.add(appOutDir);
115
+ target.packager.addBuildFinalizeTask(async () => {
116
+ // into a directory that extraResources were copied into: replace, never follow, a symlink at the name
117
+ const unpackedElevate = path.join(appOutDir, "resources", "elevate.exe");
118
+ await prepareFixedNameWrite(appOutDir, unpackedElevate, "elevate.exe helper");
119
+ await copyFile(stagedElevate, unpackedElevate, false);
120
+ });
121
+ }
83
122
  }
84
123
  }
85
124
  class BinaryReader {
@@ -175,19 +214,22 @@ export class UninstallerReader {
175
214
  }
176
215
  }
177
216
  }
178
- const executable = buffer.subarray(0, nsisOffset);
217
+ // copied, because the uninstaller icon is patched into it below
218
+ const executable = Buffer.from(buffer.subarray(0, nsisOffset));
179
219
  const nsisSize = buffer.length - nsisOffset;
180
220
  const nsisReader = new BinaryReader(buffer.subarray(nsisOffset, nsisOffset + nsisSize));
181
- const nsisSignature = [0xef, 0xbe, 0xad, 0xde, 0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x6f, 0x66, 0x74, 0x49, 0x6e, 0x73, 0x74];
182
- nsisReader.uint32(); // ?
183
- if (!nsisReader.match(nsisSignature)) {
221
+ if (!isNsisFirstHeader(buffer, nsisOffset)) {
184
222
  throw new Error("Invalid signature.");
185
223
  }
186
- nsisReader.uint32(); // ?
224
+ nsisReader.skip(NSIS_FIRST_HEADER_SIZE - 4);
187
225
  if (nsisSize !== nsisReader.uint32()) {
188
226
  throw new Error("Size mismatch.");
189
227
  }
228
+ // The data block is a sequence of [size | compressed flag][data] entries (non-solid compression only).
229
+ // makensis stores the uninstaller icon patch and then the uninstaller data as two consecutive entries (build.cpp uninstall_generate)
230
+ let iconData = null;
190
231
  let innerBuffer = null;
232
+ let previousBlock = null;
191
233
  while (true) {
192
234
  let size = nsisReader.uint32();
193
235
  const compressed = (size & 0x80000000) !== 0;
@@ -195,24 +237,89 @@ export class UninstallerReader {
195
237
  if (size === 0 || nsisReader.position + size > nsisReader.length || nsisReader.position >= nsisReader.length) {
196
238
  break;
197
239
  }
198
- let buffer = nsisReader.bytes(size);
240
+ let block = nsisReader.bytes(size);
199
241
  if (compressed) {
200
- buffer = zlib.inflateRawSync(buffer);
242
+ block = zlib.inflateRawSync(block);
201
243
  }
202
- const innerReader = new BinaryReader(buffer);
203
- innerReader.uint32(); // ?
204
- if (innerReader.match(nsisSignature)) {
244
+ if (isNsisFirstHeader(block, 0) && (block.readUInt32LE(0) & FH_FLAGS_UNINSTALL) !== 0) {
205
245
  if (innerBuffer) {
206
246
  throw new Error("Multiple inner blocks.");
207
247
  }
208
- innerBuffer = buffer;
248
+ innerBuffer = block;
249
+ iconData = previousBlock;
209
250
  }
251
+ previousBlock = block;
210
252
  }
211
- if (!innerBuffer) {
253
+ if (!innerBuffer || !iconData) {
212
254
  throw new Error("Inner block not found.");
213
255
  }
214
- await fs.writeFile(uninstallerPath, executable);
215
- await fs.appendFile(uninstallerPath, innerBuffer);
256
+ applyUninstallerIconData(executable, iconData);
257
+ const uninstaller = Buffer.concat([executable, innerBuffer]);
258
+ verifyNsisIntegrity(uninstaller);
259
+ await fs.writeFile(uninstallerPath, uninstaller);
260
+ }
261
+ }
262
+ const NSIS_FIRST_HEADER_SIZE = 28;
263
+ // siginfo (0xDEADBEEF) followed by "NullsoftInst"; the preceding 4 bytes of the firstheader are its flags
264
+ const NSIS_SIGNATURE = Buffer.from([0xef, 0xbe, 0xad, 0xde, 0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x6f, 0x66, 0x74, 0x49, 0x6e, 0x73, 0x74]);
265
+ const FH_FLAGS_MASK = 15;
266
+ const FH_FLAGS_UNINSTALL = 1;
267
+ const FH_FLAGS_NO_CRC = 4;
268
+ const FH_FLAGS_FORCE_CRC = 8;
269
+ function isNsisFirstHeader(data, offset) {
270
+ return (offset + NSIS_FIRST_HEADER_SIZE <= data.length &&
271
+ (data.readUInt32LE(offset) & ~FH_FLAGS_MASK) === 0 &&
272
+ data.subarray(offset + 4, offset + 4 + NSIS_SIGNATURE.length).equals(NSIS_SIGNATURE));
273
+ }
274
+ // WriteUninstaller (exehead/exec.c) patches the uninstaller icon into a copy of the installer's exehead before writing it out,
275
+ // and makensis computes the uninstaller CRC over that patched exehead. The icon data is a list of [size][offset][bytes] records.
276
+ function applyUninstallerIconData(executable, iconData) {
277
+ let position = 0;
278
+ // exec.c stops at the first zero byte (not a zero dword), so mirror that exactly
279
+ while (position < iconData.length && iconData[position] !== 0) {
280
+ if (position + 8 > iconData.length) {
281
+ throw new Error("Truncated uninstaller icon data.");
282
+ }
283
+ const size = iconData.readUInt32LE(position);
284
+ const offset = iconData.readUInt32LE(position + 4);
285
+ position += 8;
286
+ if (position + size > iconData.length || offset + size > executable.length) {
287
+ throw new Error("Invalid uninstaller icon data.");
288
+ }
289
+ iconData.copy(executable, offset, position, position + size);
290
+ position += size;
291
+ }
292
+ if (position >= iconData.length) {
293
+ throw new Error("Uninstaller icon data is not terminated.");
294
+ }
295
+ }
296
+ /**
297
+ * Performs the same integrity check that the NSIS exehead runs on startup (loadHeaders in exehead/fileform.c),
298
+ * so a broken uninstaller fails the build instead of showing "Installer integrity check has failed" to the end user.
299
+ */
300
+ export function verifyNsisIntegrity(data) {
301
+ // the exehead looks for the firstheader at 512-byte boundaries
302
+ for (let offset = 0; offset < data.length; offset += 512) {
303
+ if (!isNsisFirstHeader(data, offset)) {
304
+ continue;
305
+ }
306
+ const flags = data.readUInt32LE(offset);
307
+ if ((flags & FH_FLAGS_FORCE_CRC) === 0 && (flags & FH_FLAGS_NO_CRC) !== 0) {
308
+ return;
309
+ }
310
+ const lengthOfAllFollowingData = data.readUInt32LE(offset + 24);
311
+ if (lengthOfAllFollowingData < NSIS_FIRST_HEADER_SIZE + 4 || lengthOfAllFollowingData > data.length - offset) {
312
+ throw new Error("NSIS integrity check failed: data length mismatch.");
313
+ }
314
+ // the first 512 bytes are not covered, the CRC itself is stored right after the checked data
315
+ const crcOffset = offset + lengthOfAllFollowingData - 4;
316
+ const actual = zlib.crc32(data.subarray(offset === 0 ? 0 : 512, crcOffset));
317
+ const expected = data.readUInt32LE(crcOffset);
318
+ if (actual !== expected) {
319
+ throw new Error(`NSIS integrity check failed: CRC32 is 0x${actual.toString(16)}, expected 0x${expected.toString(16)}.`);
320
+ }
321
+ return;
216
322
  }
323
+ throw new Error("NSIS integrity check failed: NSIS header not found.");
217
324
  }
218
325
  //# sourceMappingURL=nsisUtil.js.map