app-builder-lib 27.0.0-alpha.13 → 27.0.0-alpha.15

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 (203) hide show
  1. package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -1
  2. package/dist/codeSign/win/hsmSignManager.js +3 -2
  3. package/dist/codeSign/win/hsmSignManager.js.map +1 -1
  4. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -1
  5. package/dist/codeSign/win/pkcs11SignManager.js +2 -1
  6. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -1
  7. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  8. package/dist/codeSign/win/signtoolBaseSignManager.js +15 -5
  9. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  10. package/dist/configuration.d.ts +78 -20
  11. package/dist/configuration.d.ts.map +1 -1
  12. package/dist/configuration.js.map +1 -1
  13. package/dist/indexInternal.d.ts +5 -3
  14. package/dist/indexInternal.d.ts.map +1 -1
  15. package/dist/indexInternal.js +4 -3
  16. package/dist/indexInternal.js.map +1 -1
  17. package/dist/options/FileAssociation.d.ts +1 -1
  18. package/dist/options/FileAssociation.js.map +1 -1
  19. package/dist/options/PlatformSpecificBuildOptions.d.ts +4 -1
  20. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  21. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  22. package/dist/options/SnapOptions.d.ts +13 -3
  23. package/dist/options/SnapOptions.d.ts.map +1 -1
  24. package/dist/options/SnapOptions.js.map +1 -1
  25. package/dist/options/macOptions.d.ts +9 -6
  26. package/dist/options/macOptions.d.ts.map +1 -1
  27. package/dist/options/macOptions.js.map +1 -1
  28. package/dist/options/winOptions.d.ts +2 -2
  29. package/dist/options/winOptions.js.map +1 -1
  30. package/dist/packager.d.ts +22 -0
  31. package/dist/packager.d.ts.map +1 -1
  32. package/dist/packager.js +115 -66
  33. package/dist/packager.js.map +1 -1
  34. package/dist/platformPackager.d.ts.map +1 -1
  35. package/dist/platformPackager.js +10 -8
  36. package/dist/platformPackager.js.map +1 -1
  37. package/dist/publish/PublishManager.d.ts +5 -0
  38. package/dist/publish/PublishManager.d.ts.map +1 -1
  39. package/dist/publish/PublishManager.js +102 -24
  40. package/dist/publish/PublishManager.js.map +1 -1
  41. package/dist/publish/manifestUploadCheck.d.ts +12 -0
  42. package/dist/publish/manifestUploadCheck.d.ts.map +1 -1
  43. package/dist/publish/manifestUploadCheck.js +84 -12
  44. package/dist/publish/manifestUploadCheck.js.map +1 -1
  45. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  46. package/dist/publish/updateInfoBuilder.js +12 -7
  47. package/dist/publish/updateInfoBuilder.js.map +1 -1
  48. package/dist/publish/updateManifestVerifier.d.ts +54 -0
  49. package/dist/publish/updateManifestVerifier.d.ts.map +1 -1
  50. package/dist/publish/updateManifestVerifier.js +121 -1
  51. package/dist/publish/updateManifestVerifier.js.map +1 -1
  52. package/dist/publish/updaterSettingsCheck.d.ts +8 -0
  53. package/dist/publish/updaterSettingsCheck.d.ts.map +1 -0
  54. package/dist/publish/updaterSettingsCheck.js +136 -0
  55. package/dist/publish/updaterSettingsCheck.js.map +1 -0
  56. package/dist/targets/ArchiveTarget.js +1 -1
  57. package/dist/targets/ArchiveTarget.js.map +1 -1
  58. package/dist/targets/archive.d.ts.map +1 -1
  59. package/dist/targets/archive.js +4 -3
  60. package/dist/targets/archive.js.map +1 -1
  61. package/dist/targets/blockmap/blockmap.d.ts +30 -0
  62. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  63. package/dist/targets/blockmap/blockmap.js +99 -31
  64. package/dist/targets/blockmap/blockmap.js.map +1 -1
  65. package/dist/targets/blockmap/blockmapV3.d.ts +36 -0
  66. package/dist/targets/blockmap/blockmapV3.d.ts.map +1 -0
  67. package/dist/targets/blockmap/blockmapV3.js +41 -0
  68. package/dist/targets/blockmap/blockmapV3.js.map +1 -0
  69. package/dist/targets/blockmap/verbatimRange.d.ts +6 -0
  70. package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -1
  71. package/dist/targets/blockmap/verbatimRange.js +11 -0
  72. package/dist/targets/blockmap/verbatimRange.js.map +1 -1
  73. package/dist/targets/differentialUpdateInfoBuilder.d.ts +92 -4
  74. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  75. package/dist/targets/differentialUpdateInfoBuilder.js +266 -10
  76. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  77. package/dist/targets/linux/FlatpakTarget.js +1 -1
  78. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  79. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  80. package/dist/targets/linux/FpmTarget.js +23 -31
  81. package/dist/targets/linux/FpmTarget.js.map +1 -1
  82. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  83. package/dist/targets/linux/LinuxTargetHelper.js +6 -14
  84. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  85. package/dist/targets/linux/appimage/appLauncher.d.ts +4 -3
  86. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  87. package/dist/targets/linux/appimage/appLauncher.js +10 -6
  88. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  89. package/dist/targets/linux/snap/coreLegacy.d.ts +8 -0
  90. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  91. package/dist/targets/linux/snap/coreLegacy.js +42 -9
  92. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  93. package/dist/targets/mac/pkg.d.ts.map +1 -1
  94. package/dist/targets/mac/pkg.js +13 -9
  95. package/dist/targets/mac/pkg.js.map +1 -1
  96. package/dist/targets/targetFactory.d.ts +22 -3
  97. package/dist/targets/targetFactory.d.ts.map +1 -1
  98. package/dist/targets/targetFactory.js +70 -29
  99. package/dist/targets/targetFactory.js.map +1 -1
  100. package/dist/targets/win/MsiTarget.d.ts +7 -0
  101. package/dist/targets/win/MsiTarget.d.ts.map +1 -1
  102. package/dist/targets/win/MsiTarget.js +140 -21
  103. package/dist/targets/win/MsiTarget.js.map +1 -1
  104. package/dist/targets/win/nsis/Defines.d.ts +1 -0
  105. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  106. package/dist/targets/win/nsis/Defines.js.map +1 -1
  107. package/dist/targets/win/nsis/NsisTarget.d.ts +3 -0
  108. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  109. package/dist/targets/win/nsis/NsisTarget.js +33 -12
  110. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  111. package/dist/targets/win/nsis/nsisLicense.d.ts.map +1 -1
  112. package/dist/targets/win/nsis/nsisLicense.js +8 -5
  113. package/dist/targets/win/nsis/nsisLicense.js.map +1 -1
  114. package/dist/targets/win/nsis/nsisOptions.d.ts +31 -3
  115. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  116. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  117. package/dist/targets/win/nsis/nsisScriptGenerator.d.ts +6 -0
  118. package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
  119. package/dist/targets/win/nsis/nsisScriptGenerator.js +16 -5
  120. package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
  121. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  122. package/dist/targets/win/nsis/nsisUtil.js +11 -29
  123. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  124. package/dist/toolsets/7zip.d.ts +10 -0
  125. package/dist/toolsets/7zip.d.ts.map +1 -1
  126. package/dist/toolsets/7zip.js +12 -1
  127. package/dist/toolsets/7zip.js.map +1 -1
  128. package/dist/toolsets/appimage.d.ts +3 -0
  129. package/dist/toolsets/appimage.d.ts.map +1 -1
  130. package/dist/toolsets/appimage.js +4 -1
  131. package/dist/toolsets/appimage.js.map +1 -1
  132. package/dist/toolsets/archive.d.ts +13 -0
  133. package/dist/toolsets/archive.d.ts.map +1 -0
  134. package/dist/toolsets/archive.js +55 -0
  135. package/dist/toolsets/archive.js.map +1 -0
  136. package/dist/toolsets/custom.d.ts.map +1 -1
  137. package/dist/toolsets/custom.js +19 -2
  138. package/dist/toolsets/custom.js.map +1 -1
  139. package/dist/toolsets/fpm.d.ts +23 -0
  140. package/dist/toolsets/fpm.d.ts.map +1 -1
  141. package/dist/toolsets/fpm.js +52 -19
  142. package/dist/toolsets/fpm.js.map +1 -1
  143. package/dist/toolsets/nsis.d.ts +23 -4
  144. package/dist/toolsets/nsis.d.ts.map +1 -1
  145. package/dist/toolsets/nsis.js +49 -14
  146. package/dist/toolsets/nsis.js.map +1 -1
  147. package/dist/toolsets/winCodeSign.d.ts +20 -1
  148. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  149. package/dist/toolsets/winCodeSign.js +32 -5
  150. package/dist/toolsets/winCodeSign.js.map +1 -1
  151. package/dist/toolsets/wix.d.ts +44 -0
  152. package/dist/toolsets/wix.d.ts.map +1 -0
  153. package/dist/toolsets/wix.js +91 -0
  154. package/dist/toolsets/wix.js.map +1 -0
  155. package/dist/util/buildOutputVerifier.d.ts +2 -1
  156. package/dist/util/buildOutputVerifier.d.ts.map +1 -1
  157. package/dist/util/buildOutputVerifier.js +41 -63
  158. package/dist/util/buildOutputVerifier.js.map +1 -1
  159. package/dist/util/bundledTool.d.ts +8 -0
  160. package/dist/util/bundledTool.d.ts.map +1 -1
  161. package/dist/util/bundledTool.js +34 -0
  162. package/dist/util/bundledTool.js.map +1 -1
  163. package/dist/util/electronGet.d.ts.map +1 -1
  164. package/dist/util/electronGet.js +107 -10
  165. package/dist/util/electronGet.js.map +1 -1
  166. package/dist/util/electronUpdaterCompatibility.d.ts +64 -0
  167. package/dist/util/electronUpdaterCompatibility.d.ts.map +1 -0
  168. package/dist/util/electronUpdaterCompatibility.js +82 -0
  169. package/dist/util/electronUpdaterCompatibility.js.map +1 -0
  170. package/dist/util/flags.d.ts +5 -0
  171. package/dist/util/flags.d.ts.map +1 -1
  172. package/dist/util/flags.js +8 -2
  173. package/dist/util/flags.js.map +1 -1
  174. package/dist/util/mac/macosVersion.d.ts +0 -1
  175. package/dist/util/mac/macosVersion.d.ts.map +1 -1
  176. package/dist/util/mac/macosVersion.js +0 -21
  177. package/dist/util/mac/macosVersion.js.map +1 -1
  178. package/dist/util/packageMetadata.d.ts +14 -1
  179. package/dist/util/packageMetadata.d.ts.map +1 -1
  180. package/dist/util/packageMetadata.js +115 -51
  181. package/dist/util/packageMetadata.js.map +1 -1
  182. package/dist/util/removedEnvVars.js +1 -1
  183. package/dist/util/removedEnvVars.js.map +1 -1
  184. package/dist/version.d.ts +1 -1
  185. package/dist/version.js +1 -1
  186. package/dist/version.js.map +1 -1
  187. package/package.json +8 -8
  188. package/scheme.json +182 -49
  189. package/templates/msi/template.xml +5 -5
  190. package/templates/msiWrapped/template.xml +1 -1
  191. package/templates/nsis/assistedInstaller.nsh +37 -1
  192. package/templates/nsis/common.nsh +142 -1
  193. package/templates/nsis/include/installUtil.nsh +12 -0
  194. package/templates/nsis/include/installer.nsh +12 -0
  195. package/templates/nsis/installSection.nsh +3 -0
  196. package/templates/nsis/installer.nsi +25 -13
  197. package/templates/nsis/multiUser.nsh +50 -10
  198. package/templates/nsis/portable.nsi +1 -1
  199. package/templates/nsis/uninstaller.nsh +6 -0
  200. package/dist/toolsets/linuxToolsMac.d.ts +0 -8
  201. package/dist/toolsets/linuxToolsMac.d.ts.map +0 -1
  202. package/dist/toolsets/linuxToolsMac.js +0 -44
  203. package/dist/toolsets/linuxToolsMac.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electronUpdaterCompatibility.d.ts","sourceRoot":"","sources":["../../src/util/electronUpdaterCompatibility.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AAC9F,OAAO,KAAK,EAAE,kBAAkB,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AQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,0FAA0F;IAC1F,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CACjC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,oBAAoB,GAAG;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,QAAQ,IAAI,WAAW,CAAC,CAAC,EAAE,oBAAoB,GAAG,IAAI;CAAE,EACrI,YAAY,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GACpG,KAAK,CAAC,0BAA0B,CAAC,CASnC"}
@@ -0,0 +1,82 @@
1
+ import * as semver from "semver";
2
+ import { DEFAULT_TARGET } from "../core.js";
3
+ /** Default `electronUpdaterCompatibility`: the electron-updater versions the installed apps are assumed to ship. */
4
+ export const DEFAULT_ELECTRON_UPDATER_COMPATIBILITY = ">=7";
5
+ /** v27 breaking-changes entry on the block map format following `electronUpdaterCompatibility`, linked from the build warning and error. */
6
+ export const BLOCK_MAP_FORMAT_DOCS_URL = "https://www.electron.build/docs/migration/v27-build-changes#block-map-format-follows-electronupdatercompatibility";
7
+ /** electron-updater versions before this one cannot read the binary block map; for ranges (`electronUpdaterCompatibility`). */
8
+ export const BINARY_BLOCK_MAP_MIN_UPDATER = "7.0.0";
9
+ /**
10
+ * The first electron-updater release that reads the binary block map: the 7.0.0 prereleases up to 7.0.0-alpha.12 (npm `next`)
11
+ * cannot, though a range such as `>=7` reads as electron-updater 7.
12
+ */
13
+ export const BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE = "7.0.0-alpha.13";
14
+ /**
15
+ * The first electron-updater release that rejects update checks and downloads until the app sets `autoUpdater.crossOriginHeaders`:
16
+ * the releases up to 7.0.0-alpha.13 (npm `next`) have no such property.
17
+ */
18
+ export const CROSS_ORIGIN_HEADERS_MIN_UPDATER_RELEASE = "7.0.0-alpha.14";
19
+ /**
20
+ * Whether the app's electron-updater (an installed version or a declared range) may reject update checks until the app sets
21
+ * `autoUpdater.crossOriginHeaders`: one whose version cannot be read (`catalog:`, a dist-tag) may.
22
+ */
23
+ export function mayRequireCrossOriginHeaders(updater) {
24
+ return mayBeAtLeast(updater, CROSS_ORIGIN_HEADERS_MIN_UPDATER_RELEASE);
25
+ }
26
+ /**
27
+ * The first electron-updater release with `autoUpdater.allowUnverifiedLinuxPackages`: before it, the property does nothing and rpm
28
+ * updates install with the package manager's signature check bypassed.
29
+ */
30
+ export const ALLOW_UNVERIFIED_LINUX_PACKAGES_MIN_UPDATER_RELEASE = "7.0.0-alpha.5";
31
+ /**
32
+ * Whether the app's electron-updater (an installed version or a declared range) may honor `autoUpdater.allowUnverifiedLinuxPackages`:
33
+ * one whose version cannot be read (`catalog:`, a dist-tag) may.
34
+ */
35
+ export function maySupportAllowUnverifiedLinuxPackages(updater) {
36
+ return mayBeAtLeast(updater, ALLOW_UNVERIFIED_LINUX_PACKAGES_MIN_UPDATER_RELEASE);
37
+ }
38
+ /** Whether the version or range of `updater` may include `release` or a later one; true when it cannot be read. */
39
+ function mayBeAtLeast(updater, release) {
40
+ const range = updater.isUnresolvable ? null : semver.validRange(updater.version, { includePrerelease: true });
41
+ return range == null || !semver.gtr(release, range, { includePrerelease: true });
42
+ }
43
+ /** Whether the `electronUpdaterCompatibility` range includes only electron-updater versions that read the binary block map. */
44
+ export function isBinaryBlockMapSupported(range) {
45
+ // no includePrerelease: it would make ">=7" intersect "<7.0.0" at the 7.0.0-0 prerelease point
46
+ return !semver.intersects(range, `<${BINARY_BLOCK_MAP_MIN_UPDATER}`);
47
+ }
48
+ /**
49
+ * Whether a build with the `blockmap` option `value` writes binary `.blockmap` files for `range`, without the validation and
50
+ * warning of `resolveBlockMapFormat`.
51
+ */
52
+ export function writesBinaryBlockMap(value, range) {
53
+ return value !== "v2" && isBinaryBlockMapSupported(range);
54
+ }
55
+ /** The `electronUpdaterCompatibility` range that applies to a platform: the platform option, then the root option, then the default. */
56
+ export function resolveElectronUpdaterCompatibility(platformOptions, config) {
57
+ return platformOptions?.electronUpdaterCompatibility || config.electronUpdaterCompatibility || DEFAULT_ELECTRON_UPDATER_COMPATIBILITY;
58
+ }
59
+ /** The targets whose `.blockmap` file electron-updater reads, by platform; `DEFAULT_TARGET` (an NSIS installer, a zip and a dmg) among them. */
60
+ const BLOCK_MAP_FILE_TARGETS = {
61
+ // not the portable executable, nor nsis-web, whose package embeds its map
62
+ win: [DEFAULT_TARGET, "nsis"],
63
+ // MacUpdater downloads only the zip, so a dmg's map is never read
64
+ mac: [DEFAULT_TARGET, "zip"],
65
+ // an AppImage embeds its map
66
+ linux: [],
67
+ };
68
+ /**
69
+ * The requirement of each platform a build targets, resolved as the targets resolve them (`platformOptions`, then the root option,
70
+ * then the default). `builtTargets`: the target names each platform builds (see `resolveTargetNames`).
71
+ */
72
+ export function electronUpdaterRequirements(config, builtTargets) {
73
+ const requirements = [];
74
+ for (const [{ name, buildConfigurationKey: key }, targetNames] of builtTargets) {
75
+ const isKnown = key === "mac" || key === "win" || key === "linux";
76
+ const range = resolveElectronUpdaterCompatibility(isKnown ? config[key] : null, config);
77
+ const writesBlockMapFile = isKnown && [...targetNames].some(it => BLOCK_MAP_FILE_TARGETS[key].includes(it));
78
+ requirements.push({ platform: name, range, binaryBlockMap: writesBlockMapFile && writesBinaryBlockMap(config.blockmap, range) });
79
+ }
80
+ return requirements;
81
+ }
82
+ //# sourceMappingURL=electronUpdaterCompatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electronUpdaterCompatibility.js","sourceRoot":"","sources":["../../src/util/electronUpdaterCompatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAA;AAI1D,oHAAoH;AACpH,MAAM,CAAC,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AE,CAAC,CAAA;IAClI,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["import * as semver from \"semver\"\nimport { DEFAULT_TARGET, type Platform } from \"../core.js\"\nimport type { PlatformSpecificBuildOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport type { AppElectronUpdater } from \"./packageMetadata.js\"\n\n/** Default `electronUpdaterCompatibility`: the electron-updater versions the installed apps are assumed to ship. */\nexport const DEFAULT_ELECTRON_UPDATER_COMPATIBILITY = \">=7\"\n\n/** v27 breaking-changes entry on the block map format following `electronUpdaterCompatibility`, linked from the build warning and error. */\nexport const BLOCK_MAP_FORMAT_DOCS_URL = \"https://www.electron.build/docs/migration/v27-build-changes#block-map-format-follows-electronupdatercompatibility\"\n\n/** electron-updater versions before this one cannot read the binary block map; for ranges (`electronUpdaterCompatibility`). */\nexport const BINARY_BLOCK_MAP_MIN_UPDATER = \"7.0.0\"\n\n/**\n * The first electron-updater release that reads the binary block map: the 7.0.0 prereleases up to 7.0.0-alpha.12 (npm `next`)\n * cannot, though a range such as `>=7` reads as electron-updater 7.\n */\nexport const BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE = \"7.0.0-alpha.13\"\n\n/**\n * The first electron-updater release that rejects update checks and downloads until the app sets `autoUpdater.crossOriginHeaders`:\n * the releases up to 7.0.0-alpha.13 (npm `next`) have no such property.\n */\nexport const CROSS_ORIGIN_HEADERS_MIN_UPDATER_RELEASE = \"7.0.0-alpha.14\"\n\n/**\n * Whether the app's electron-updater (an installed version or a declared range) may reject update checks until the app sets\n * `autoUpdater.crossOriginHeaders`: one whose version cannot be read (`catalog:`, a dist-tag) may.\n */\nexport function mayRequireCrossOriginHeaders(updater: Pick<AppElectronUpdater, \"version\" | \"isUnresolvable\">): boolean {\n return mayBeAtLeast(updater, CROSS_ORIGIN_HEADERS_MIN_UPDATER_RELEASE)\n}\n\n/**\n * The first electron-updater release with `autoUpdater.allowUnverifiedLinuxPackages`: before it, the property does nothing and rpm\n * updates install with the package manager's signature check bypassed.\n */\nexport const ALLOW_UNVERIFIED_LINUX_PACKAGES_MIN_UPDATER_RELEASE = \"7.0.0-alpha.5\"\n\n/**\n * Whether the app's electron-updater (an installed version or a declared range) may honor `autoUpdater.allowUnverifiedLinuxPackages`:\n * one whose version cannot be read (`catalog:`, a dist-tag) may.\n */\nexport function maySupportAllowUnverifiedLinuxPackages(updater: Pick<AppElectronUpdater, \"version\" | \"isUnresolvable\">): boolean {\n return mayBeAtLeast(updater, ALLOW_UNVERIFIED_LINUX_PACKAGES_MIN_UPDATER_RELEASE)\n}\n\n/** Whether the version or range of `updater` may include `release` or a later one; true when it cannot be read. */\nfunction mayBeAtLeast(updater: Pick<AppElectronUpdater, \"version\" | \"isUnresolvable\">, release: string): boolean {\n const range = updater.isUnresolvable ? null : semver.validRange(updater.version, { includePrerelease: true })\n return range == null || !semver.gtr(release, range, { includePrerelease: true })\n}\n\n/** Whether the `electronUpdaterCompatibility` range includes only electron-updater versions that read the binary block map. */\nexport function isBinaryBlockMapSupported(range: string): boolean {\n // no includePrerelease: it would make \">=7\" intersect \"<7.0.0\" at the 7.0.0-0 prerelease point\n return !semver.intersects(range, `<${BINARY_BLOCK_MAP_MIN_UPDATER}`)\n}\n\n/**\n * Whether a build with the `blockmap` option `value` writes binary `.blockmap` files for `range`, without the validation and\n * warning of `resolveBlockMapFormat`.\n */\nexport function writesBinaryBlockMap(value: unknown, range: string): boolean {\n return value !== \"v2\" && isBinaryBlockMapSupported(range)\n}\n\n/** The `electronUpdaterCompatibility` range that applies to a platform: the platform option, then the root option, then the default. */\nexport function resolveElectronUpdaterCompatibility(\n platformOptions: Pick<PlatformSpecificBuildOptions, \"electronUpdaterCompatibility\"> | null | undefined,\n config: Pick<PlatformSpecificBuildOptions, \"electronUpdaterCompatibility\">\n): string {\n return platformOptions?.electronUpdaterCompatibility || config.electronUpdaterCompatibility || DEFAULT_ELECTRON_UPDATER_COMPATIBILITY\n}\n\ntype CompatibilityOptions = Pick<PlatformSpecificBuildOptions, \"electronUpdaterCompatibility\">\ntype PlatformKey = \"mac\" | \"win\" | \"linux\"\n\n/** The targets whose `.blockmap` file electron-updater reads, by platform; `DEFAULT_TARGET` (an NSIS installer, a zip and a dmg) among them. */\nconst BLOCK_MAP_FILE_TARGETS: Readonly<Record<PlatformKey, ReadonlyArray<string>>> = {\n // not the portable executable, nor nsis-web, whose package embeds its map\n win: [DEFAULT_TARGET, \"nsis\"],\n // MacUpdater downloads only the zip, so a dmg's map is never read\n mac: [DEFAULT_TARGET, \"zip\"],\n // an AppImage embeds its map\n linux: [],\n}\n\n/** What the app's own electron-updater has to read on one platform of a build. */\nexport interface ElectronUpdaterRequirement {\n readonly platform: string\n /** the `electronUpdaterCompatibility` of the platform */\n readonly range: string\n /** whether the platform publishes binary `.blockmap` files that electron-updater reads */\n readonly binaryBlockMap: boolean\n}\n\n/**\n * The requirement of each platform a build targets, resolved as the targets resolve them (`platformOptions`, then the root option,\n * then the default). `builtTargets`: the target names each platform builds (see `resolveTargetNames`).\n */\nexport function electronUpdaterRequirements(\n config: CompatibilityOptions & { readonly blockmap?: unknown } & { readonly [platform in PlatformKey]?: CompatibilityOptions | null },\n builtTargets: Iterable<readonly [Pick<Platform, \"name\" | \"buildConfigurationKey\">, Iterable<string>]>\n): Array<ElectronUpdaterRequirement> {\n const requirements: Array<ElectronUpdaterRequirement> = []\n for (const [{ name, buildConfigurationKey: key }, targetNames] of builtTargets) {\n const isKnown = key === \"mac\" || key === \"win\" || key === \"linux\"\n const range = resolveElectronUpdaterCompatibility(isKnown ? config[key] : null, config)\n const writesBlockMapFile = isKnown && [...targetNames].some(it => BLOCK_MAP_FILE_TARGETS[key].includes(it))\n requirements.push({ platform: name, range, binaryBlockMap: writesBlockMapFile && writesBinaryBlockMap(config.blockmap, range) })\n }\n return requirements\n}\n"]}
@@ -2,6 +2,11 @@ export declare function isAutoDiscoveryCodeSignIdentity(): boolean;
2
2
  export declare function isCscForPullRequest(): boolean;
3
3
  export declare function isBuildCacheEnabled(): boolean;
4
4
  export declare function isRemoveStageDirEvenIfDebug(): boolean;
5
+ /**
6
+ * Only `true` or `1` count: unlike the other boolean flags, an empty value does not. Offline mode drops
7
+ * the timestamp from Windows signatures, and a CI template that maps an unset variable into the
8
+ * environment exports an empty value — that must not silently ship untimestamped release binaries.
9
+ */
5
10
  export declare function isOfflineModeEnabled(): boolean;
6
11
  export declare function isPublishForPullRequest(): boolean;
7
12
  export declare function isNpmNoBinLinks(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAKA,wBAAgB,+BAA+B,YAE9C;AAED,wBAAgB,mBAAmB,YAElC;AAID,wBAAgB,mBAAmB,YAElC;AAED,wBAAgB,2BAA2B,YAE1C;AAED,wBAAgB,oBAAoB,YAEnC;AAID,wBAAgB,uBAAuB,YAEtC;AAID,wBAAgB,eAAe,YAE9B;AAID,wBAAgB,QAAQ,YAEvB;AAID,wBAAgB,UAAU,YAEzB;AAED,wBAAgB,qBAAqB,YAEpC;AAkHD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
1
+ {"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAKA,wBAAgB,+BAA+B,YAE9C;AAED,wBAAgB,mBAAmB,YAElC;AAID,wBAAgB,mBAAmB,YAElC;AAED,wBAAgB,2BAA2B,YAE1C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,YAGnC;AAID,wBAAgB,uBAAuB,YAEtC;AAID,wBAAgB,eAAe,YAE9B;AAID,wBAAgB,QAAQ,YAEvB;AAID,wBAAgB,UAAU,YAEzB;AAED,wBAAgB,qBAAqB,YAEpC;AAkHD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
@@ -14,8 +14,14 @@ export function isBuildCacheEnabled() {
14
14
  export function isRemoveStageDirEvenIfDebug() {
15
15
  return isEnvTrue(process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG);
16
16
  }
17
+ /**
18
+ * Only `true` or `1` count: unlike the other boolean flags, an empty value does not. Offline mode drops
19
+ * the timestamp from Windows signatures, and a CI template that maps an unset variable into the
20
+ * environment exports an empty value — that must not silently ship untimestamped release binaries.
21
+ */
17
22
  export function isOfflineModeEnabled() {
18
- return isEnvTrue(process.env.ELECTRON_BUILDER_OFFLINE);
23
+ const value = process.env.ELECTRON_BUILDER_OFFLINE?.trim();
24
+ return value === "true" || value === "1";
19
25
  }
20
26
  // ─── Publishing ───────────────────────────────────────────────────────────────
21
27
  export function isPublishForPullRequest() {
@@ -54,7 +60,7 @@ const REMOVED_ENV_VARS = {
54
60
  },
55
61
  LINUX_TOOLS_MAC_PATH: {
56
62
  controlled: "the linux-tools-mac bundle (ar, lzip, gtar) used when building Linux targets on macOS",
57
- replacement: 'toolsets.linuxToolsMac: { url: "file:///path/to/linux-tools-mac-dir" }',
63
+ replacement: 'toolsets.archive: { url: "file:///path/to/archive-dir" }',
58
64
  },
59
65
  CUSTOM_FPM_PATH: {
60
66
  controlled: "the FPM executable",
@@ -1 +1 @@
1
- {"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,iFAAiF;AAEjF,MAAM,UAAU,+BAA+B;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,OAAO,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACpD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC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IAAI,CAAA;IACb,CAAC;IAED,MAAM,MAAM,GACV,KAAK,CAAC,MAAM,KAAK,CAAC;QAChB,CAAC,CAAC,4BAA4B,KAAK,CAAC,CAAC,CAAC,0DAA0D;QAChG,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,2FAA2F,CAAA;IAChH,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC/B,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;QAC1D,OAAO,KAAK,IAAI,eAAe,UAAU,YAAY,WAAW,WAAW,CAAA;IAC7E,CAAC,CAAC,CAAA;IACF,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,6EAA6E,EAAE,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC5K,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,IAAI,qBAAqB,EAAE,CAAC;QAC1B,OAAM;IACR,CAAC;IACD,qBAAqB,GAAG,IAAI,CAAA;IAC5B,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAA;IACrC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,wBAAwB;IACtC,qBAAqB,GAAG,KAAK,CAAA;AAC/B,CAAC","sourcesContent":["import { InvalidConfigurationError, isEnvTrue } from \"builder-util\"\nimport { removedEnvVarDocsUrl } from \"./removedEnvVars.js\"\n\n// ─── Code signing ─────────────────────────────────────────────────────────────\n\nexport function isAutoDiscoveryCodeSignIdentity() {\n return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== \"false\"\n}\n\nexport function isCscForPullRequest() {\n return isEnvTrue(process.env.CSC_FOR_PULL_REQUEST)\n}\n\n// ─── Build behaviour ──────────────────────────────────────────────────────────\n\nexport function isBuildCacheEnabled() {\n return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)\n}\n\nexport function isRemoveStageDirEvenIfDebug() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG)\n}\n\nexport function isOfflineModeEnabled() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_OFFLINE)\n}\n\n// ─── Publishing ───────────────────────────────────────────────────────────────\n\nexport function isPublishForPullRequest() {\n return isEnvTrue(process.env.PUBLISH_FOR_PULL_REQUEST)\n}\n\n// ─── Package metadata / dependencies ─────────────────────────────────────────\n\nexport function isNpmNoBinLinks() {\n return isEnvTrue(process.env.NPM_NO_BIN_LINKS)\n}\n\n// ─── CI environment detection ─────────────────────────────────────────────────\n\nexport function isTravis() {\n return isEnvTrue(process.env.TRAVIS)\n}\n\n// ─── Platform toolset overrides ───────────────────────────────────────────────\n\nexport function isFpmDebug() {\n return isEnvTrue(process.env.FPM_DEBUG)\n}\n\nexport function isSnapDestructiveMode() {\n return isEnvTrue(process.env.SNAP_DESTRUCTIVE_MODE)\n}\n\n// ─── Removed environment variables (v26 → v27) ───────────────────────────────\n\ninterface RemovedEnvVar {\n /** How to achieve the same thing in v27. */\n readonly replacement: string\n /** What the variable used to control, so the user can tell whether they still need it. */\n readonly controlled: string\n}\n\n/**\n * Environment variables that v26 honored and v27 ignores.\n *\n * These are the most silent of all the v27 breaking changes: unlike a removed config key, nothing\n * validates `process.env`, so a CI image exporting `USE_SYSTEM_WINE` or `ELECTRON_BUILDER_NSIS_DIR`\n * silently switches toolchain with a green build. `CI_BUILD_TAG` is worse still — combined with the\n * removal of implicit publishing, a tagged release simply stops uploading.\n *\n * Toolsets are now configured through the `toolsets` build option, which accepts an `https://` URL\n * (downloaded and cached) or a `file://` path (used as-is).\n */\nconst REMOVED_ENV_VARS: Record<string, RemovedEnvVar> = {\n APPIMAGE_TOOLS_PATH: {\n controlled: \"the AppImage build tools (mksquashfs, runtime)\",\n replacement: 'toolsets.appimage: { url: \"file:///path/to/appimage-tools-dir\" }',\n },\n LINUX_TOOLS_MAC_PATH: {\n controlled: \"the linux-tools-mac bundle (ar, lzip, gtar) used when building Linux targets on macOS\",\n replacement: 'toolsets.linuxToolsMac: { url: \"file:///path/to/linux-tools-mac-dir\" }',\n },\n CUSTOM_FPM_PATH: {\n controlled: \"the FPM executable\",\n replacement: 'toolsets.fpm: { url: \"file:///path/to/fpm-dir\" }',\n },\n USE_SYSTEM_FPM: {\n controlled: \"forcing the host-installed fpm instead of the bundled one\",\n replacement: 'toolsets.fpm: { url: \"file:///path/to/fpm-dir\" }',\n },\n ELECTRON_BUILDER_NSIS_DIR: {\n controlled: \"the NSIS compiler bundle directory\",\n replacement: 'toolsets.nsis: { url: \"file:///path/to/nsis-bundle-dir\" }',\n },\n ELECTRON_BUILDER_NSIS_RESOURCES_DIR: {\n controlled: \"the NSIS resources/plugins directory\",\n replacement: 'toolsets.nsis: { url: \"file:///path/to/nsis-bundle-dir\" } (the v27 nsis bundle carries compiler and resources together)',\n },\n ELECTRON_BUILDER_WINE_TOOLSET_DIR: {\n controlled: \"the Wine bundle directory\",\n replacement: 'toolsets.wine: { url: \"file:///path/to/wine-dir\" }',\n },\n USE_SYSTEM_WINE: {\n controlled: \"forcing the host-installed Wine instead of the downloaded bundle\",\n replacement: 'toolsets.wine: \"system\" (the host `wine` is already the default on macOS and Linux, so you can simply drop this variable)',\n },\n USE_SYSTEM_SIGNCODE: {\n controlled: \"forcing the host signtool/signcode instead of the bundled winCodeSign toolset\",\n replacement: 'win.sign (e.g. { \"win\": { \"sign\": { \"type\": \"signtool\", … } } }) together with toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n USE_SYSTEM_OSSLSIGNCODE: {\n controlled: \"forcing the host osslsigncode instead of the bundled one\",\n replacement: 'win.sign together with toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n SIGNTOOL_PATH: {\n controlled: \"the path to signtool.exe\",\n replacement: 'toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n ELECTRON_BUILDER_7ZIP_PATH: {\n controlled: \"the 7-Zip executable\",\n replacement: 'toolsets.sevenZip: { url: \"file:///path/to/dir\" } (a custom sevenZip bundle must be a .tar.gz, .zip, or bare file:// directory)',\n },\n ELECTRON_BUILDER_ICONS_TOOLSET_DIR: {\n controlled: \"the icons toolset bundle directory\",\n replacement: 'toolsets.icons: { url: \"file:///path/to/icons-bundle-dir\" }',\n },\n CI_BUILD_TAG: {\n controlled: \"the release tag used by the publisher\",\n replacement: \"the CI_COMMIT_TAG environment variable (the standard GitLab CI variable)\",\n },\n ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY: {\n controlled: \"bundling electron-builder itself when it was listed under production dependencies\",\n replacement: 'the ignoredProductionDependencies build option — drop \"electron-builder\" from the list to ship it inside your app',\n },\n}\n\n/** Emitted once per process; a build can invoke the packager more than once. */\nlet removedEnvVarsChecked = false\n\n/**\n * Fails the build when a removed environment variable is set, naming the `toolsets` (or other)\n * replacement. Without this the variable is simply ignored and the build silently uses a different\n * toolchain than the one CI asked for.\n *\n * @internal exported for tests\n */\nexport function checkRemovedEnvVars(env: NodeJS.ProcessEnv = process.env): string | null {\n const found = Object.keys(REMOVED_ENV_VARS)\n .filter(name => env[name] != null && env[name] !== \"\")\n .sort()\n if (found.length === 0) {\n return null\n }\n\n const header =\n found.length === 1\n ? `The environment variable ${found[0]} was removed in electron-builder v27 and is now ignored:`\n : `${found.length} environment variables set here were removed in electron-builder v27 and are now ignored:`\n const entries = found.map(name => {\n const { controlled, replacement } = REMOVED_ENV_VARS[name]\n return `• ${name} controlled ${controlled}.\\n Use ${replacement} instead.`\n })\n return [header, \"\", ...entries, \"\", \"Unset the variable once you have moved the setting into your configuration.\", ...new Set(found.map(removedEnvVarDocsUrl))].join(\"\\n\")\n}\n\n/**\n * Throws when a removed environment variable is set. Called once per process from `Packager.build()`\n * so it runs for every entrypoint (CLI, programmatic `build()`, and a directly constructed Packager).\n */\nexport function assertNoRemovedEnvVars(): void {\n if (removedEnvVarsChecked) {\n return\n }\n removedEnvVarsChecked = true\n const message = checkRemovedEnvVars()\n if (message != null) {\n throw new InvalidConfigurationError(message)\n }\n}\n\n/** @internal exported for tests — lets a test re-arm the once-per-process guard. */\nexport function resetRemovedEnvVarsCheck(): void {\n removedEnvVarsChecked = false\n}\n"]}
1
+ {"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,iFAAiF;AAEjF,MAAM,UAAU,+BAA+B;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,OAAO,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACpD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;AACrE,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAA;AAC3E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,IAAI,EAAE,CAAA;IAC1D,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,CAAA;AAC1C,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,uBAAuB;I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AAW,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;QAC1D,OAAO,KAAK,IAAI,eAAe,UAAU,YAAY,WAAW,WAAW,CAAA;IAC7E,CAAC,CAAC,CAAA;IACF,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,6EAA6E,EAAE,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC5K,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,IAAI,qBAAqB,EAAE,CAAC;QAC1B,OAAM;IACR,CAAC;IACD,qBAAqB,GAAG,IAAI,CAAA;IAC5B,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAA;IACrC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,wBAAwB;IACtC,qBAAqB,GAAG,KAAK,CAAA;AAC/B,CAAC","sourcesContent":["import { InvalidConfigurationError, isEnvTrue } from \"builder-util\"\nimport { removedEnvVarDocsUrl } from \"./removedEnvVars.js\"\n\n// ─── Code signing ─────────────────────────────────────────────────────────────\n\nexport function isAutoDiscoveryCodeSignIdentity() {\n return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== \"false\"\n}\n\nexport function isCscForPullRequest() {\n return isEnvTrue(process.env.CSC_FOR_PULL_REQUEST)\n}\n\n// ─── Build behaviour ──────────────────────────────────────────────────────────\n\nexport function isBuildCacheEnabled() {\n return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)\n}\n\nexport function isRemoveStageDirEvenIfDebug() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG)\n}\n\n/**\n * Only `true` or `1` count: unlike the other boolean flags, an empty value does not. Offline mode drops\n * the timestamp from Windows signatures, and a CI template that maps an unset variable into the\n * environment exports an empty value — that must not silently ship untimestamped release binaries.\n */\nexport function isOfflineModeEnabled() {\n const value = process.env.ELECTRON_BUILDER_OFFLINE?.trim()\n return value === \"true\" || value === \"1\"\n}\n\n// ─── Publishing ───────────────────────────────────────────────────────────────\n\nexport function isPublishForPullRequest() {\n return isEnvTrue(process.env.PUBLISH_FOR_PULL_REQUEST)\n}\n\n// ─── Package metadata / dependencies ─────────────────────────────────────────\n\nexport function isNpmNoBinLinks() {\n return isEnvTrue(process.env.NPM_NO_BIN_LINKS)\n}\n\n// ─── CI environment detection ─────────────────────────────────────────────────\n\nexport function isTravis() {\n return isEnvTrue(process.env.TRAVIS)\n}\n\n// ─── Platform toolset overrides ───────────────────────────────────────────────\n\nexport function isFpmDebug() {\n return isEnvTrue(process.env.FPM_DEBUG)\n}\n\nexport function isSnapDestructiveMode() {\n return isEnvTrue(process.env.SNAP_DESTRUCTIVE_MODE)\n}\n\n// ─── Removed environment variables (v26 → v27) ───────────────────────────────\n\ninterface RemovedEnvVar {\n /** How to achieve the same thing in v27. */\n readonly replacement: string\n /** What the variable used to control, so the user can tell whether they still need it. */\n readonly controlled: string\n}\n\n/**\n * Environment variables that v26 honored and v27 ignores.\n *\n * These are the most silent of all the v27 breaking changes: unlike a removed config key, nothing\n * validates `process.env`, so a CI image exporting `USE_SYSTEM_WINE` or `ELECTRON_BUILDER_NSIS_DIR`\n * silently switches toolchain with a green build. `CI_BUILD_TAG` is worse still — combined with the\n * removal of implicit publishing, a tagged release simply stops uploading.\n *\n * Toolsets are now configured through the `toolsets` build option, which accepts an `https://` URL\n * (downloaded and cached) or a `file://` path (used as-is).\n */\nconst REMOVED_ENV_VARS: Record<string, RemovedEnvVar> = {\n APPIMAGE_TOOLS_PATH: {\n controlled: \"the AppImage build tools (mksquashfs, runtime)\",\n replacement: 'toolsets.appimage: { url: \"file:///path/to/appimage-tools-dir\" }',\n },\n LINUX_TOOLS_MAC_PATH: {\n controlled: \"the linux-tools-mac bundle (ar, lzip, gtar) used when building Linux targets on macOS\",\n replacement: 'toolsets.archive: { url: \"file:///path/to/archive-dir\" }',\n },\n CUSTOM_FPM_PATH: {\n controlled: \"the FPM executable\",\n replacement: 'toolsets.fpm: { url: \"file:///path/to/fpm-dir\" }',\n },\n USE_SYSTEM_FPM: {\n controlled: \"forcing the host-installed fpm instead of the bundled one\",\n replacement: 'toolsets.fpm: { url: \"file:///path/to/fpm-dir\" }',\n },\n ELECTRON_BUILDER_NSIS_DIR: {\n controlled: \"the NSIS compiler bundle directory\",\n replacement: 'toolsets.nsis: { url: \"file:///path/to/nsis-bundle-dir\" }',\n },\n ELECTRON_BUILDER_NSIS_RESOURCES_DIR: {\n controlled: \"the NSIS resources/plugins directory\",\n replacement: 'toolsets.nsis: { url: \"file:///path/to/nsis-bundle-dir\" } (the v27 nsis bundle carries compiler and resources together)',\n },\n ELECTRON_BUILDER_WINE_TOOLSET_DIR: {\n controlled: \"the Wine bundle directory\",\n replacement: 'toolsets.wine: { url: \"file:///path/to/wine-dir\" }',\n },\n USE_SYSTEM_WINE: {\n controlled: \"forcing the host-installed Wine instead of the downloaded bundle\",\n replacement: 'toolsets.wine: \"system\" (the host `wine` is already the default on macOS and Linux, so you can simply drop this variable)',\n },\n USE_SYSTEM_SIGNCODE: {\n controlled: \"forcing the host signtool/signcode instead of the bundled winCodeSign toolset\",\n replacement: 'win.sign (e.g. { \"win\": { \"sign\": { \"type\": \"signtool\", … } } }) together with toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n USE_SYSTEM_OSSLSIGNCODE: {\n controlled: \"forcing the host osslsigncode instead of the bundled one\",\n replacement: 'win.sign together with toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n SIGNTOOL_PATH: {\n controlled: \"the path to signtool.exe\",\n replacement: 'toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n ELECTRON_BUILDER_7ZIP_PATH: {\n controlled: \"the 7-Zip executable\",\n replacement: 'toolsets.sevenZip: { url: \"file:///path/to/dir\" } (a custom sevenZip bundle must be a .tar.gz, .zip, or bare file:// directory)',\n },\n ELECTRON_BUILDER_ICONS_TOOLSET_DIR: {\n controlled: \"the icons toolset bundle directory\",\n replacement: 'toolsets.icons: { url: \"file:///path/to/icons-bundle-dir\" }',\n },\n CI_BUILD_TAG: {\n controlled: \"the release tag used by the publisher\",\n replacement: \"the CI_COMMIT_TAG environment variable (the standard GitLab CI variable)\",\n },\n ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY: {\n controlled: \"bundling electron-builder itself when it was listed under production dependencies\",\n replacement: 'the ignoredProductionDependencies build option — drop \"electron-builder\" from the list to ship it inside your app',\n },\n}\n\n/** Emitted once per process; a build can invoke the packager more than once. */\nlet removedEnvVarsChecked = false\n\n/**\n * Fails the build when a removed environment variable is set, naming the `toolsets` (or other)\n * replacement. Without this the variable is simply ignored and the build silently uses a different\n * toolchain than the one CI asked for.\n *\n * @internal exported for tests\n */\nexport function checkRemovedEnvVars(env: NodeJS.ProcessEnv = process.env): string | null {\n const found = Object.keys(REMOVED_ENV_VARS)\n .filter(name => env[name] != null && env[name] !== \"\")\n .sort()\n if (found.length === 0) {\n return null\n }\n\n const header =\n found.length === 1\n ? `The environment variable ${found[0]} was removed in electron-builder v27 and is now ignored:`\n : `${found.length} environment variables set here were removed in electron-builder v27 and are now ignored:`\n const entries = found.map(name => {\n const { controlled, replacement } = REMOVED_ENV_VARS[name]\n return `• ${name} controlled ${controlled}.\\n Use ${replacement} instead.`\n })\n return [header, \"\", ...entries, \"\", \"Unset the variable once you have moved the setting into your configuration.\", ...new Set(found.map(removedEnvVarDocsUrl))].join(\"\\n\")\n}\n\n/**\n * Throws when a removed environment variable is set. Called once per process from `Packager.build()`\n * so it runs for every entrypoint (CLI, programmatic `build()`, and a directly constructed Packager).\n */\nexport function assertNoRemovedEnvVars(): void {\n if (removedEnvVarsChecked) {\n return\n }\n removedEnvVarsChecked = true\n const message = checkRemovedEnvVars()\n if (message != null) {\n throw new InvalidConfigurationError(message)\n }\n}\n\n/** @internal exported for tests — lets a test re-arm the once-per-process guard. */\nexport function resetRemovedEnvVarsCheck(): void {\n removedEnvVarsChecked = false\n}\n"]}
@@ -1,3 +1,2 @@
1
1
  export declare function isMacOsHighSierra(): boolean;
2
- export declare function isMacOsSierra(): Promise<boolean>;
3
2
  //# sourceMappingURL=macosVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"macosVersion.d.ts","sourceRoot":"","sources":["../../../src/util/mac/macosVersion.ts"],"names":[],"mappings":"AAwBA,wBAAgB,iBAAiB,IAAI,OAAO,CAG3C;AAED,wBAAsB,aAAa,qBAElC"}
1
+ {"version":3,"file":"macosVersion.d.ts","sourceRoot":"","sources":["../../../src/util/mac/macosVersion.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,IAAI,OAAO,CAG3C"}
@@ -1,28 +1,7 @@
1
- import { log } from "builder-util";
2
- import fsExtra from "fs-extra";
3
- import { Lazy } from "lazy-val";
4
1
  import { release as osRelease } from "os";
5
2
  import * as semver from "semver";
6
- const macOsVersion = new Lazy(async () => {
7
- const file = await fsExtra.readFile("/System/Library/CoreServices/SystemVersion.plist", "utf8");
8
- const matches = /<key>ProductVersion<\/key>[\s\S]*<string>([\d.]+)<\/string>/.exec(file);
9
- if (!matches) {
10
- throw new Error("Couldn't find the macOS version");
11
- }
12
- log.debug({ version: matches[1] }, "macOS version");
13
- return clean(matches[1]);
14
- });
15
- function clean(version) {
16
- return version.split(".").length === 2 ? `${version}.0` : version;
17
- }
18
- async function isOsVersionGreaterThanOrEqualTo(input) {
19
- return semver.gte(await macOsVersion.value, clean(input));
20
- }
21
3
  export function isMacOsHighSierra() {
22
4
  // 17.7.0 === 10.13.6
23
5
  return process.platform === "darwin" && semver.gte(osRelease(), "17.7.0");
24
6
  }
25
- export async function isMacOsSierra() {
26
- return process.platform === "darwin" && (await isOsVersionGreaterThanOrEqualTo("10.12.0"));
27
- }
28
7
  //# sourceMappingURL=macosVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"macosVersion.js","sourceRoot":"","sources":["../../../src/util/mac/macosVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,YAAY,GAAG,IAAI,IAAI,CAAS,KAAK,IAAI,EAAE;IAC/C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,kDAAkD,EAAE,MAAM,CAAC,CAAA;IAC/F,MAAM,OAAO,GAAG,6DAA6D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACpD,CAAC;IACD,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,eAAe,CAAC,CAAA;IACnD,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1B,CAAC,CAAC,CAAA;AAEF,SAAS,KAAK,CAAC,OAAe;IAC5B,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAA;AACnE,CAAC;AAED,KAAK,UAAU,+BAA+B,CAAC,KAAa;IAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,qBAAqB;IACrB,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAA;AAC3E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,MAAM,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAA;AAC5F,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport fsExtra from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { release as osRelease } from \"os\"\nimport * as semver from \"semver\"\n\nconst macOsVersion = new Lazy<string>(async () => {\n const file = await fsExtra.readFile(\"/System/Library/CoreServices/SystemVersion.plist\", \"utf8\")\n const matches = /<key>ProductVersion<\\/key>[\\s\\S]*<string>([\\d.]+)<\\/string>/.exec(file)\n if (!matches) {\n throw new Error(\"Couldn't find the macOS version\")\n }\n log.debug({ version: matches[1] }, \"macOS version\")\n return clean(matches[1])\n})\n\nfunction clean(version: string) {\n return version.split(\".\").length === 2 ? `${version}.0` : version\n}\n\nasync function isOsVersionGreaterThanOrEqualTo(input: string) {\n return semver.gte(await macOsVersion.value, clean(input))\n}\n\nexport function isMacOsHighSierra(): boolean {\n // 17.7.0 === 10.13.6\n return process.platform === \"darwin\" && semver.gte(osRelease(), \"17.7.0\")\n}\n\nexport async function isMacOsSierra() {\n return process.platform === \"darwin\" && (await isOsVersionGreaterThanOrEqualTo(\"10.12.0\"))\n}\n"]}
1
+ {"version":3,"file":"macosVersion.js","sourceRoot":"","sources":["../../../src/util/mac/macosVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,UAAU,iBAAiB;IAC/B,qBAAqB;IACrB,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAA;AAC3E,CAAC","sourcesContent":["import { release as osRelease } from \"os\"\nimport * as semver from \"semver\"\n\nexport function isMacOsHighSierra(): boolean {\n // 17.7.0 === 10.13.6\n return process.platform === \"darwin\" && semver.gte(osRelease(), \"17.7.0\")\n}\n"]}
@@ -1,2 +1,15 @@
1
- export {};
1
+ import { Metadata } from "../options/metadata.js";
2
+ export interface AppElectronUpdater {
3
+ /** the installed version, or the declared specifier when electron-updater is not installed */
4
+ readonly version: string;
5
+ /** where a bundler takes it from (null: the app's `dependencies`, which are packaged) */
6
+ readonly bundledFrom: string | null;
7
+ /** `catalog:` / `workspace:` specifier of an electron-updater that is not installed */
8
+ readonly isUnresolvable: boolean;
9
+ }
10
+ /**
11
+ * The electron-updater the app ships: from the app's `dependencies`, else bundled (by webpack, vite, ...) from its `devDependencies`,
12
+ * or from the `dependencies` or `devDependencies` of the development package.json (two package.json layout).
13
+ */
14
+ export declare function findAppElectronUpdater(metadata: Metadata, devMetadata: any | null, projectDir: string): AppElectronUpdater | null;
2
15
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.d.ts","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"packageMetadata.d.ts","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAoIjD,MAAM,WAAW,kBAAkB;IACjC,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,yFAAyF;IACzF,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,uFAAuF;IACvF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CACjC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CA+DjI"}
@@ -3,6 +3,7 @@ import fsExtra from "fs-extra";
3
3
  import { createRequire } from "node:module";
4
4
  import * as path from "path";
5
5
  import * as semver from "semver";
6
+ import { BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE, BLOCK_MAP_FORMAT_DOCS_URL, DEFAULT_ELECTRON_UPDATER_COMPATIBILITY, } from "./electronUpdaterCompatibility.js";
6
7
  import { normalizePackageData } from "./normalizePackageData.js";
7
8
  const require = createRequire(import.meta.url);
8
9
  /** @internal */
@@ -28,8 +29,11 @@ async function authors(file, data) {
28
29
  }
29
30
  data.contributors = authorData.split(/\r?\n/g).map(it => it.replace(/^\s*#.*$/, "").trim());
30
31
  }
31
- /** @internal */
32
- export function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile, projectDir) {
32
+ /**
33
+ * `electronUpdaterRequirements`: what the app's electron-updater has to read on each platform the build targets.
34
+ * @internal
35
+ */
36
+ export function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile, projectDir, electronUpdaterRequirements) {
33
37
  const errors = [];
34
38
  const reportError = (missedFieldName) => {
35
39
  errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`);
@@ -47,7 +51,8 @@ export function checkMetadata(metadata, devMetadata, appPackageFile, devAppPacka
47
51
  log.warn({ appPackageFile }, `author is missed in the package.json`);
48
52
  }
49
53
  checkNotEmpty("version", metadata.version);
50
- checkDependencies(metadata.dependencies, errors, projectDir);
54
+ checkElectronUpdater(metadata, devMetadata, errors, projectDir, electronUpdaterRequirements);
55
+ checkDependencies(metadata.dependencies, errors);
51
56
  if (metadata !== devMetadata) {
52
57
  if (metadata.build != null) {
53
58
  errors.push(`'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`);
@@ -82,60 +87,119 @@ function versionSatisfies(version, range, loose) {
82
87
  }
83
88
  return semver.satisfies(coerced, range, loose);
84
89
  }
85
- function checkDependencies(dependencies, errors, projectDir) {
86
- if (dependencies == null) {
87
- return;
90
+ /** The lowest version `versionOrRange` (an installed version, or a declared specifier such as `^7.0.0-alpha.5`) allows. */
91
+ function lowestVersion(versionOrRange) {
92
+ const version = semver.parse(versionOrRange);
93
+ if (version != null) {
94
+ return version;
88
95
  }
89
- let updaterVersion = dependencies["electron-updater"];
90
- if (updaterVersion != null) {
91
- let skipValidation = false;
92
- // prefer the version of the actually-installed electron-updater over the declared specifier,
93
- // so that specifiers like pnpm `catalog:`/`workspace:` are validated against the real version
94
- let resolvedPackageJson = null;
95
- try {
96
- resolvedPackageJson = require.resolve("electron-updater/package.json", { paths: [projectDir] });
97
- }
98
- catch (_ignored) {
99
- // electron-updater is not installed (MODULE_NOT_FOUND), or the installed version's `exports` map
100
- // does not expose "./package.json" (ERR_PACKAGE_PATH_NOT_EXPORTED) — fall back to the declared specifier below
101
- }
102
- if (resolvedPackageJson != null) {
103
- updaterVersion = fsExtra.readJsonSync(resolvedPackageJson).version;
96
+ try {
97
+ return semver.validRange(versionOrRange) == null ? null : semver.minVersion(versionOrRange);
98
+ }
99
+ catch (_ignored) {
100
+ return null;
101
+ }
102
+ }
103
+ /**
104
+ * The electron-updater the app ships: from the app's `dependencies`, else bundled (by webpack, vite, ...) from its `devDependencies`,
105
+ * or from the `dependencies` or `devDependencies` of the development package.json (two package.json layout).
106
+ */
107
+ export function findAppElectronUpdater(metadata, devMetadata, projectDir) {
108
+ let declared = null;
109
+ const dev = devMetadata === metadata ? null : devMetadata;
110
+ const candidates = [
111
+ [metadata.dependencies, null],
112
+ [metadata.devDependencies, "devDependencies"],
113
+ [dev?.dependencies, "dependencies of the development package.json"],
114
+ [dev?.devDependencies, "devDependencies"],
115
+ ];
116
+ for (const [dependencies, bundledFrom] of candidates) {
117
+ const specifier = dependencies == null ? undefined : dependencies["electron-updater"];
118
+ if (typeof specifier === "string") {
119
+ declared = { specifier, bundledFrom };
120
+ break;
104
121
  }
105
- else {
106
- // Pick the version out of yarn berry patch syntax
107
- // "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch"
108
- if (updaterVersion.startsWith("patch:")) {
109
- const npmMarker = "@npm%3A";
110
- const markerIndex = updaterVersion.indexOf(npmMarker);
111
- if (markerIndex !== -1) {
112
- const versionStart = markerIndex + npmMarker.length;
113
- const hashIndex = updaterVersion.indexOf("#", versionStart);
114
- if (hashIndex > versionStart) {
115
- updaterVersion = updaterVersion.slice(versionStart, hashIndex);
116
- }
117
- }
118
- }
119
- // for testing auto-update using workspace electron-updater
120
- const prefixes = ["link:", "file:"];
121
- for (const prefix of prefixes) {
122
- if (updaterVersion.startsWith(prefix)) {
123
- const normalized = path.normalize(updaterVersion.substring(prefix.length));
124
- const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized);
125
- const json = fsExtra.readJsonSync(path.join(packageJsonPath, "package.json"));
126
- updaterVersion = json.version;
127
- break;
128
- }
122
+ }
123
+ if (declared == null) {
124
+ return null;
125
+ }
126
+ const { bundledFrom } = declared;
127
+ let updaterVersion = declared.specifier;
128
+ // prefer the version of the actually-installed electron-updater over the declared specifier,
129
+ // so that specifiers like pnpm `catalog:`/`workspace:` are validated against the real version
130
+ let resolvedPackageJson = null;
131
+ try {
132
+ resolvedPackageJson = require.resolve("electron-updater/package.json", { paths: [projectDir] });
133
+ }
134
+ catch (_ignored) {
135
+ // electron-updater is not installed (MODULE_NOT_FOUND), or the installed version's `exports` map
136
+ // does not expose "./package.json" (ERR_PACKAGE_PATH_NOT_EXPORTED) — fall back to the declared specifier below
137
+ }
138
+ if (resolvedPackageJson != null) {
139
+ return { version: fsExtra.readJsonSync(resolvedPackageJson).version, bundledFrom, isUnresolvable: false };
140
+ }
141
+ // Pick the version out of yarn berry patch syntax
142
+ // "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch"
143
+ if (updaterVersion.startsWith("patch:")) {
144
+ const npmMarker = "@npm%3A";
145
+ const markerIndex = updaterVersion.indexOf(npmMarker);
146
+ if (markerIndex !== -1) {
147
+ const versionStart = markerIndex + npmMarker.length;
148
+ const hashIndex = updaterVersion.indexOf("#", versionStart);
149
+ if (hashIndex > versionStart) {
150
+ updaterVersion = updaterVersion.slice(versionStart, hashIndex);
129
151
  }
130
- // pnpm `catalog:` and `workspace:` specifiers cannot be resolved to a concrete version from the package.json alone, so skip validation
131
- const unresolvableProtocols = ["catalog:", "workspace:"];
132
- skipValidation = unresolvableProtocols.some(protocol => updaterVersion.startsWith(protocol));
133
152
  }
134
- const requiredElectronUpdaterVersion = "4.0.0";
135
- if (!skipValidation && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {
136
- errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}". Received "${updaterVersion}"`);
153
+ }
154
+ // for testing auto-update using workspace electron-updater
155
+ for (const prefix of ["link:", "file:"]) {
156
+ if (updaterVersion.startsWith(prefix)) {
157
+ const normalized = path.normalize(updaterVersion.substring(prefix.length));
158
+ const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized);
159
+ const json = fsExtra.readJsonSync(path.join(packageJsonPath, "package.json"));
160
+ return { version: json.version, bundledFrom, isUnresolvable: false };
137
161
  }
138
162
  }
163
+ // pnpm `catalog:` and `workspace:` specifiers cannot be resolved to a concrete version from the package.json alone, so skip validation
164
+ const isUnresolvable = ["catalog:", "workspace:"].some(protocol => updaterVersion.startsWith(protocol));
165
+ return { version: updaterVersion, bundledFrom, isUnresolvable };
166
+ }
167
+ function checkElectronUpdater(metadata, devMetadata, errors, projectDir, requirements) {
168
+ const updater = findAppElectronUpdater(metadata, devMetadata, projectDir);
169
+ if (updater == null || updater.isUnresolvable) {
170
+ return;
171
+ }
172
+ const { version, bundledFrom } = updater;
173
+ const source = bundledFrom == null ? "" : ` (bundled from ${bundledFrom})`;
174
+ const requiredElectronUpdaterVersion = "4.0.0";
175
+ if (!versionSatisfies(version, `>=${requiredElectronUpdaterVersion}`)) {
176
+ errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}". Received "${version}"${source}`);
177
+ return;
178
+ }
179
+ // the build writes update files (the block map format among them) for each platform's range: an app outside it cannot read them.
180
+ // Coerced, so that ">=7" admits the 7.0.0 prereleases; the binary block map floor below tells those apart.
181
+ const unsatisfied = requirements.filter(it => !versionSatisfies(version, it.range));
182
+ if (unsatisfied.length > 0) {
183
+ const ranges = [...new Set(unsatisfied.map(it => `"${it.range}"`))].join(", ");
184
+ const platforms = unsatisfied.map(it => it.platform).join(", ");
185
+ errors.push(`electron-updater ${version}${source} does not satisfy electronUpdaterCompatibility ${ranges} of ${platforms} (the default is "${DEFAULT_ELECTRON_UPDATER_COMPATIBILITY}"). ` +
186
+ `Upgrade electron-updater to 7, or set electronUpdaterCompatibility to a range that includes "<7" (e.g. ">=6"), which switches the build to the JSON block map. ` +
187
+ `See ${BLOCK_MAP_FORMAT_DOCS_URL}`);
188
+ return;
189
+ }
190
+ const lowest = lowestVersion(version);
191
+ const binary = requirements.filter(it => it.binaryBlockMap);
192
+ if (lowest == null || binary.length === 0 || semver.gte(lowest, BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE)) {
193
+ return;
194
+ }
195
+ errors.push(`electron-updater ${version}${source} cannot read the binary block map the build writes for ${binary.map(it => it.platform).join(", ")}: ` +
196
+ `electron-updater reads it from ${BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE}. Upgrade electron-updater, or set "blockmap" to "v2" to write the JSON block map. ` +
197
+ `See ${BLOCK_MAP_FORMAT_DOCS_URL}`);
198
+ }
199
+ function checkDependencies(dependencies, errors) {
200
+ if (dependencies == null) {
201
+ return;
202
+ }
139
203
  const swVersion = dependencies["electron-builder-squirrel-windows"];
140
204
  if (swVersion != null && !versionSatisfies(swVersion, ">=20.32.0")) {
141
205
  errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to "^20.32.0"`);
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAE9E,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACzB,kEAAkE;IAClE,OAAO,IAAI,CAAC,OAAO,CAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAA;IAClB,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACb,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAS;IAC5C,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAM;IACR,CAAC;IAED,IAAI,UAAU,CAAA;IACd,IAAI,CAAC;QACH,UAAU,GAAG,M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GAAiG,8BAA8B,gBAAgB,cAAc,GAAG,CAC5N,CAAA;QACH,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,mCAAmC,CAAC,CAAA;IACnE,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,gKAAgK,CAAC,CAAA;IAC/K,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport fsExtra from \"fs-extra\"\nimport { createRequire } from \"node:module\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata.js\"\nimport { normalizePackageData } from \"./normalizePackageData.js\"\n\nconst require = createRequire(import.meta.url)\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await fsExtra.readJson(file)\n await authors(file, data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n normalizePackageData(data)\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await fsExtra.readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n } catch (_ignored) {\n return\n }\n\n data.contributors = authorData.split(/\\r?\\n/g).map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/** @internal */\nexport function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string, projectDir: string): void {\n const errors: Array<string> = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | Nullish) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({ appPackageFile }, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({ appPackageFile }, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n checkDependencies(metadata.dependencies, errors, projectDir)\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(\n `'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`\n )\n }\n }\n\n // Root-level `directories` was read by v26 and is ignored by v27. It lives outside the validated\n // Configuration object, so nothing else catches it: the build silently writes to the default `dist`\n // instead of the configured output directory, and a release pipeline copies from an empty path.\n const rootDirectories = (devMetadata ?? metadata)?.directories\n if (rootDirectories != null) {\n errors.push(\n `'directories' at the root of the package.json (${devAppPackageFile}) is no longer read by electron-builder v27 — move it under the 'build' key:\\n` +\n ` { \"build\": { \"directories\": ${JSON.stringify(rootDirectories)} } }\\n` +\n \" Left where it is, it is ignored and your build output goes to the default 'dist' directory.\\n\" +\n \" Run `electron-builder migrate-schema` to move it automatically.\\n\" +\n \" https://www.electron.build/docs/migration/v27-config-changes#root-level-directories-in-packagejson\"\n )\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && (\"electron-rebuild\" in devDependencies || \"@electron/rebuild\" in devDependencies)) {\n log.info(\n '@electron/rebuild already used by electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`'\n )\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\nfunction checkDependencies(dependencies: Record<string, string> | Nullish, errors: Array<string>, projectDir: string) {\n if (dependencies == null) {\n return\n }\n\n let updaterVersion = dependencies[\"electron-updater\"]\n if (updaterVersion != null) {\n let skipValidation = false\n\n // prefer the version of the actually-installed electron-updater over the declared specifier,\n // so that specifiers like pnpm `catalog:`/`workspace:` are validated against the real version\n let resolvedPackageJson: string | null = null\n try {\n resolvedPackageJson = require.resolve(\"electron-updater/package.json\", { paths: [projectDir] })\n } catch (_ignored) {\n // electron-updater is not installed (MODULE_NOT_FOUND), or the installed version's `exports` map\n // does not expose \"./package.json\" (ERR_PACKAGE_PATH_NOT_EXPORTED) — fall back to the declared specifier below\n }\n\n if (resolvedPackageJson != null) {\n updaterVersion = fsExtra.readJsonSync(resolvedPackageJson).version\n } else {\n // Pick the version out of yarn berry patch syntax\n // \"patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch\"\n if (updaterVersion.startsWith(\"patch:\")) {\n const npmMarker = \"@npm%3A\"\n const markerIndex = updaterVersion.indexOf(npmMarker)\n if (markerIndex !== -1) {\n const versionStart = markerIndex + npmMarker.length\n const hashIndex = updaterVersion.indexOf(\"#\", versionStart)\n if (hashIndex > versionStart) {\n updaterVersion = updaterVersion.slice(versionStart, hashIndex)\n }\n }\n }\n\n // for testing auto-update using workspace electron-updater\n const prefixes = [\"link:\", \"file:\"]\n for (const prefix of prefixes) {\n if (updaterVersion.startsWith(prefix)) {\n const normalized = path.normalize(updaterVersion.substring(prefix.length))\n const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized)\n const json = fsExtra.readJsonSync(path.join(packageJsonPath, \"package.json\"))\n updaterVersion = json.version\n break\n }\n }\n\n // pnpm `catalog:` and `workspace:` specifiers cannot be resolved to a concrete version from the package.json alone, so skip validation\n const unresolvableProtocols = [\"catalog:\", \"workspace:\"]\n skipValidation = unresolvableProtocols.some(protocol => updaterVersion.startsWith(protocol))\n }\n\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (!skipValidation && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(\n `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\". Received \"${updaterVersion}\"`\n )\n }\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n}\n"]}
1
+ {"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAE9E,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EACL,oCAAoC,EACpC,yBAAyB,EACzB,sCAAsC,GAEvC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACzB,kEAAkE;IAClE,OAAO,IAAI,CAAC,OAAO,CAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAA;IAClB,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACb,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAS;IAC5C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C,CAAA;QAC/D,MAAM,CAAC,IAAI,CACT,oBAAoB,OAAO,GAAG,MAAM,kDAAkD,MAAM,OAAO,SAAS,qBAAqB,sCAAsC,MAAM;YAC3K,iKAAiK;YACjK,OAAO,yBAAyB,EAAE,CACrC,CAAA;QACD,OAAM;IACR,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IACrC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,CAAA;IAC3D,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,oCAAoC,CAAC,EAAE,CAAC;QACtG,OAAM;IACR,CAAC;IACD,MAAM,CAAC,IAAI,CACT,oBAAoB,OAAO,GAAG,MAAM,0DAA0D,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;QACxI,kCAAkC,oCAAoC,qFAAqF;QAC3J,OAAO,yBAAyB,EAAE,CACrC,CAAA;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,YAA8C,EAAE,MAAqB;IAC9F,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;QACzB,OAAM;IACR,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,mCAAmC,CAAC,CAAA;IACnE,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,gKAAgK,CAAC,CAAA;IAC/K,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport fsExtra from \"fs-extra\"\nimport { createRequire } from \"node:module\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata.js\"\nimport {\n BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE,\n BLOCK_MAP_FORMAT_DOCS_URL,\n DEFAULT_ELECTRON_UPDATER_COMPATIBILITY,\n ElectronUpdaterRequirement,\n} from \"./electronUpdaterCompatibility.js\"\nimport { normalizePackageData } from \"./normalizePackageData.js\"\n\nconst require = createRequire(import.meta.url)\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await fsExtra.readJson(file)\n await authors(file, data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n normalizePackageData(data)\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await fsExtra.readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n } catch (_ignored) {\n return\n }\n\n data.contributors = authorData.split(/\\r?\\n/g).map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/**\n * `electronUpdaterRequirements`: what the app's electron-updater has to read on each platform the build targets.\n * @internal\n */\nexport function checkMetadata(\n metadata: Metadata,\n devMetadata: any | null,\n appPackageFile: string,\n devAppPackageFile: string,\n projectDir: string,\n electronUpdaterRequirements: Array<ElectronUpdaterRequirement>\n): void {\n const errors: Array<string> = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | Nullish) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({ appPackageFile }, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({ appPackageFile }, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n checkElectronUpdater(metadata, devMetadata, errors, projectDir, electronUpdaterRequirements)\n checkDependencies(metadata.dependencies, errors)\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(\n `'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`\n )\n }\n }\n\n // Root-level `directories` was read by v26 and is ignored by v27. It lives outside the validated\n // Configuration object, so nothing else catches it: the build silently writes to the default `dist`\n // instead of the configured output directory, and a release pipeline copies from an empty path.\n const rootDirectories = (devMetadata ?? metadata)?.directories\n if (rootDirectories != null) {\n errors.push(\n `'directories' at the root of the package.json (${devAppPackageFile}) is no longer read by electron-builder v27 — move it under the 'build' key:\\n` +\n ` { \"build\": { \"directories\": ${JSON.stringify(rootDirectories)} } }\\n` +\n \" Left where it is, it is ignored and your build output goes to the default 'dist' directory.\\n\" +\n \" Run `electron-builder migrate-schema` to move it automatically.\\n\" +\n \" https://www.electron.build/docs/migration/v27-config-changes#root-level-directories-in-packagejson\"\n )\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && (\"electron-rebuild\" in devDependencies || \"@electron/rebuild\" in devDependencies)) {\n log.info(\n '@electron/rebuild already used by electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`'\n )\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\n/** The lowest version `versionOrRange` (an installed version, or a declared specifier such as `^7.0.0-alpha.5`) allows. */\nfunction lowestVersion(versionOrRange: string): semver.SemVer | null {\n const version = semver.parse(versionOrRange)\n if (version != null) {\n return version\n }\n try {\n return semver.validRange(versionOrRange) == null ? null : semver.minVersion(versionOrRange)\n } catch (_ignored) {\n return null\n }\n}\n\nexport interface AppElectronUpdater {\n /** the installed version, or the declared specifier when electron-updater is not installed */\n readonly version: string\n /** where a bundler takes it from (null: the app's `dependencies`, which are packaged) */\n readonly bundledFrom: string | null\n /** `catalog:` / `workspace:` specifier of an electron-updater that is not installed */\n readonly isUnresolvable: boolean\n}\n\n/**\n * The electron-updater the app ships: from the app's `dependencies`, else bundled (by webpack, vite, ...) from its `devDependencies`,\n * or from the `dependencies` or `devDependencies` of the development package.json (two package.json layout).\n */\nexport function findAppElectronUpdater(metadata: Metadata, devMetadata: any | null, projectDir: string): AppElectronUpdater | null {\n let declared: { specifier: string; bundledFrom: string | null } | null = null\n const dev = devMetadata === metadata ? null : devMetadata\n const candidates: Array<[unknown, string | null]> = [\n [metadata.dependencies, null],\n [(metadata as any).devDependencies, \"devDependencies\"],\n [dev?.dependencies, \"dependencies of the development package.json\"],\n [dev?.devDependencies, \"devDependencies\"],\n ]\n for (const [dependencies, bundledFrom] of candidates) {\n const specifier = dependencies == null ? undefined : (dependencies as Record<string, unknown>)[\"electron-updater\"]\n if (typeof specifier === \"string\") {\n declared = { specifier, bundledFrom }\n break\n }\n }\n if (declared == null) {\n return null\n }\n const { bundledFrom } = declared\n let updaterVersion = declared.specifier\n\n // prefer the version of the actually-installed electron-updater over the declared specifier,\n // so that specifiers like pnpm `catalog:`/`workspace:` are validated against the real version\n let resolvedPackageJson: string | null = null\n try {\n resolvedPackageJson = require.resolve(\"electron-updater/package.json\", { paths: [projectDir] })\n } catch (_ignored) {\n // electron-updater is not installed (MODULE_NOT_FOUND), or the installed version's `exports` map\n // does not expose \"./package.json\" (ERR_PACKAGE_PATH_NOT_EXPORTED) — fall back to the declared specifier below\n }\n\n if (resolvedPackageJson != null) {\n return { version: fsExtra.readJsonSync(resolvedPackageJson).version, bundledFrom, isUnresolvable: false }\n }\n\n // Pick the version out of yarn berry patch syntax\n // \"patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch\"\n if (updaterVersion.startsWith(\"patch:\")) {\n const npmMarker = \"@npm%3A\"\n const markerIndex = updaterVersion.indexOf(npmMarker)\n if (markerIndex !== -1) {\n const versionStart = markerIndex + npmMarker.length\n const hashIndex = updaterVersion.indexOf(\"#\", versionStart)\n if (hashIndex > versionStart) {\n updaterVersion = updaterVersion.slice(versionStart, hashIndex)\n }\n }\n }\n\n // for testing auto-update using workspace electron-updater\n for (const prefix of [\"link:\", \"file:\"]) {\n if (updaterVersion.startsWith(prefix)) {\n const normalized = path.normalize(updaterVersion.substring(prefix.length))\n const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized)\n const json = fsExtra.readJsonSync(path.join(packageJsonPath, \"package.json\"))\n return { version: json.version, bundledFrom, isUnresolvable: false }\n }\n }\n\n // pnpm `catalog:` and `workspace:` specifiers cannot be resolved to a concrete version from the package.json alone, so skip validation\n const isUnresolvable = [\"catalog:\", \"workspace:\"].some(protocol => updaterVersion.startsWith(protocol))\n return { version: updaterVersion, bundledFrom, isUnresolvable }\n}\n\nfunction checkElectronUpdater(metadata: Metadata, devMetadata: any | null, errors: Array<string>, projectDir: string, requirements: Array<ElectronUpdaterRequirement>) {\n const updater = findAppElectronUpdater(metadata, devMetadata, projectDir)\n if (updater == null || updater.isUnresolvable) {\n return\n }\n const { version, bundledFrom } = updater\n const source = bundledFrom == null ? \"\" : ` (bundled from ${bundledFrom})`\n\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (!versionSatisfies(version, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(\n `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\". Received \"${version}\"${source}`\n )\n return\n }\n\n // the build writes update files (the block map format among them) for each platform's range: an app outside it cannot read them.\n // Coerced, so that \">=7\" admits the 7.0.0 prereleases; the binary block map floor below tells those apart.\n const unsatisfied = requirements.filter(it => !versionSatisfies(version, it.range))\n if (unsatisfied.length > 0) {\n const ranges = [...new Set(unsatisfied.map(it => `\"${it.range}\"`))].join(\", \")\n const platforms = unsatisfied.map(it => it.platform).join(\", \")\n errors.push(\n `electron-updater ${version}${source} does not satisfy electronUpdaterCompatibility ${ranges} of ${platforms} (the default is \"${DEFAULT_ELECTRON_UPDATER_COMPATIBILITY}\"). ` +\n `Upgrade electron-updater to 7, or set electronUpdaterCompatibility to a range that includes \"<7\" (e.g. \">=6\"), which switches the build to the JSON block map. ` +\n `See ${BLOCK_MAP_FORMAT_DOCS_URL}`\n )\n return\n }\n\n const lowest = lowestVersion(version)\n const binary = requirements.filter(it => it.binaryBlockMap)\n if (lowest == null || binary.length === 0 || semver.gte(lowest, BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE)) {\n return\n }\n errors.push(\n `electron-updater ${version}${source} cannot read the binary block map the build writes for ${binary.map(it => it.platform).join(\", \")}: ` +\n `electron-updater reads it from ${BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE}. Upgrade electron-updater, or set \"blockmap\" to \"v2\" to write the JSON block map. ` +\n `See ${BLOCK_MAP_FORMAT_DOCS_URL}`\n )\n}\n\nfunction checkDependencies(dependencies: Record<string, string> | Nullish, errors: Array<string>) {\n if (dependencies == null) {\n return\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n}\n"]}
@@ -14,7 +14,7 @@ export const REMOVED_ENV_VARS = [
14
14
  // Toolset path/dir overrides — the `resolveEnvToolsetPath` mechanism was removed; supply a ToolsetCustom object instead.
15
15
  { name: "APPIMAGE_TOOLS_PATH", remediation: `set \`toolsets.appimage: { url: "file:///path/to/dir" }\` instead.` },
16
16
  { name: "MKSQUASHFS_PATH", remediation: `the mksquashfs binary now ships with the appimage toolset — set \`toolsets.appimage: { url: "file:///path/to/dir" }\` to override it.` },
17
- { name: "LINUX_TOOLS_MAC_PATH", remediation: `set \`toolsets.linuxToolsMac: { url: "file:///path/to/dir" }\` instead.` },
17
+ { name: "LINUX_TOOLS_MAC_PATH", remediation: `set \`toolsets.archive: { url: "file:///path/to/dir" }\` instead.` },
18
18
  { name: "CUSTOM_FPM_PATH", remediation: `set \`toolsets.fpm: { url: "file:///path/to/dir" }\` instead.` },
19
19
  { name: "ELECTRON_BUILDER_NSIS_DIR", remediation: `set \`toolsets.nsis: { url: "file:///path/to/dir" }\` instead.` },
20
20
  { name: "ELECTRON_BUILDER_NSIS_RESOURCES_DIR", remediation: `set \`toolsets.nsis: { url: "file:///path/to/dir" }\` instead.` },