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.
- package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/hsmSignManager.js +3 -2
- package/dist/codeSign/win/hsmSignManager.js.map +1 -1
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -1
- package/dist/codeSign/win/pkcs11SignManager.js +2 -1
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +15 -5
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/configuration.d.ts +78 -20
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/indexInternal.d.ts +5 -3
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +4 -3
- package/dist/indexInternal.js.map +1 -1
- package/dist/options/FileAssociation.d.ts +1 -1
- package/dist/options/FileAssociation.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +4 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +13 -3
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +9 -6
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +2 -2
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +22 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +115 -66
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +10 -8
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +5 -0
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +102 -24
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/manifestUploadCheck.d.ts +12 -0
- package/dist/publish/manifestUploadCheck.d.ts.map +1 -1
- package/dist/publish/manifestUploadCheck.js +84 -12
- package/dist/publish/manifestUploadCheck.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +12 -7
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/publish/updateManifestVerifier.d.ts +54 -0
- package/dist/publish/updateManifestVerifier.d.ts.map +1 -1
- package/dist/publish/updateManifestVerifier.js +121 -1
- package/dist/publish/updateManifestVerifier.js.map +1 -1
- package/dist/publish/updaterSettingsCheck.d.ts +8 -0
- package/dist/publish/updaterSettingsCheck.d.ts.map +1 -0
- package/dist/publish/updaterSettingsCheck.js +136 -0
- package/dist/publish/updaterSettingsCheck.js.map +1 -0
- package/dist/targets/ArchiveTarget.js +1 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +4 -3
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +30 -0
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +99 -31
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/blockmap/blockmapV3.d.ts +36 -0
- package/dist/targets/blockmap/blockmapV3.d.ts.map +1 -0
- package/dist/targets/blockmap/blockmapV3.js +41 -0
- package/dist/targets/blockmap/blockmapV3.js.map +1 -0
- package/dist/targets/blockmap/verbatimRange.d.ts +6 -0
- package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -1
- package/dist/targets/blockmap/verbatimRange.js +11 -0
- package/dist/targets/blockmap/verbatimRange.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +92 -4
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +266 -10
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +1 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +23 -31
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +6 -14
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts +4 -3
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +10 -6
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +8 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +42 -9
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +13 -9
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/targetFactory.d.ts +22 -3
- package/dist/targets/targetFactory.d.ts.map +1 -1
- package/dist/targets/targetFactory.js +70 -29
- package/dist/targets/targetFactory.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts +7 -0
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +140 -21
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +1 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +3 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +33 -12
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisLicense.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisLicense.js +8 -5
- package/dist/targets/win/nsis/nsisLicense.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +31 -3
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts +6 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +16 -5
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +11 -29
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/toolsets/7zip.d.ts +10 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +12 -1
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/appimage.d.ts +3 -0
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +4 -1
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/archive.d.ts +13 -0
- package/dist/toolsets/archive.d.ts.map +1 -0
- package/dist/toolsets/archive.js +55 -0
- package/dist/toolsets/archive.js.map +1 -0
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +19 -2
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/fpm.d.ts +23 -0
- package/dist/toolsets/fpm.d.ts.map +1 -1
- package/dist/toolsets/fpm.js +52 -19
- package/dist/toolsets/fpm.js.map +1 -1
- package/dist/toolsets/nsis.d.ts +23 -4
- package/dist/toolsets/nsis.d.ts.map +1 -1
- package/dist/toolsets/nsis.js +49 -14
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/winCodeSign.d.ts +20 -1
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +32 -5
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wix.d.ts +44 -0
- package/dist/toolsets/wix.d.ts.map +1 -0
- package/dist/toolsets/wix.js +91 -0
- package/dist/toolsets/wix.js.map +1 -0
- package/dist/util/buildOutputVerifier.d.ts +2 -1
- package/dist/util/buildOutputVerifier.d.ts.map +1 -1
- package/dist/util/buildOutputVerifier.js +41 -63
- package/dist/util/buildOutputVerifier.js.map +1 -1
- package/dist/util/bundledTool.d.ts +8 -0
- package/dist/util/bundledTool.d.ts.map +1 -1
- package/dist/util/bundledTool.js +34 -0
- package/dist/util/bundledTool.js.map +1 -1
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +107 -10
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/electronUpdaterCompatibility.d.ts +64 -0
- package/dist/util/electronUpdaterCompatibility.d.ts.map +1 -0
- package/dist/util/electronUpdaterCompatibility.js +82 -0
- package/dist/util/electronUpdaterCompatibility.js.map +1 -0
- package/dist/util/flags.d.ts +5 -0
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +8 -2
- package/dist/util/flags.js.map +1 -1
- package/dist/util/mac/macosVersion.d.ts +0 -1
- package/dist/util/mac/macosVersion.d.ts.map +1 -1
- package/dist/util/mac/macosVersion.js +0 -21
- package/dist/util/mac/macosVersion.js.map +1 -1
- package/dist/util/packageMetadata.d.ts +14 -1
- package/dist/util/packageMetadata.d.ts.map +1 -1
- package/dist/util/packageMetadata.js +115 -51
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/removedEnvVars.js +1 -1
- package/dist/util/removedEnvVars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +182 -49
- package/templates/msi/template.xml +5 -5
- package/templates/msiWrapped/template.xml +1 -1
- package/templates/nsis/assistedInstaller.nsh +37 -1
- package/templates/nsis/common.nsh +142 -1
- package/templates/nsis/include/installUtil.nsh +12 -0
- package/templates/nsis/include/installer.nsh +12 -0
- package/templates/nsis/installSection.nsh +3 -0
- package/templates/nsis/installer.nsi +25 -13
- package/templates/nsis/multiUser.nsh +50 -10
- package/templates/nsis/portable.nsi +1 -1
- package/templates/nsis/uninstaller.nsh +6 -0
- package/dist/toolsets/linuxToolsMac.d.ts +0 -8
- package/dist/toolsets/linuxToolsMac.d.ts.map +0 -1
- package/dist/toolsets/linuxToolsMac.js +0 -44
- package/dist/toolsets/linuxToolsMac.js.map +0 -1
package/dist/util/electronGet.js
CHANGED
|
@@ -4,7 +4,7 @@ import { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7za
|
|
|
4
4
|
import { HttpError, MemoLazy, retry, sleep } from "builder-util-runtime";
|
|
5
5
|
import * as crypto from "crypto";
|
|
6
6
|
import { MultiProgress } from "electron-publish";
|
|
7
|
-
import { createReadStream
|
|
7
|
+
import { createReadStream } from "fs";
|
|
8
8
|
import * as fs from "fs/promises";
|
|
9
9
|
import * as os from "os";
|
|
10
10
|
import * as path from "path";
|
|
@@ -88,6 +88,73 @@ export function isSafeExtractPath(destPath, dir) {
|
|
|
88
88
|
}
|
|
89
89
|
return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir;
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Creates the missing directories of `target` one level at a time under the real path of the extraction dir,
|
|
93
|
+
* resolving symlinks after every step, so a symlink extracted earlier cannot redirect a write outside it.
|
|
94
|
+
* Returns the real path of `target`.
|
|
95
|
+
*/
|
|
96
|
+
async function mkdirInsideRealDir(target, dir, realDir, entryPath) {
|
|
97
|
+
let current = realDir;
|
|
98
|
+
for (const part of path.relative(dir, target).split(path.sep)) {
|
|
99
|
+
if (part === "") {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const next = path.join(current, part);
|
|
103
|
+
let existed = false;
|
|
104
|
+
try {
|
|
105
|
+
await fs.mkdir(next);
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
if (e.code !== "EEXIST") {
|
|
109
|
+
throw e;
|
|
110
|
+
}
|
|
111
|
+
existed = true;
|
|
112
|
+
}
|
|
113
|
+
current = await fs.realpath(next);
|
|
114
|
+
if (!isSafeExtractPath(current, realDir)) {
|
|
115
|
+
throw new Error(`Symlinked path escapes extraction dir: ${entryPath}`);
|
|
116
|
+
}
|
|
117
|
+
// an earlier file entry (or a symlink to one) at this path cannot hold a directory
|
|
118
|
+
if (existed && !(await fs.stat(current)).isDirectory()) {
|
|
119
|
+
throw new Error(`Zip entry needs a directory where a file already exists: ${entryPath}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return current;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Walks a relative symlink `target` from the real directory holding the link the way the OS would: existing components
|
|
126
|
+
* are followed by real path, missing ones are joined lexically (a later `..` steps back out of them, and existing components
|
|
127
|
+
* after that are followed by real path again). Returns false when any step leaves `realDir`. With `finished`, the tree is
|
|
128
|
+
* complete and a dangling symlink used as an intermediate component is refused too (its meaning would change once its target
|
|
129
|
+
* appears); during extraction it is not, because its target may simply come later in the archive.
|
|
130
|
+
*/
|
|
131
|
+
async function isLinkTargetInside(realParent, target, realDir, finished) {
|
|
132
|
+
const parts = target.split(process.platform === "win32" ? /[\\/]/ : "/").filter(part => part !== "" && part !== ".");
|
|
133
|
+
let current = realParent;
|
|
134
|
+
for (let i = 0; i < parts.length; i++) {
|
|
135
|
+
if (parts[i] === "..") {
|
|
136
|
+
current = path.dirname(current);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
current = path.join(current, parts[i]);
|
|
140
|
+
try {
|
|
141
|
+
current = await fs.realpath(current);
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
if (e.code !== "ENOENT" && e.code !== "ENOTDIR") {
|
|
145
|
+
throw e;
|
|
146
|
+
}
|
|
147
|
+
if (finished && i < parts.length - 1 && (await fs.lstat(current).catch(() => null))?.isSymbolicLink()) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (!isSafeExtractPath(current, realDir)) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
91
158
|
async function extractZipStreaming(file, dir) {
|
|
92
159
|
// Pass 1: read central directory once to collect Unix modes (one seek to EOF)
|
|
93
160
|
const zipDir = await unzipper.Open.file(file);
|
|
@@ -99,6 +166,9 @@ async function extractZipStreaming(file, dir) {
|
|
|
99
166
|
}
|
|
100
167
|
}
|
|
101
168
|
const isSymlink = (mode) => (mode & 0o170000) === 0o120000;
|
|
169
|
+
// Lexical checks alone miss chained symlinks, so every write is also confined by real path at write time.
|
|
170
|
+
const realDir = await fs.realpath(dir);
|
|
171
|
+
const symlinks = [];
|
|
102
172
|
// Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.
|
|
103
173
|
// Destroy the read stream in a finally block so the file handle is always released,
|
|
104
174
|
// including when the loop exits early due to a thrown error.
|
|
@@ -113,25 +183,45 @@ async function extractZipStreaming(file, dir) {
|
|
|
113
183
|
const mode = entryModes.get(entry.path) ?? 0;
|
|
114
184
|
if (mode > 0 && isSymlink(mode)) {
|
|
115
185
|
const target = (await entry.buffer()).toString();
|
|
116
|
-
|
|
186
|
+
// on Windows a drive-relative target ("C:x") is not absolute but resolves against that drive's current directory,
|
|
187
|
+
// and a ":" inside a component names an alternate data stream, so any ":" is refused there
|
|
188
|
+
if (path.isAbsolute(target) || (process.platform === "win32" && target.includes(":"))) {
|
|
117
189
|
throw new Error(`Absolute symlink target blocked: ${target}`);
|
|
118
190
|
}
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
191
|
+
const realParent = await mkdirInsideRealDir(path.dirname(destPath), dir, realDir, entry.path);
|
|
192
|
+
if (!(await isLinkTargetInside(realParent, target, realDir, false))) {
|
|
121
193
|
throw new Error(`Symlink target escapes extraction dir: ${target}`);
|
|
122
194
|
}
|
|
123
|
-
await fs.
|
|
124
|
-
|
|
195
|
+
await fs.symlink(target, path.join(realParent, path.basename(destPath))).catch((e) => {
|
|
196
|
+
// fs.symlink never replaces an existing path, so a symlink entry at a path an earlier entry holds is refused by name
|
|
197
|
+
if (e.code === "EEXIST") {
|
|
198
|
+
throw new Error(`Zip symlink entry would replace an existing file, directory or symlink: ${entry.path}`);
|
|
199
|
+
}
|
|
200
|
+
throw e;
|
|
201
|
+
});
|
|
202
|
+
symlinks.push({ realParent, target });
|
|
125
203
|
}
|
|
126
204
|
else if (entry.type === "Directory") {
|
|
127
|
-
await
|
|
205
|
+
await mkdirInsideRealDir(destPath, dir, realDir, entry.path);
|
|
128
206
|
entry.autodrain();
|
|
129
207
|
}
|
|
130
208
|
else {
|
|
131
|
-
|
|
132
|
-
|
|
209
|
+
const realDest = path.join(await mkdirInsideRealDir(path.dirname(destPath), dir, realDir, entry.path), path.basename(destPath));
|
|
210
|
+
// "wx" refuses an existing path, so a symlink already sitting at the destination is never followed
|
|
211
|
+
const handle = await fs.open(realDest, "wx").catch(async (e) => {
|
|
212
|
+
if (e.code !== "EEXIST") {
|
|
213
|
+
throw e;
|
|
214
|
+
}
|
|
215
|
+
// a duplicate entry replaces the earlier regular file (last one wins, as before); anything else is refused
|
|
216
|
+
if (!(await fs.lstat(realDest)).isFile()) {
|
|
217
|
+
throw new Error(`Zip entry would replace an existing symlink or directory: ${entry.path}`);
|
|
218
|
+
}
|
|
219
|
+
await fs.unlink(realDest);
|
|
220
|
+
return fs.open(realDest, "wx");
|
|
221
|
+
});
|
|
222
|
+
await pipeline(entry, handle.createWriteStream());
|
|
133
223
|
if (mode > 0) {
|
|
134
|
-
await fs.chmod(
|
|
224
|
+
await fs.chmod(realDest, mode & 0o7777);
|
|
135
225
|
}
|
|
136
226
|
}
|
|
137
227
|
}
|
|
@@ -139,6 +229,13 @@ async function extractZipStreaming(file, dir) {
|
|
|
139
229
|
finally {
|
|
140
230
|
readStream.destroy();
|
|
141
231
|
}
|
|
232
|
+
// A later entry can turn a component of an earlier symlink's target into a symlink, so re-check every link against
|
|
233
|
+
// the finished tree: the build writes into this directory afterwards and must not be redirected outside it.
|
|
234
|
+
for (const { realParent, target } of symlinks) {
|
|
235
|
+
if (!(await isLinkTargetInside(realParent, target, realDir, true))) {
|
|
236
|
+
throw new Error(`Symlink target escapes extraction dir: ${target}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
142
239
|
}
|
|
143
240
|
export async function extractArchive(archive, dir) {
|
|
144
241
|
const file = sanitizeDirPath(archive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,EAEL,yBAAyB,GAM1B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5I,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,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Ac,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,KAAK,MAAM,CAAA;IACnF,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClD,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,aAAa,qBAAqB,CAAA;AACjE,CAAC","sourcesContent":["import * as get from \"@electron/get\"\nimport {\n ElectronArtifactDetails,\n ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n FetchDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch, ensureDir, moveDirAtomic } from \"builder-util\"\nimport { HttpError, MemoLazy, retry, sleep } from \"builder-util-runtime\"\nimport * as crypto from \"crypto\"\nimport type { ProgressBar } from \"electron-publish\"\nimport { MultiProgress } from \"electron-publish\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { getPath7za } from \"../toolsets/7zip.js\"\nimport { checksumMismatchMessage, ExpectedChecksum, parseChecksum, verifyFileChecksum } from \"./checksum.js\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState.js\"\nimport { BUILD_CHANGES_URL } from \"./config/legacyOptions.js\"\n\nexport interface ElectronGetOptions extends Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\"\n> {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n options?: ElectronGetOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\n// MemoLazy (not Lazy): keyed on ELECTRON_BUILDER_CACHE so the resolved cache dir is recomputed if the\n// override env var changes, while staying memoized when it doesn't (the production case). The creator\n// also ensures the resolved dir exists — that side effect lives here, at the point of use, so\n// getCacheDirectoryInternal stays a pure path resolver.\nexport const cacheDirectoryOverrideAllowed = new MemoLazy<string | undefined, string>(\n () => process.env.ELECTRON_BUILDER_CACHE?.trim(),\n async () => {\n const dir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n await ensureDir(dir)\n return dir\n }\n)\n// Exposed for testing; not intended for public use. Pure path resolution (no I/O) — use the memoized\n// const's above when you need the directory to exist on disk. Kept async for a stable Promise-returning\n// contract across all call sites.\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function getCacheDirectoryInternal(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): Promise<string> {\n const { isAvoidSystemOnWindows = true, allowEnvVarOverride } = options\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (allowEnvVarOverride && env && path.parse(env).root) {\n return sanitizeDirPath(env)\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n // https://github.com/electron-userland/electron-builder/issues/1164\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\n/**\n * Returns true when `destPath` is safely contained within `dir` (direct child or deeper).\n * On Windows the filesystem is case-insensitive so the comparison is normalised to lowercase.\n * @internal exported for unit testing\n */\nexport function isSafeExtractPath(destPath: string, dir: string): boolean {\n const normalizedDest = path.resolve(destPath)\n const normalizedDir = path.resolve(dir)\n if (process.platform === \"win32\") {\n const d = normalizedDest.toLowerCase()\n const b = normalizedDir.toLowerCase()\n return d.startsWith(b + path.sep) || d === b\n }\n return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.\n // Destroy the read stream in a finally block so the file handle is always released,\n // including when the loop exits early due to a thrown error.\n const readStream = createReadStream(file)\n try {\n const entries = readStream.pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!isSafeExtractPath(destPath, dir)) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!isSafeExtractPath(resolvedTarget, dir)) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n } finally {\n readStream.destroy()\n }\n}\n\nexport async function extractArchive(archive: string, dir: string) {\n const file = sanitizeDirPath(archive)\n\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n // 100 retries (not 15) so concurrent callers wait out a slow first extraction instead of failing\n // with ELOCKED; the update heartbeat keeps an in-progress holder's lock fresh against `stale`.\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000, // Increased from 60s to allow long-running extractions\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).\n // A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await sleep(300 * (i + 1))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\") || file.endsWith(\".tar.7z\")) {\n // Compressed tarballs node-tar cannot decompress itself (xz, 7z): use 7za to strip the outer\n // compression layer into a .tar, then extract that tar.\n // Note: the .tar.7z check MUST stay ahead of the plain .7z branch below, otherwise only the outer\n // 7z layer is removed and the inner tar is left behind as-is (see https://github.com/electron-userland/electron-builder/issues/10002).\n const cmd7za = await getPath7za()\n const decompressOutDir = `${tmpDir}.decompress`\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n await fs.mkdir(decompressOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(decompressOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(decompressOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(decompressOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n // Check if extraction actually failed or just had benign warnings\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file: log.filePath(file), tmpDir: log.filePath(tmpDir), error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n // If files were extracted despite the error, log and continue\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n // Verify extraction produced files\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await moveDirAtomic(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nlet proxyInitialized = false\nfunction initializeProxyOnce(): void {\n if (!proxyInitialized) {\n reinitializeProxy()\n proxyInitialized = true\n }\n}\n\n/**\n * Forces undici's global proxy dispatcher to re-read the current HTTP(S)_PROXY / NO_PROXY env vars,\n * bypassing the once-guard in initializeProxyOnce(). Exported for integration testing only.\n */\nexport function reinitializeProxy(): void {\n get.initializeProxy()\n}\n\n/**\n * Error codes considered transient for artifact downloads. Plain node socket errors carry the code\n * directly on `error.code`; undici (the fetch implementation used by @electron/get v5) wraps them in\n * a `TypeError: fetch failed` whose code lives on `error.cause.code` — including undici's own\n * `UND_ERR_*` codes for connection resets and connect timeouts.\n */\nconst TRANSIENT_DOWNLOAD_ERROR_CODES = new Set([\n \"ENOTFOUND\",\n \"ETIMEDOUT\",\n \"ECONNRESET\",\n \"ECONNREFUSED\",\n \"EAI_AGAIN\",\n \"EPIPE\",\n \"ENOENT\",\n \"UND_ERR_SOCKET\",\n \"UND_ERR_CONNECT_TIMEOUT\",\n])\n\n/**\n * Decides whether a failed @electron/get download should be retried. Handles all three error shapes\n * seen in practice (exported for tests):\n * - builder-util-runtime's `HttpError` — retry on 5xx.\n * - @electron/get v5's `HTTPError` (`FetchDownloader`) — a plain `Error` subclass with the fetch\n * `Response` on `.response` and NO `.code`; retry on 5xx and 429. Matched by class and by\n * `name === \"HTTPError\"` as a fallback in case multiple @electron/get copies are loaded.\n * - transient network errors — code on `error.code`, or on `error.cause.code` for undici's\n * `TypeError: fetch failed` wrapper.\n */\nexport function shouldRetryDownloadError(e: any): boolean {\n if (e == null) {\n return false\n }\n if (e instanceof HttpError) {\n return e.isServerError()\n }\n if (e instanceof get.HTTPError || e.name === \"HTTPError\") {\n const status = e.response?.status\n return typeof status === \"number\" && (status >= 500 || status === 429)\n }\n const code = typeof e.code === \"string\" ? e.code : typeof e.cause?.code === \"string\" ? e.cause.code : undefined\n return code != null && TRANSIENT_DOWNLOAD_ERROR_CODES.has(code)\n}\n\nconst DOWNLOAD_ATTEMPT_TIMEOUT_MS = 10 * 60 * 1000\n\n/** undici gives up on a silent connection after its own headersTimeout/bodyTimeout (300s by default). */\nconst STALLED_DOWNLOAD_ERROR_CODES = new Set([\"UND_ERR_HEADERS_TIMEOUT\", \"UND_ERR_BODY_TIMEOUT\"])\n\nexport interface RetryDownloadOptions {\n readonly label?: string\n readonly callerSignal?: AbortSignal | null\n readonly attemptTimeoutMs?: number\n}\n\n/**\n * Runs a download with the transient-error retries. Each attempt gets its own `AbortSignal.timeout()` capping\n * its total duration: a shared one stays aborted once it fires, so any later attempt would fail immediately.\n * An attempt that hits that cap, or that undici drops as silent, is retried once. A caller-supplied signal is\n * passed through as is, and its abort is final.\n * Exported for tests.\n */\nexport function retryDownload<T>(download: (signal: AbortSignal) => Promise<T>, options: RetryDownloadOptions = {}): Promise<T> {\n const { label, callerSignal, attemptTimeoutMs = DOWNLOAD_ATTEMPT_TIMEOUT_MS } = options\n let timedOut = false\n return retry(() => download(callerSignal ?? AbortSignal.timeout(attemptTimeoutMs)), {\n retries: 3,\n interval: 2000,\n backoff: 2000,\n shouldRetry: e => {\n // our own timeout abort is a DOMException with a numeric `code`, which shouldRetryDownloadError never matches\n const reason = callerSignal == null && e?.name === \"TimeoutError\" ? \"TimeoutError\" : STALLED_DOWNLOAD_ERROR_CODES.has(e?.cause?.code) ? e.cause.code : null\n if (reason == null) {\n return shouldRetryDownloadError(e)\n }\n if (timedOut) {\n return false\n }\n timedOut = true\n log.warn({ label, reason }, \"download timed out, retrying\")\n return true\n },\n })\n}\n\nasync function downloadArtifactToFile(config: ElectronArtifactDetails, label: string): Promise<string> {\n // Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's\n // non-atomic putFileInCache (remove + move) from racing with a concurrent reader.\n const key = {\n p: (config as ElectronPlatformArtifactDetails).platform,\n a: (config as ElectronPlatformArtifactDetails).arch,\n v: config.version,\n n: config.artifactName,\n g: config.isGeneric,\n }\n\n const artifactLockKey = crypto.createHash(\"sha256\").update(JSON.stringify(key)).digest(\"hex\").slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n // This lock is taken even for cache hits (the cache-hit check lives inside @electron/get), so under\n // heavy concurrency many builds serialize here. 30 retries (~137s of backoff) is too few — waiters\n // were exhausting it and failing with ELOCKED while the holder fetched a large artifact. 100 retries\n // matches the other toolset locks; stale (10min) + proper-lockfile's update heartbeat keep a live\n // downloader's lock fresh so the longer wait never falsely steals an in-progress download.\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 100, minTimeout: 500, maxTimeout: 5000 },\n stale: 600_000,\n realpath: false,\n })\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n // @electron/get v5 downloads via fetch, whose proxy support comes from undici's global dispatcher.\n // initializeProxy() wires that up from HTTP(S)_PROXY/NO_PROXY env vars (replaces the got proxy agent).\n initializeProxyOnce()\n\n const downloadOptions: FetchDownloaderOptions = {\n ...config.downloadOptions,\n getProgressCallback: info => {\n // @electron/get passes downloadOptions (including this callback) to its internal\n // SHASUMS256.txt validation download. That file is tiny (<1 MB) and fires at 100%\n // immediately, producing a spurious bar even when the artifact itself is cached.\n // Skip progress display for any download whose total size is known and small.\n if (info.total && info.total < 1_000_000) {\n return Promise.resolve()\n }\n if (!state.bar && process.stdout.isTTY) {\n log.info({ label }, \"downloading\")\n state.bar = new MultiProgress().createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n }\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (state.bar) {\n state.bar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n const callerSignal = config.downloadOptions?.signal\n // every call gets a fresh timeout signal, to prevent an indefinite hang on stalled connections\n const withSignal = (signal: AbortSignal = callerSignal ?? AbortSignal.timeout(DOWNLOAD_ATTEMPT_TIMEOUT_MS)) => ({ ...config, downloadOptions: { ...downloadOptions, signal } })\n try {\n let filePath: string\n try {\n filePath = await retryDownload(signal => get.downloadArtifact(withSignal(signal)), { label, callerSignal })\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(withSignal())\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...withSignal(), cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n if (!state.bar && lastLoggedMilestone === -1) {\n log.info({ label }, \"using cached artifact\")\n }\n return filePath\n } finally {\n state.bar?.update(100)\n state.bar?.terminate()\n await releaseArtifactLock().catch(err => log.warn({ err }, \"failed to release artifact download lock\"))\n }\n}\n\n/**\n * Checks electron-builder's own archive cache for a previously downloaded archive.\n * Validates the checksum (SHA-256 hex or base64 SHA-512) when one is known. Returns the cached path on hit,\n * null on miss or checksum mismatch (mismatch also deletes the stale file).\n *\n * Air-gapped seeding contract: placing the archive at\n * `<cacheDir>/<releaseName>/<archive>` (e.g. `$ELECTRON_BUILDER_CACHE/appimage@1.0.3/appimage-tools-runtime-20251108.tar.gz`)\n * is sufficient for a fully offline toolset resolution — the checksum here is computed locally\n * against the value hardcoded in the toolset module, and extraction happens locally too. No\n * `.state` file needs to be seeded. See https://www.electron.build/tutorials/offline-air-gapped-builds.\n */\nasync function resolveFromArchiveCache(archiveCachePath: string, label: string, expected: ExpectedChecksum | undefined): Promise<string | null> {\n if (!(await exists(archiveCachePath))) {\n return null\n }\n if (expected != null && !(await verifyFileChecksum(archiveCachePath, expected)).matches) {\n log.warn({ file: label, archiveCachePath }, \"cached archive checksum mismatch — removing and re-downloading\")\n await fs.rm(archiveCachePath).catch(() => {})\n return null\n }\n log.debug({ file: label, archiveCachePath }, \"using cached archive — skipping download\")\n return archiveCachePath\n}\n\n/**\n * Copies a freshly downloaded archive into electron-builder's own archive cache so that\n * future builds (including offline environments) can skip the network request entirely.\n */\nasync function persistToArchiveCache(sourcePath: string, archiveCachePath: string): Promise<void> {\n try {\n await fs.mkdir(path.dirname(archiveCachePath), { recursive: true })\n await fs.copyFile(sourcePath, archiveCachePath)\n } catch (err) {\n log.warn({ err, archiveCachePath }, \"failed to persist archive to cache — will re-download next time\")\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(\n config: ElectronArtifactDetails,\n extractDir: string,\n label: string,\n archiveCachePath?: string,\n expectedChecksum?: ExpectedChecksum\n): Promise<string> {\n // Create only the PARENT dir (e.g. <cache>/fpm@2.2.1), never extractDir itself, before locking.\n // The parent is stable — cleanup only ever removes extractDir and its .state/.tmp/.lock siblings —\n // so extractDir's whole lifecycle (mkdir, rm, re-mkdir) stays inside the lock. ensureDir absorbs\n // the concurrent-recursive-mkdir ENOENT/EEXIST race while peers populate the cold cache tree.\n await ensureDir(path.dirname(extractDir))\n\n // Pre-lock fast path: read-only short-circuit for a definitively complete and valid cache.\n // Safe unlocked — the cache-state helpers return null/false for a missing or half-written dir,\n // so a racing read only ever falls through to take the lock. Do NOT mutate the dir here.\n const stateData = await readCacheStateFile(extractDir)\n if (stateData?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateData.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - cache valid\")\n return extractDir\n }\n }\n\n // Be patient: when many targets/builds contend on the same toolset cache concurrently, all but the\n // first wait here while the winner downloads+extracts (a large bundle can take >1min). 15 retries\n // (~67s) is too few and waiters fail with ELOCKED before the winner finishes; 100 matches the\n // patience of withToolsetLock. proper-lockfile's update heartbeat keeps a live holder's lock fresh,\n // so increasing waiter retries never falsely steals an in-progress extraction.\n const release = await lockfile.lock(extractDir, {\n // realpath:false so proper-lockfile creates <extractDir>.lock in the (already-created) parent\n // WITHOUT calling fs.realpath(extractDir) first — which would throw ENOENT now that extractDir\n // is created lazily inside the lock. This filesystem lock serializes peers both across worker\n // processes AND within a single process (a second lock() for the same path retries until the\n // first releases), so no in-process promise cache is needed — and one wouldn't help across the\n // separate test worker processes anyway.\n realpath: false,\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n const stateDataAfterLock = await readCacheStateFile(extractDir)\n if (stateDataAfterLock?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateDataAfterLock.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n log.warn({ extractDir }, \"Cache marked complete but files invalid, clearing\")\n } else if (stateDataAfterLock?.state === CacheState.corrupted) {\n log.warn({ extractDir }, \"Corrupted cache detected, cleaning up and re-extracting\")\n }\n\n // Cleanup inside the lock — skip lock files since we currently hold them\n await cleanupCacheDirectory(extractDir, { skipLockFiles: true })\n await ensureDir(extractDir)\n\n // Check electron-builder's own archive cache before touching @electron/get.\n // The cache lives alongside the extract dir: <cacheDir>/<releaseName>/<filename>.\n // This lets repeated builds (or offline environments) skip the download entirely once\n // the archive has been fetched at least once.\n if (archiveCachePath) {\n downloadedFile = await resolveFromArchiveCache(archiveCachePath, label, expectedChecksum)\n }\n\n if (!downloadedFile) {\n log.debug({ file: label }, \"downloading\")\n downloadedFile = await downloadArtifactToFile(config, label)\n if (!downloadedFile) {\n throw new Error(`Failed to download artifact: ${label}`)\n }\n // A SHA-256 hex checksum is verified by @electron/get during the download. A base64 SHA-512 was passed with\n // unsafelyDisableChecksums (sumchecker only understands SHA-256 hex), so verify it here, before the archive is\n // persisted to the archive cache or extracted.\n if (expectedChecksum != null && expectedChecksum.algorithm !== \"sha256\") {\n const { matches, actual } = await verifyFileChecksum(downloadedFile, expectedChecksum)\n if (!matches) {\n await fs.rm(downloadedFile, { force: true }).catch(() => {})\n throw new Error(`${checksumMismatchMessage(label, expectedChecksum, actual)} The corrupted download has been removed.`)\n }\n log.debug({ file: label, algorithm: expectedChecksum.algorithm }, \"checksum verified\")\n }\n // Persist the downloaded archive so future builds (and offline environments) can\n // skip the network request entirely.\n if (archiveCachePath) {\n await persistToArchiveCache(downloadedFile, archiveCachePath)\n }\n }\n\n await writeCacheState(extractDir, CacheState.downloaded)\n\n // Mark extracting so stale-lock detection can recover a crashed mid-extraction process\n await writeCacheState(extractDir, CacheState.extracting)\n\n // Extract while holding the lock to prevent concurrent interference\n await extractArchive(downloadedFile, extractDir)\n\n // Compute metadata with a full recursive walk now that tmpDir has been renamed to extractDir\n const { fileCount, extractedSize } = await computeCacheMetadata(extractDir)\n\n // Write complete state with metadata BEFORE releasing the lock; throwOnError=true so a\n // failed write (disk full, permissions) propagates instead of silently producing a no-op cache\n await writeCacheState(extractDir, CacheState.complete, { fileCount, extractedSize }, true)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Copies a remote artifact to a specific output path on disk.\n * Unlike downloadBuilderToolset, this does not extract archives — it copies the raw file.\n * Used for certificate imports where the caller needs the file at a known path.\n */\nexport async function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const filenameWithExt = path.basename(new URL(url).pathname)\n if (checksum == null) {\n log.warn({ url }, \"downloading without an integrity checksum — the download is not verified against a known-good hash\")\n }\n const downloadedFile = await downloadArtifactToFile(\n {\n version: \"9.9.9\",\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksum != null ? { checksums: { [filenameWithExt]: checksum } } : { unsafelyDisableChecksums: true }),\n mirrorOptions: { resolveAssetURL: async () => Promise.resolve(url) },\n isGeneric: true,\n },\n filenameWithExt\n )\n await fs.copyFile(downloadedFile, output)\n}\n\nfunction validateBinaryCustomDir(envVarName: string, value: string): string {\n if (value.includes(\"://\") || value.includes(\"..\") || value.startsWith(\"/\")) {\n throw new Error(\n `${envVarName} must be a safe relative path component (e.g. \"v1.0.0-custom\"). ` + `Values containing \"://\", \"..\", or a leading \"/\" are not allowed. Got: \"${value}\"`\n )\n }\n return value\n}\n\nconst CUSTOM_DIR_ENV_VARS = [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n \"npm_config_electron_builder_binaries_custom_dir\",\n \"npm_package_config_electron_builder_binaries_custom_dir\",\n \"ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n] as const\n\n/**\n * Resolves the final download URL for a builder binary, honouring:\n * ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory\n * ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path\n * overrideUrl (caller-supplied) – the complete file URL, used as-is when no env var is set\n *\n * Exported for unit testing; not part of the public API.\n * @internal\n */\nexport function resolveBuilderBinaryUrl(releaseName: string, filenameWithExt: string, baseUrl: string, overrideUrl?: string): string {\n const envOverrideUrl = parseValidEnvVarUrl(\"ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL\")\n if (envOverrideUrl != null) {\n return `${envOverrideUrl}/${filenameWithExt}`\n }\n if (overrideUrl != null) {\n // The caller-supplied override (ToolsetCustom.url) points directly at the file — appending\n // filenameWithExt would double the last path segment (e.g. …/bundle.7z/bundle.7z, issue #10084).\n return overrideUrl\n }\n const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null)\n if (customDirEntry != null) {\n return `${baseUrl}${validateBinaryCustomDir(customDirEntry.name, customDirEntry.value!)}/${filenameWithExt}`\n }\n return `${baseUrl}${releaseName}/${filenameWithExt}`\n}\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\n/**\n * Every `toolsets.*` property now defaults to \"latest\", which resolves to a newer bundle than v26\n * pinned (NSIS 3.0.4.1 -> 3.12, winCodeSign 2.6.0 -> 1.3.0, Wine 4.0.1 -> 11.0, AppImage FUSE2 ->\n * static FUSE3). Nothing recorded which version was used: `downloadBuilderToolset` logged only at\n * debug level, and on a warm cache it printed nothing at all — so a regression introduced by a new\n * bundle had no trace in the build log tying it to the toolset.\n */\nconst TOOLSET_DEFAULTS_DOCS = `${BUILD_CHANGES_URL}#toolset-defaults-resolve-to-latest-newest-bundle`\n\nfunction announceToolsetVersion(releaseName: string): void {\n // once per toolset per process, so a multi-target build logs each one once\n log.once(`toolset:${releaseName}`).info({ toolset: releaseName, docs: TOOLSET_DEFAULTS_DOCS }, \"using toolset\")\n}\n\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n announceToolsetVersion(releaseName)\n\n if (/[/\\\\]|^\\.\\./.test(filenameWithExt) || filenameWithExt.includes(\"..\")) {\n throw new Error(`downloadBuilderToolset: unsafe filenameWithExt \"${filenameWithExt}\" — must be a plain filename with no path separators or traversal sequences`)\n }\n\n const { expectedChecksum, electronGetChecksums } = resolveToolsetChecksums(releaseName, filenameWithExt, checksums)\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, overrideUrl)\n const suffix = hashUrlSafe(fullUrl, 5)\n // tar.7z is listed before 7z so the full extension is stripped. Deliberate side effect: this changes the\n // extract-dir name for .tar.7z toolsets (e.g. the snap template) from \"<name>.tar-<hash>\" to \"<name>-<hash>\",\n // which busts caches poisoned by the broken .tar.7z extraction in 26.15.0-26.15.6 (issue #10002).\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|tar\\.xz|txz|tar\\.7z|zip|7z)$/, \"\")}-${suffix}`\n // releaseName is library input; enforce cache-dir containment (rejects traversal, clears taint into shell extraction)\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const extractDir = sanitizeDirPath(path.join(cacheDir, releaseName, folderName), cacheDir)\n\n // Use resolveAssetURL so @electron/get's ELECTRON_MIRROR env var check cannot override\n // the builder-binaries URL we've already resolved (see getArtifactRemoteURL in @electron/get).\n const mirrorOptions: MirrorOptions = {\n resolveAssetURL: async () => Promise.resolve(fullUrl),\n }\n\n // Predictable archive cache: <cacheDir>/<releaseName>/<filename>, next to the extract dir.\n // downloadAndExtract checks here before touching @electron/get and persists the archive here\n // after every successful download, so subsequent builds never need a network round-trip.\n const archiveCachePath = sanitizeDirPath(path.join(cacheDir, releaseName, filenameWithExt), cacheDir)\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(electronGetChecksums != null ? { checksums: electronGetChecksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt, archiveCachePath, expectedChecksum)\n}\n\n/**\n * Classifies every entry of a toolset checksum table up front, so a malformed value fails before anything is downloaded\n * instead of as a sumchecker parse error or a generic mismatch afterwards. Returns the checksum for `filenameWithExt` and,\n * when every entry is SHA-256 hex, the (lowercased) table to hand to `@electron/get`; base64 SHA-512 checksums are verified\n * by electron-builder after the download instead (#10040).\n */\nfunction resolveToolsetChecksums(\n releaseName: string,\n filenameWithExt: string,\n checksums: Record<string, string> | undefined\n): { expectedChecksum?: ExpectedChecksum; electronGetChecksums?: Record<string, string> } {\n if (checksums == null) {\n return {}\n }\n const parsed = Object.entries(checksums).map(([file, value]) => [file, parseChecksum(value, `The checksum for \"${file}\" (${releaseName})`)] as const)\n const algorithms = new Set(parsed.map(([, checksum]) => checksum.algorithm))\n if (algorithms.size > 1) {\n throw new Error(`Checksums for ${releaseName} mix formats: use a single format for all entries, either SHA-256 hex or base64 SHA-512`)\n }\n const expectedChecksum = parsed.find(([file]) => file === filenameWithExt)?.[1]\n if (algorithms.has(\"sha256\")) {\n return { expectedChecksum, electronGetChecksums: Object.fromEntries(parsed.map(([file, checksum]) => [file, checksum.value])) }\n }\n if (expectedChecksum == null) {\n // @electron/get would reject a missing entry itself, but its validation is disabled for SHA-512 checksums: never let a\n // table without an entry for this file turn into an unverified download.\n throw new Error(`No checksum for \"${filenameWithExt}\" in the checksums for ${releaseName}`)\n }\n return { expectedChecksum }\n}\n\n/**\n * Mirrors @electron/get's default cache root (`env-paths(\"electron\", { suffix: \"\" }).cache`).\n * @electron/get does not export it and its package `exports` map blocks deep imports, so the\n * (deliberately tiny) platform switch is replicated here. Must stay in sync with the\n * `cacheRoot` default documented in @electron/get's `ElectronDownloadRequestOptions`.\n * @internal exported for unit testing\n */\nexport function defaultElectronGetCacheRoot(): string {\n const name = \"electron\"\n const homeDir = os.homedir()\n switch (os.platform()) {\n case \"darwin\":\n return path.join(homeDir, \"Library\", \"Caches\", name)\n case \"win32\":\n return path.join(process.env.LOCALAPPDATA || path.join(homeDir, \"AppData\", \"Local\"), name, \"Cache\")\n default:\n return path.join(process.env.XDG_CACHE_HOME || path.join(homeDir, \".cache\"), name)\n }\n}\n\n/**\n * Parses the upstream `SHASUMS256.txt` format into the `Record<filename, sha256-hex>` shape that\n * @electron/get accepts as inline `checksums`. Each line is `<sha256-hex> *<filename>` (binary\n * mode) or `<sha256-hex> <filename>` (text mode); malformed lines are ignored.\n * @internal exported for unit testing\n */\nexport function parseChecksumFile(content: string): Record<string, string> {\n const checksums: Record<string, string> = {}\n for (const rawLine of content.split(\"\\n\")) {\n const match = /^([a-fA-F0-9]{64})\\s+\\*?(.+)$/.exec(rawLine.trim())\n if (match != null) {\n checksums[match[2]] = match[1].toLowerCase()\n }\n }\n return checksums\n}\n\n/**\n * Looks for a locally seeded SHASUMS256 file at the root of the @electron/get cache and returns\n * its contents as inline `checksums`, or null when nothing usable is seeded.\n *\n * Why: without inline `checksums`, @electron/get re-downloads `SHASUMS256.txt` with a hardcoded\n * `cacheMode: Bypass` on EVERY build — even when the artifact itself is a cache hit — so a fully\n * seeded cache still requires network access and air-gapped builds fail (#10039). Cache-seeding\n * tools (e.g. flatpak-node-generator) already place `SHASUMS256.txt-<version>` flat at the cache\n * root; feeding it back as inline `checksums` keeps checksum validation enabled while making it\n * fully offline. A plain `SHASUMS256.txt` at the cache root is accepted as a manual-seeding\n * fallback. A candidate file is only used when it actually contains an entry for the requested\n * artifact, so a stale file for another version can never break an online build.\n * See https://www.electron.build/tutorials/offline-air-gapped-builds for the seeding contract.\n * @internal exported for unit testing\n */\nexport async function resolveSeededChecksums(cacheRoot: string, version: string, artifactFileName: string): Promise<Record<string, string> | null> {\n const candidates = [path.join(cacheRoot, `SHASUMS256.txt-${version}`), path.join(cacheRoot, \"SHASUMS256.txt\")]\n for (const candidate of candidates) {\n if (!(await exists(candidate))) {\n continue\n }\n let content: string\n try {\n content = await fs.readFile(candidate, \"utf-8\")\n } catch (err: any) {\n log.warn({ file: log.filePath(candidate), err: err.message }, \"failed to read seeded SHASUMS file — ignoring it\")\n continue\n }\n const checksums = parseChecksumFile(content)\n if (checksums[artifactFileName] == null) {\n log.warn({ file: log.filePath(candidate), artifactFileName }, \"seeded SHASUMS file has no entry for the requested artifact — ignoring it\")\n continue\n }\n log.debug({ file: log.filePath(candidate), artifactFileName }, \"using locally seeded SHASUMS256 checksums — checksum validation can run offline\")\n return checksums\n }\n return null\n}\n\n/**\n * Assembles the `@electron/get` artifact config (`ElectronPlatformArtifactDetails`) from\n * `ArtifactDownloadOptions`: spreads the caller's options and pins `cacheRoot`/`platform`/`arch`/\n * `version`/`artifactName` and the resolved cache mode, warning when checksum verification is\n * disabled. When the caller provides no `checksums` (user-provided `electronGet.checksums` always\n * wins) and verification is not disabled, a locally seeded `SHASUMS256.txt-<version>` at the cache\n * root is picked up as inline `checksums` so validation works offline (see resolveSeededChecksums).\n * Callers pass the result to `downloadArtifactToFile` / `downloadAndExtract`.\n * @internal exported for unit testing\n */\nexport async function buildElectronArtifactConfig(artifactOptions: ArtifactDownloadOptions): Promise<ElectronPlatformArtifactDetails> {\n const { options, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = artifactOptions\n\n if (options?.unsafelyDisableChecksums) {\n log.warn(\n { artifactName },\n \"electronGet.unsafelyDisableChecksums is enabled — downloaded artifacts will NOT be verified; a compromised mirror can serve malicious binaries undetected\"\n )\n }\n\n const artifactConfig: ElectronPlatformArtifactDetails = { ...options, cacheRoot, platform, arch, version, artifactName, cacheMode: resolveCacheMode() }\n if (artifactConfig.checksums == null && !artifactConfig.unsafelyDisableChecksums) {\n // Matches @electron/get's getArtifactFileName for non-generic artifacts; `artifactSuffix` and\n // `customFilename` cannot diverge here — both are excluded from ElectronGetOptions.\n const artifactFileName = `${artifactName}-v${version}-${platform}-${arch}.zip`\n const seededChecksums = await resolveSeededChecksums(cacheRoot ?? defaultElectronGetCacheRoot(), version, artifactFileName)\n if (seededChecksums != null) {\n artifactConfig.checksums = seededChecksums\n }\n }\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport async function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = await buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\n/**\n * Downloads an electron platform artifact (e.g. ffmpeg) via `@electron/get` and extracts it into a\n * content-addressed cache directory (keyed on a hash of the resolved artifact config), returning the\n * extraction path.\n */\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = await buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(await cacheDirectoryOverrideAllowed.value, `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n const allowHttp = process.env[\"ELECTRON_BUILDER_DANGEROUSLY_ALLOW_HTTP\"] === \"true\"\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar, allowHttp)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
|
1
|
+
{"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,EAEL,yBAAyB,GAM1B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5I,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,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,MAAM,EAAE,CAAA;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,6BAA6B,CAAC,KAAK,EAAE,GAAG,YAAY,KAAK,OAAO,EAAE,EAAE,UAAU,CAAC,CAAA;IAElH,OAAO,kBAAkB,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,KAAK,MAAM,CAAA;IACnF,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClD,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,aAAa,qBAAqB,CAAA;AACjE,CAAC","sourcesContent":["import * as get from \"@electron/get\"\nimport {\n ElectronArtifactDetails,\n ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n FetchDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch, ensureDir, moveDirAtomic } from \"builder-util\"\nimport { HttpError, MemoLazy, retry, sleep } from \"builder-util-runtime\"\nimport * as crypto from \"crypto\"\nimport type { ProgressBar } from \"electron-publish\"\nimport { MultiProgress } from \"electron-publish\"\nimport { createReadStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { getPath7za } from \"../toolsets/7zip.js\"\nimport { checksumMismatchMessage, ExpectedChecksum, parseChecksum, verifyFileChecksum } from \"./checksum.js\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState.js\"\nimport { BUILD_CHANGES_URL } from \"./config/legacyOptions.js\"\n\nexport interface ElectronGetOptions extends Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\"\n> {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n options?: ElectronGetOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\n// MemoLazy (not Lazy): keyed on ELECTRON_BUILDER_CACHE so the resolved cache dir is recomputed if the\n// override env var changes, while staying memoized when it doesn't (the production case). The creator\n// also ensures the resolved dir exists — that side effect lives here, at the point of use, so\n// getCacheDirectoryInternal stays a pure path resolver.\nexport const cacheDirectoryOverrideAllowed = new MemoLazy<string | undefined, string>(\n () => process.env.ELECTRON_BUILDER_CACHE?.trim(),\n async () => {\n const dir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n await ensureDir(dir)\n return dir\n }\n)\n// Exposed for testing; not intended for public use. Pure path resolution (no I/O) — use the memoized\n// const's above when you need the directory to exist on disk. Kept async for a stable Promise-returning\n// contract across all call sites.\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function getCacheDirectoryInternal(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): Promise<string> {\n const { isAvoidSystemOnWindows = true, allowEnvVarOverride } = options\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (allowEnvVarOverride && env && path.parse(env).root) {\n return sanitizeDirPath(env)\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n // https://github.com/electron-userland/electron-builder/issues/1164\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\n/**\n * Returns true when `destPath` is safely contained within `dir` (direct child or deeper).\n * On Windows the filesystem is case-insensitive so the comparison is normalised to lowercase.\n * @internal exported for unit testing\n */\nexport function isSafeExtractPath(destPath: string, dir: string): boolean {\n const normalizedDest = path.resolve(destPath)\n const normalizedDir = path.resolve(dir)\n if (process.platform === \"win32\") {\n const d = normalizedDest.toLowerCase()\n const b = normalizedDir.toLowerCase()\n return d.startsWith(b + path.sep) || d === b\n }\n return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir\n}\n\n/**\n * Creates the missing directories of `target` one level at a time under the real path of the extraction dir,\n * resolving symlinks after every step, so a symlink extracted earlier cannot redirect a write outside it.\n * Returns the real path of `target`.\n */\nasync function mkdirInsideRealDir(target: string, dir: string, realDir: string, entryPath: string): Promise<string> {\n let current = realDir\n for (const part of path.relative(dir, target).split(path.sep)) {\n if (part === \"\") {\n continue\n }\n const next = path.join(current, part)\n let existed = false\n try {\n await fs.mkdir(next)\n } catch (e: any) {\n if (e.code !== \"EEXIST\") {\n throw e\n }\n existed = true\n }\n current = await fs.realpath(next)\n if (!isSafeExtractPath(current, realDir)) {\n throw new Error(`Symlinked path escapes extraction dir: ${entryPath}`)\n }\n // an earlier file entry (or a symlink to one) at this path cannot hold a directory\n if (existed && !(await fs.stat(current)).isDirectory()) {\n throw new Error(`Zip entry needs a directory where a file already exists: ${entryPath}`)\n }\n }\n return current\n}\n\n/**\n * Walks a relative symlink `target` from the real directory holding the link the way the OS would: existing components\n * are followed by real path, missing ones are joined lexically (a later `..` steps back out of them, and existing components\n * after that are followed by real path again). Returns false when any step leaves `realDir`. With `finished`, the tree is\n * complete and a dangling symlink used as an intermediate component is refused too (its meaning would change once its target\n * appears); during extraction it is not, because its target may simply come later in the archive.\n */\nasync function isLinkTargetInside(realParent: string, target: string, realDir: string, finished: boolean): Promise<boolean> {\n const parts = target.split(process.platform === \"win32\" ? /[\\\\/]/ : \"/\").filter(part => part !== \"\" && part !== \".\")\n let current = realParent\n for (let i = 0; i < parts.length; i++) {\n if (parts[i] === \"..\") {\n current = path.dirname(current)\n } else {\n current = path.join(current, parts[i])\n try {\n current = await fs.realpath(current)\n } catch (e: any) {\n if (e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") {\n throw e\n }\n if (finished && i < parts.length - 1 && (await fs.lstat(current).catch(() => null))?.isSymbolicLink()) {\n return false\n }\n }\n }\n if (!isSafeExtractPath(current, realDir)) {\n return false\n }\n }\n return true\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Lexical checks alone miss chained symlinks, so every write is also confined by real path at write time.\n const realDir = await fs.realpath(dir)\n const symlinks: { realParent: string; target: string }[] = []\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.\n // Destroy the read stream in a finally block so the file handle is always released,\n // including when the loop exits early due to a thrown error.\n const readStream = createReadStream(file)\n try {\n const entries = readStream.pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!isSafeExtractPath(destPath, dir)) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n // on Windows a drive-relative target (\"C:x\") is not absolute but resolves against that drive's current directory,\n // and a \":\" inside a component names an alternate data stream, so any \":\" is refused there\n if (path.isAbsolute(target) || (process.platform === \"win32\" && target.includes(\":\"))) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const realParent = await mkdirInsideRealDir(path.dirname(destPath), dir, realDir, entry.path)\n if (!(await isLinkTargetInside(realParent, target, realDir, false))) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.symlink(target, path.join(realParent, path.basename(destPath))).catch((e: any) => {\n // fs.symlink never replaces an existing path, so a symlink entry at a path an earlier entry holds is refused by name\n if (e.code === \"EEXIST\") {\n throw new Error(`Zip symlink entry would replace an existing file, directory or symlink: ${entry.path}`)\n }\n throw e\n })\n symlinks.push({ realParent, target })\n } else if (entry.type === \"Directory\") {\n await mkdirInsideRealDir(destPath, dir, realDir, entry.path)\n entry.autodrain()\n } else {\n const realDest = path.join(await mkdirInsideRealDir(path.dirname(destPath), dir, realDir, entry.path), path.basename(destPath))\n // \"wx\" refuses an existing path, so a symlink already sitting at the destination is never followed\n const handle = await fs.open(realDest, \"wx\").catch(async (e: any) => {\n if (e.code !== \"EEXIST\") {\n throw e\n }\n // a duplicate entry replaces the earlier regular file (last one wins, as before); anything else is refused\n if (!(await fs.lstat(realDest)).isFile()) {\n throw new Error(`Zip entry would replace an existing symlink or directory: ${entry.path}`)\n }\n await fs.unlink(realDest)\n return fs.open(realDest, \"wx\")\n })\n await pipeline(entry, handle.createWriteStream())\n if (mode > 0) {\n await fs.chmod(realDest, mode & 0o7777)\n }\n }\n }\n } finally {\n readStream.destroy()\n }\n\n // A later entry can turn a component of an earlier symlink's target into a symlink, so re-check every link against\n // the finished tree: the build writes into this directory afterwards and must not be redirected outside it.\n for (const { realParent, target } of symlinks) {\n if (!(await isLinkTargetInside(realParent, target, realDir, true))) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n }\n}\n\nexport async function extractArchive(archive: string, dir: string) {\n const file = sanitizeDirPath(archive)\n\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n // 100 retries (not 15) so concurrent callers wait out a slow first extraction instead of failing\n // with ELOCKED; the update heartbeat keeps an in-progress holder's lock fresh against `stale`.\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000, // Increased from 60s to allow long-running extractions\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).\n // A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await sleep(300 * (i + 1))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\") || file.endsWith(\".tar.7z\")) {\n // Compressed tarballs node-tar cannot decompress itself (xz, 7z): use 7za to strip the outer\n // compression layer into a .tar, then extract that tar.\n // Note: the .tar.7z check MUST stay ahead of the plain .7z branch below, otherwise only the outer\n // 7z layer is removed and the inner tar is left behind as-is (see https://github.com/electron-userland/electron-builder/issues/10002).\n const cmd7za = await getPath7za()\n const decompressOutDir = `${tmpDir}.decompress`\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n await fs.mkdir(decompressOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(decompressOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(decompressOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(decompressOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n // Check if extraction actually failed or just had benign warnings\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file: log.filePath(file), tmpDir: log.filePath(tmpDir), error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n // If files were extracted despite the error, log and continue\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n // Verify extraction produced files\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await moveDirAtomic(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nlet proxyInitialized = false\nfunction initializeProxyOnce(): void {\n if (!proxyInitialized) {\n reinitializeProxy()\n proxyInitialized = true\n }\n}\n\n/**\n * Forces undici's global proxy dispatcher to re-read the current HTTP(S)_PROXY / NO_PROXY env vars,\n * bypassing the once-guard in initializeProxyOnce(). Exported for integration testing only.\n */\nexport function reinitializeProxy(): void {\n get.initializeProxy()\n}\n\n/**\n * Error codes considered transient for artifact downloads. Plain node socket errors carry the code\n * directly on `error.code`; undici (the fetch implementation used by @electron/get v5) wraps them in\n * a `TypeError: fetch failed` whose code lives on `error.cause.code` — including undici's own\n * `UND_ERR_*` codes for connection resets and connect timeouts.\n */\nconst TRANSIENT_DOWNLOAD_ERROR_CODES = new Set([\n \"ENOTFOUND\",\n \"ETIMEDOUT\",\n \"ECONNRESET\",\n \"ECONNREFUSED\",\n \"EAI_AGAIN\",\n \"EPIPE\",\n \"ENOENT\",\n \"UND_ERR_SOCKET\",\n \"UND_ERR_CONNECT_TIMEOUT\",\n])\n\n/**\n * Decides whether a failed @electron/get download should be retried. Handles all three error shapes\n * seen in practice (exported for tests):\n * - builder-util-runtime's `HttpError` — retry on 5xx.\n * - @electron/get v5's `HTTPError` (`FetchDownloader`) — a plain `Error` subclass with the fetch\n * `Response` on `.response` and NO `.code`; retry on 5xx and 429. Matched by class and by\n * `name === \"HTTPError\"` as a fallback in case multiple @electron/get copies are loaded.\n * - transient network errors — code on `error.code`, or on `error.cause.code` for undici's\n * `TypeError: fetch failed` wrapper.\n */\nexport function shouldRetryDownloadError(e: any): boolean {\n if (e == null) {\n return false\n }\n if (e instanceof HttpError) {\n return e.isServerError()\n }\n if (e instanceof get.HTTPError || e.name === \"HTTPError\") {\n const status = e.response?.status\n return typeof status === \"number\" && (status >= 500 || status === 429)\n }\n const code = typeof e.code === \"string\" ? e.code : typeof e.cause?.code === \"string\" ? e.cause.code : undefined\n return code != null && TRANSIENT_DOWNLOAD_ERROR_CODES.has(code)\n}\n\nconst DOWNLOAD_ATTEMPT_TIMEOUT_MS = 10 * 60 * 1000\n\n/** undici gives up on a silent connection after its own headersTimeout/bodyTimeout (300s by default). */\nconst STALLED_DOWNLOAD_ERROR_CODES = new Set([\"UND_ERR_HEADERS_TIMEOUT\", \"UND_ERR_BODY_TIMEOUT\"])\n\nexport interface RetryDownloadOptions {\n readonly label?: string\n readonly callerSignal?: AbortSignal | null\n readonly attemptTimeoutMs?: number\n}\n\n/**\n * Runs a download with the transient-error retries. Each attempt gets its own `AbortSignal.timeout()` capping\n * its total duration: a shared one stays aborted once it fires, so any later attempt would fail immediately.\n * An attempt that hits that cap, or that undici drops as silent, is retried once. A caller-supplied signal is\n * passed through as is, and its abort is final.\n * Exported for tests.\n */\nexport function retryDownload<T>(download: (signal: AbortSignal) => Promise<T>, options: RetryDownloadOptions = {}): Promise<T> {\n const { label, callerSignal, attemptTimeoutMs = DOWNLOAD_ATTEMPT_TIMEOUT_MS } = options\n let timedOut = false\n return retry(() => download(callerSignal ?? AbortSignal.timeout(attemptTimeoutMs)), {\n retries: 3,\n interval: 2000,\n backoff: 2000,\n shouldRetry: e => {\n // our own timeout abort is a DOMException with a numeric `code`, which shouldRetryDownloadError never matches\n const reason = callerSignal == null && e?.name === \"TimeoutError\" ? \"TimeoutError\" : STALLED_DOWNLOAD_ERROR_CODES.has(e?.cause?.code) ? e.cause.code : null\n if (reason == null) {\n return shouldRetryDownloadError(e)\n }\n if (timedOut) {\n return false\n }\n timedOut = true\n log.warn({ label, reason }, \"download timed out, retrying\")\n return true\n },\n })\n}\n\nasync function downloadArtifactToFile(config: ElectronArtifactDetails, label: string): Promise<string> {\n // Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's\n // non-atomic putFileInCache (remove + move) from racing with a concurrent reader.\n const key = {\n p: (config as ElectronPlatformArtifactDetails).platform,\n a: (config as ElectronPlatformArtifactDetails).arch,\n v: config.version,\n n: config.artifactName,\n g: config.isGeneric,\n }\n\n const artifactLockKey = crypto.createHash(\"sha256\").update(JSON.stringify(key)).digest(\"hex\").slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n // This lock is taken even for cache hits (the cache-hit check lives inside @electron/get), so under\n // heavy concurrency many builds serialize here. 30 retries (~137s of backoff) is too few — waiters\n // were exhausting it and failing with ELOCKED while the holder fetched a large artifact. 100 retries\n // matches the other toolset locks; stale (10min) + proper-lockfile's update heartbeat keep a live\n // downloader's lock fresh so the longer wait never falsely steals an in-progress download.\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 100, minTimeout: 500, maxTimeout: 5000 },\n stale: 600_000,\n realpath: false,\n })\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n // @electron/get v5 downloads via fetch, whose proxy support comes from undici's global dispatcher.\n // initializeProxy() wires that up from HTTP(S)_PROXY/NO_PROXY env vars (replaces the got proxy agent).\n initializeProxyOnce()\n\n const downloadOptions: FetchDownloaderOptions = {\n ...config.downloadOptions,\n getProgressCallback: info => {\n // @electron/get passes downloadOptions (including this callback) to its internal\n // SHASUMS256.txt validation download. That file is tiny (<1 MB) and fires at 100%\n // immediately, producing a spurious bar even when the artifact itself is cached.\n // Skip progress display for any download whose total size is known and small.\n if (info.total && info.total < 1_000_000) {\n return Promise.resolve()\n }\n if (!state.bar && process.stdout.isTTY) {\n log.info({ label }, \"downloading\")\n state.bar = new MultiProgress().createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n }\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (state.bar) {\n state.bar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n const callerSignal = config.downloadOptions?.signal\n // every call gets a fresh timeout signal, to prevent an indefinite hang on stalled connections\n const withSignal = (signal: AbortSignal = callerSignal ?? AbortSignal.timeout(DOWNLOAD_ATTEMPT_TIMEOUT_MS)) => ({ ...config, downloadOptions: { ...downloadOptions, signal } })\n try {\n let filePath: string\n try {\n filePath = await retryDownload(signal => get.downloadArtifact(withSignal(signal)), { label, callerSignal })\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(withSignal())\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...withSignal(), cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n if (!state.bar && lastLoggedMilestone === -1) {\n log.info({ label }, \"using cached artifact\")\n }\n return filePath\n } finally {\n state.bar?.update(100)\n state.bar?.terminate()\n await releaseArtifactLock().catch(err => log.warn({ err }, \"failed to release artifact download lock\"))\n }\n}\n\n/**\n * Checks electron-builder's own archive cache for a previously downloaded archive.\n * Validates the checksum (SHA-256 hex or base64 SHA-512) when one is known. Returns the cached path on hit,\n * null on miss or checksum mismatch (mismatch also deletes the stale file).\n *\n * Air-gapped seeding contract: placing the archive at\n * `<cacheDir>/<releaseName>/<archive>` (e.g. `$ELECTRON_BUILDER_CACHE/appimage@1.0.3/appimage-tools-runtime-20251108.tar.gz`)\n * is sufficient for a fully offline toolset resolution — the checksum here is computed locally\n * against the value hardcoded in the toolset module, and extraction happens locally too. No\n * `.state` file needs to be seeded. See https://www.electron.build/tutorials/offline-air-gapped-builds.\n */\nasync function resolveFromArchiveCache(archiveCachePath: string, label: string, expected: ExpectedChecksum | undefined): Promise<string | null> {\n if (!(await exists(archiveCachePath))) {\n return null\n }\n if (expected != null && !(await verifyFileChecksum(archiveCachePath, expected)).matches) {\n log.warn({ file: label, archiveCachePath }, \"cached archive checksum mismatch — removing and re-downloading\")\n await fs.rm(archiveCachePath).catch(() => {})\n return null\n }\n log.debug({ file: label, archiveCachePath }, \"using cached archive — skipping download\")\n return archiveCachePath\n}\n\n/**\n * Copies a freshly downloaded archive into electron-builder's own archive cache so that\n * future builds (including offline environments) can skip the network request entirely.\n */\nasync function persistToArchiveCache(sourcePath: string, archiveCachePath: string): Promise<void> {\n try {\n await fs.mkdir(path.dirname(archiveCachePath), { recursive: true })\n await fs.copyFile(sourcePath, archiveCachePath)\n } catch (err) {\n log.warn({ err, archiveCachePath }, \"failed to persist archive to cache — will re-download next time\")\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(\n config: ElectronArtifactDetails,\n extractDir: string,\n label: string,\n archiveCachePath?: string,\n expectedChecksum?: ExpectedChecksum\n): Promise<string> {\n // Create only the PARENT dir (e.g. <cache>/fpm@2.2.1), never extractDir itself, before locking.\n // The parent is stable — cleanup only ever removes extractDir and its .state/.tmp/.lock siblings —\n // so extractDir's whole lifecycle (mkdir, rm, re-mkdir) stays inside the lock. ensureDir absorbs\n // the concurrent-recursive-mkdir ENOENT/EEXIST race while peers populate the cold cache tree.\n await ensureDir(path.dirname(extractDir))\n\n // Pre-lock fast path: read-only short-circuit for a definitively complete and valid cache.\n // Safe unlocked — the cache-state helpers return null/false for a missing or half-written dir,\n // so a racing read only ever falls through to take the lock. Do NOT mutate the dir here.\n const stateData = await readCacheStateFile(extractDir)\n if (stateData?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateData.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - cache valid\")\n return extractDir\n }\n }\n\n // Be patient: when many targets/builds contend on the same toolset cache concurrently, all but the\n // first wait here while the winner downloads+extracts (a large bundle can take >1min). 15 retries\n // (~67s) is too few and waiters fail with ELOCKED before the winner finishes; 100 matches the\n // patience of withToolsetLock. proper-lockfile's update heartbeat keeps a live holder's lock fresh,\n // so increasing waiter retries never falsely steals an in-progress extraction.\n const release = await lockfile.lock(extractDir, {\n // realpath:false so proper-lockfile creates <extractDir>.lock in the (already-created) parent\n // WITHOUT calling fs.realpath(extractDir) first — which would throw ENOENT now that extractDir\n // is created lazily inside the lock. This filesystem lock serializes peers both across worker\n // processes AND within a single process (a second lock() for the same path retries until the\n // first releases), so no in-process promise cache is needed — and one wouldn't help across the\n // separate test worker processes anyway.\n realpath: false,\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n const stateDataAfterLock = await readCacheStateFile(extractDir)\n if (stateDataAfterLock?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateDataAfterLock.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n log.warn({ extractDir }, \"Cache marked complete but files invalid, clearing\")\n } else if (stateDataAfterLock?.state === CacheState.corrupted) {\n log.warn({ extractDir }, \"Corrupted cache detected, cleaning up and re-extracting\")\n }\n\n // Cleanup inside the lock — skip lock files since we currently hold them\n await cleanupCacheDirectory(extractDir, { skipLockFiles: true })\n await ensureDir(extractDir)\n\n // Check electron-builder's own archive cache before touching @electron/get.\n // The cache lives alongside the extract dir: <cacheDir>/<releaseName>/<filename>.\n // This lets repeated builds (or offline environments) skip the download entirely once\n // the archive has been fetched at least once.\n if (archiveCachePath) {\n downloadedFile = await resolveFromArchiveCache(archiveCachePath, label, expectedChecksum)\n }\n\n if (!downloadedFile) {\n log.debug({ file: label }, \"downloading\")\n downloadedFile = await downloadArtifactToFile(config, label)\n if (!downloadedFile) {\n throw new Error(`Failed to download artifact: ${label}`)\n }\n // A SHA-256 hex checksum is verified by @electron/get during the download. A base64 SHA-512 was passed with\n // unsafelyDisableChecksums (sumchecker only understands SHA-256 hex), so verify it here, before the archive is\n // persisted to the archive cache or extracted.\n if (expectedChecksum != null && expectedChecksum.algorithm !== \"sha256\") {\n const { matches, actual } = await verifyFileChecksum(downloadedFile, expectedChecksum)\n if (!matches) {\n await fs.rm(downloadedFile, { force: true }).catch(() => {})\n throw new Error(`${checksumMismatchMessage(label, expectedChecksum, actual)} The corrupted download has been removed.`)\n }\n log.debug({ file: label, algorithm: expectedChecksum.algorithm }, \"checksum verified\")\n }\n // Persist the downloaded archive so future builds (and offline environments) can\n // skip the network request entirely.\n if (archiveCachePath) {\n await persistToArchiveCache(downloadedFile, archiveCachePath)\n }\n }\n\n await writeCacheState(extractDir, CacheState.downloaded)\n\n // Mark extracting so stale-lock detection can recover a crashed mid-extraction process\n await writeCacheState(extractDir, CacheState.extracting)\n\n // Extract while holding the lock to prevent concurrent interference\n await extractArchive(downloadedFile, extractDir)\n\n // Compute metadata with a full recursive walk now that tmpDir has been renamed to extractDir\n const { fileCount, extractedSize } = await computeCacheMetadata(extractDir)\n\n // Write complete state with metadata BEFORE releasing the lock; throwOnError=true so a\n // failed write (disk full, permissions) propagates instead of silently producing a no-op cache\n await writeCacheState(extractDir, CacheState.complete, { fileCount, extractedSize }, true)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Copies a remote artifact to a specific output path on disk.\n * Unlike downloadBuilderToolset, this does not extract archives — it copies the raw file.\n * Used for certificate imports where the caller needs the file at a known path.\n */\nexport async function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const filenameWithExt = path.basename(new URL(url).pathname)\n if (checksum == null) {\n log.warn({ url }, \"downloading without an integrity checksum — the download is not verified against a known-good hash\")\n }\n const downloadedFile = await downloadArtifactToFile(\n {\n version: \"9.9.9\",\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksum != null ? { checksums: { [filenameWithExt]: checksum } } : { unsafelyDisableChecksums: true }),\n mirrorOptions: { resolveAssetURL: async () => Promise.resolve(url) },\n isGeneric: true,\n },\n filenameWithExt\n )\n await fs.copyFile(downloadedFile, output)\n}\n\nfunction validateBinaryCustomDir(envVarName: string, value: string): string {\n if (value.includes(\"://\") || value.includes(\"..\") || value.startsWith(\"/\")) {\n throw new Error(\n `${envVarName} must be a safe relative path component (e.g. \"v1.0.0-custom\"). ` + `Values containing \"://\", \"..\", or a leading \"/\" are not allowed. Got: \"${value}\"`\n )\n }\n return value\n}\n\nconst CUSTOM_DIR_ENV_VARS = [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n \"npm_config_electron_builder_binaries_custom_dir\",\n \"npm_package_config_electron_builder_binaries_custom_dir\",\n \"ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n] as const\n\n/**\n * Resolves the final download URL for a builder binary, honouring:\n * ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory\n * ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path\n * overrideUrl (caller-supplied) – the complete file URL, used as-is when no env var is set\n *\n * Exported for unit testing; not part of the public API.\n * @internal\n */\nexport function resolveBuilderBinaryUrl(releaseName: string, filenameWithExt: string, baseUrl: string, overrideUrl?: string): string {\n const envOverrideUrl = parseValidEnvVarUrl(\"ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL\")\n if (envOverrideUrl != null) {\n return `${envOverrideUrl}/${filenameWithExt}`\n }\n if (overrideUrl != null) {\n // The caller-supplied override (ToolsetCustom.url) points directly at the file — appending\n // filenameWithExt would double the last path segment (e.g. …/bundle.7z/bundle.7z, issue #10084).\n return overrideUrl\n }\n const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null)\n if (customDirEntry != null) {\n return `${baseUrl}${validateBinaryCustomDir(customDirEntry.name, customDirEntry.value!)}/${filenameWithExt}`\n }\n return `${baseUrl}${releaseName}/${filenameWithExt}`\n}\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\n/**\n * Every `toolsets.*` property now defaults to \"latest\", which resolves to a newer bundle than v26\n * pinned (NSIS 3.0.4.1 -> 3.12, winCodeSign 2.6.0 -> 1.3.0, Wine 4.0.1 -> 11.0, AppImage FUSE2 ->\n * static FUSE3). Nothing recorded which version was used: `downloadBuilderToolset` logged only at\n * debug level, and on a warm cache it printed nothing at all — so a regression introduced by a new\n * bundle had no trace in the build log tying it to the toolset.\n */\nconst TOOLSET_DEFAULTS_DOCS = `${BUILD_CHANGES_URL}#toolset-defaults-resolve-to-latest-newest-bundle`\n\nfunction announceToolsetVersion(releaseName: string): void {\n // once per toolset per process, so a multi-target build logs each one once\n log.once(`toolset:${releaseName}`).info({ toolset: releaseName, docs: TOOLSET_DEFAULTS_DOCS }, \"using toolset\")\n}\n\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n announceToolsetVersion(releaseName)\n\n if (/[/\\\\]|^\\.\\./.test(filenameWithExt) || filenameWithExt.includes(\"..\")) {\n throw new Error(`downloadBuilderToolset: unsafe filenameWithExt \"${filenameWithExt}\" — must be a plain filename with no path separators or traversal sequences`)\n }\n\n const { expectedChecksum, electronGetChecksums } = resolveToolsetChecksums(releaseName, filenameWithExt, checksums)\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, overrideUrl)\n const suffix = hashUrlSafe(fullUrl, 5)\n // tar.7z is listed before 7z so the full extension is stripped. Deliberate side effect: this changes the\n // extract-dir name for .tar.7z toolsets (e.g. the snap template) from \"<name>.tar-<hash>\" to \"<name>-<hash>\",\n // which busts caches poisoned by the broken .tar.7z extraction in 26.15.0-26.15.6 (issue #10002).\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|tar\\.xz|txz|tar\\.7z|zip|7z)$/, \"\")}-${suffix}`\n // releaseName is library input; enforce cache-dir containment (rejects traversal, clears taint into shell extraction)\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const extractDir = sanitizeDirPath(path.join(cacheDir, releaseName, folderName), cacheDir)\n\n // Use resolveAssetURL so @electron/get's ELECTRON_MIRROR env var check cannot override\n // the builder-binaries URL we've already resolved (see getArtifactRemoteURL in @electron/get).\n const mirrorOptions: MirrorOptions = {\n resolveAssetURL: async () => Promise.resolve(fullUrl),\n }\n\n // Predictable archive cache: <cacheDir>/<releaseName>/<filename>, next to the extract dir.\n // downloadAndExtract checks here before touching @electron/get and persists the archive here\n // after every successful download, so subsequent builds never need a network round-trip.\n const archiveCachePath = sanitizeDirPath(path.join(cacheDir, releaseName, filenameWithExt), cacheDir)\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(electronGetChecksums != null ? { checksums: electronGetChecksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt, archiveCachePath, expectedChecksum)\n}\n\n/**\n * Classifies every entry of a toolset checksum table up front, so a malformed value fails before anything is downloaded\n * instead of as a sumchecker parse error or a generic mismatch afterwards. Returns the checksum for `filenameWithExt` and,\n * when every entry is SHA-256 hex, the (lowercased) table to hand to `@electron/get`; base64 SHA-512 checksums are verified\n * by electron-builder after the download instead (#10040).\n */\nfunction resolveToolsetChecksums(\n releaseName: string,\n filenameWithExt: string,\n checksums: Record<string, string> | undefined\n): { expectedChecksum?: ExpectedChecksum; electronGetChecksums?: Record<string, string> } {\n if (checksums == null) {\n return {}\n }\n const parsed = Object.entries(checksums).map(([file, value]) => [file, parseChecksum(value, `The checksum for \"${file}\" (${releaseName})`)] as const)\n const algorithms = new Set(parsed.map(([, checksum]) => checksum.algorithm))\n if (algorithms.size > 1) {\n throw new Error(`Checksums for ${releaseName} mix formats: use a single format for all entries, either SHA-256 hex or base64 SHA-512`)\n }\n const expectedChecksum = parsed.find(([file]) => file === filenameWithExt)?.[1]\n if (algorithms.has(\"sha256\")) {\n return { expectedChecksum, electronGetChecksums: Object.fromEntries(parsed.map(([file, checksum]) => [file, checksum.value])) }\n }\n if (expectedChecksum == null) {\n // @electron/get would reject a missing entry itself, but its validation is disabled for SHA-512 checksums: never let a\n // table without an entry for this file turn into an unverified download.\n throw new Error(`No checksum for \"${filenameWithExt}\" in the checksums for ${releaseName}`)\n }\n return { expectedChecksum }\n}\n\n/**\n * Mirrors @electron/get's default cache root (`env-paths(\"electron\", { suffix: \"\" }).cache`).\n * @electron/get does not export it and its package `exports` map blocks deep imports, so the\n * (deliberately tiny) platform switch is replicated here. Must stay in sync with the\n * `cacheRoot` default documented in @electron/get's `ElectronDownloadRequestOptions`.\n * @internal exported for unit testing\n */\nexport function defaultElectronGetCacheRoot(): string {\n const name = \"electron\"\n const homeDir = os.homedir()\n switch (os.platform()) {\n case \"darwin\":\n return path.join(homeDir, \"Library\", \"Caches\", name)\n case \"win32\":\n return path.join(process.env.LOCALAPPDATA || path.join(homeDir, \"AppData\", \"Local\"), name, \"Cache\")\n default:\n return path.join(process.env.XDG_CACHE_HOME || path.join(homeDir, \".cache\"), name)\n }\n}\n\n/**\n * Parses the upstream `SHASUMS256.txt` format into the `Record<filename, sha256-hex>` shape that\n * @electron/get accepts as inline `checksums`. Each line is `<sha256-hex> *<filename>` (binary\n * mode) or `<sha256-hex> <filename>` (text mode); malformed lines are ignored.\n * @internal exported for unit testing\n */\nexport function parseChecksumFile(content: string): Record<string, string> {\n const checksums: Record<string, string> = {}\n for (const rawLine of content.split(\"\\n\")) {\n const match = /^([a-fA-F0-9]{64})\\s+\\*?(.+)$/.exec(rawLine.trim())\n if (match != null) {\n checksums[match[2]] = match[1].toLowerCase()\n }\n }\n return checksums\n}\n\n/**\n * Looks for a locally seeded SHASUMS256 file at the root of the @electron/get cache and returns\n * its contents as inline `checksums`, or null when nothing usable is seeded.\n *\n * Why: without inline `checksums`, @electron/get re-downloads `SHASUMS256.txt` with a hardcoded\n * `cacheMode: Bypass` on EVERY build — even when the artifact itself is a cache hit — so a fully\n * seeded cache still requires network access and air-gapped builds fail (#10039). Cache-seeding\n * tools (e.g. flatpak-node-generator) already place `SHASUMS256.txt-<version>` flat at the cache\n * root; feeding it back as inline `checksums` keeps checksum validation enabled while making it\n * fully offline. A plain `SHASUMS256.txt` at the cache root is accepted as a manual-seeding\n * fallback. A candidate file is only used when it actually contains an entry for the requested\n * artifact, so a stale file for another version can never break an online build.\n * See https://www.electron.build/tutorials/offline-air-gapped-builds for the seeding contract.\n * @internal exported for unit testing\n */\nexport async function resolveSeededChecksums(cacheRoot: string, version: string, artifactFileName: string): Promise<Record<string, string> | null> {\n const candidates = [path.join(cacheRoot, `SHASUMS256.txt-${version}`), path.join(cacheRoot, \"SHASUMS256.txt\")]\n for (const candidate of candidates) {\n if (!(await exists(candidate))) {\n continue\n }\n let content: string\n try {\n content = await fs.readFile(candidate, \"utf-8\")\n } catch (err: any) {\n log.warn({ file: log.filePath(candidate), err: err.message }, \"failed to read seeded SHASUMS file — ignoring it\")\n continue\n }\n const checksums = parseChecksumFile(content)\n if (checksums[artifactFileName] == null) {\n log.warn({ file: log.filePath(candidate), artifactFileName }, \"seeded SHASUMS file has no entry for the requested artifact — ignoring it\")\n continue\n }\n log.debug({ file: log.filePath(candidate), artifactFileName }, \"using locally seeded SHASUMS256 checksums — checksum validation can run offline\")\n return checksums\n }\n return null\n}\n\n/**\n * Assembles the `@electron/get` artifact config (`ElectronPlatformArtifactDetails`) from\n * `ArtifactDownloadOptions`: spreads the caller's options and pins `cacheRoot`/`platform`/`arch`/\n * `version`/`artifactName` and the resolved cache mode, warning when checksum verification is\n * disabled. When the caller provides no `checksums` (user-provided `electronGet.checksums` always\n * wins) and verification is not disabled, a locally seeded `SHASUMS256.txt-<version>` at the cache\n * root is picked up as inline `checksums` so validation works offline (see resolveSeededChecksums).\n * Callers pass the result to `downloadArtifactToFile` / `downloadAndExtract`.\n * @internal exported for unit testing\n */\nexport async function buildElectronArtifactConfig(artifactOptions: ArtifactDownloadOptions): Promise<ElectronPlatformArtifactDetails> {\n const { options, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = artifactOptions\n\n if (options?.unsafelyDisableChecksums) {\n log.warn(\n { artifactName },\n \"electronGet.unsafelyDisableChecksums is enabled — downloaded artifacts will NOT be verified; a compromised mirror can serve malicious binaries undetected\"\n )\n }\n\n const artifactConfig: ElectronPlatformArtifactDetails = { ...options, cacheRoot, platform, arch, version, artifactName, cacheMode: resolveCacheMode() }\n if (artifactConfig.checksums == null && !artifactConfig.unsafelyDisableChecksums) {\n // Matches @electron/get's getArtifactFileName for non-generic artifacts; `artifactSuffix` and\n // `customFilename` cannot diverge here — both are excluded from ElectronGetOptions.\n const artifactFileName = `${artifactName}-v${version}-${platform}-${arch}.zip`\n const seededChecksums = await resolveSeededChecksums(cacheRoot ?? defaultElectronGetCacheRoot(), version, artifactFileName)\n if (seededChecksums != null) {\n artifactConfig.checksums = seededChecksums\n }\n }\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport async function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = await buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\n/**\n * Downloads an electron platform artifact (e.g. ffmpeg) via `@electron/get` and extracts it into a\n * content-addressed cache directory (keyed on a hash of the resolved artifact config), returning the\n * extraction path.\n */\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = await buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(await cacheDirectoryOverrideAllowed.value, `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n const allowHttp = process.env[\"ELECTRON_BUILDER_DANGEROUSLY_ALLOW_HTTP\"] === \"true\"\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar, allowHttp)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type Platform } from "../core.js";
|
|
2
|
+
import type { PlatformSpecificBuildOptions } from "../options/PlatformSpecificBuildOptions.js";
|
|
3
|
+
import type { AppElectronUpdater } from "./packageMetadata.js";
|
|
4
|
+
/** Default `electronUpdaterCompatibility`: the electron-updater versions the installed apps are assumed to ship. */
|
|
5
|
+
export declare const DEFAULT_ELECTRON_UPDATER_COMPATIBILITY = ">=7";
|
|
6
|
+
/** v27 breaking-changes entry on the block map format following `electronUpdaterCompatibility`, linked from the build warning and error. */
|
|
7
|
+
export declare const BLOCK_MAP_FORMAT_DOCS_URL = "https://www.electron.build/docs/migration/v27-build-changes#block-map-format-follows-electronupdatercompatibility";
|
|
8
|
+
/** electron-updater versions before this one cannot read the binary block map; for ranges (`electronUpdaterCompatibility`). */
|
|
9
|
+
export declare const BINARY_BLOCK_MAP_MIN_UPDATER = "7.0.0";
|
|
10
|
+
/**
|
|
11
|
+
* 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`)
|
|
12
|
+
* cannot, though a range such as `>=7` reads as electron-updater 7.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BINARY_BLOCK_MAP_MIN_UPDATER_RELEASE = "7.0.0-alpha.13";
|
|
15
|
+
/**
|
|
16
|
+
* The first electron-updater release that rejects update checks and downloads until the app sets `autoUpdater.crossOriginHeaders`:
|
|
17
|
+
* the releases up to 7.0.0-alpha.13 (npm `next`) have no such property.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CROSS_ORIGIN_HEADERS_MIN_UPDATER_RELEASE = "7.0.0-alpha.14";
|
|
20
|
+
/**
|
|
21
|
+
* Whether the app's electron-updater (an installed version or a declared range) may reject update checks until the app sets
|
|
22
|
+
* `autoUpdater.crossOriginHeaders`: one whose version cannot be read (`catalog:`, a dist-tag) may.
|
|
23
|
+
*/
|
|
24
|
+
export declare function mayRequireCrossOriginHeaders(updater: Pick<AppElectronUpdater, "version" | "isUnresolvable">): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The first electron-updater release with `autoUpdater.allowUnverifiedLinuxPackages`: before it, the property does nothing and rpm
|
|
27
|
+
* updates install with the package manager's signature check bypassed.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ALLOW_UNVERIFIED_LINUX_PACKAGES_MIN_UPDATER_RELEASE = "7.0.0-alpha.5";
|
|
30
|
+
/**
|
|
31
|
+
* Whether the app's electron-updater (an installed version or a declared range) may honor `autoUpdater.allowUnverifiedLinuxPackages`:
|
|
32
|
+
* one whose version cannot be read (`catalog:`, a dist-tag) may.
|
|
33
|
+
*/
|
|
34
|
+
export declare function maySupportAllowUnverifiedLinuxPackages(updater: Pick<AppElectronUpdater, "version" | "isUnresolvable">): boolean;
|
|
35
|
+
/** Whether the `electronUpdaterCompatibility` range includes only electron-updater versions that read the binary block map. */
|
|
36
|
+
export declare function isBinaryBlockMapSupported(range: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether a build with the `blockmap` option `value` writes binary `.blockmap` files for `range`, without the validation and
|
|
39
|
+
* warning of `resolveBlockMapFormat`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function writesBinaryBlockMap(value: unknown, range: string): boolean;
|
|
42
|
+
/** The `electronUpdaterCompatibility` range that applies to a platform: the platform option, then the root option, then the default. */
|
|
43
|
+
export declare function resolveElectronUpdaterCompatibility(platformOptions: Pick<PlatformSpecificBuildOptions, "electronUpdaterCompatibility"> | null | undefined, config: Pick<PlatformSpecificBuildOptions, "electronUpdaterCompatibility">): string;
|
|
44
|
+
type CompatibilityOptions = Pick<PlatformSpecificBuildOptions, "electronUpdaterCompatibility">;
|
|
45
|
+
type PlatformKey = "mac" | "win" | "linux";
|
|
46
|
+
/** What the app's own electron-updater has to read on one platform of a build. */
|
|
47
|
+
export interface ElectronUpdaterRequirement {
|
|
48
|
+
readonly platform: string;
|
|
49
|
+
/** the `electronUpdaterCompatibility` of the platform */
|
|
50
|
+
readonly range: string;
|
|
51
|
+
/** whether the platform publishes binary `.blockmap` files that electron-updater reads */
|
|
52
|
+
readonly binaryBlockMap: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The requirement of each platform a build targets, resolved as the targets resolve them (`platformOptions`, then the root option,
|
|
56
|
+
* then the default). `builtTargets`: the target names each platform builds (see `resolveTargetNames`).
|
|
57
|
+
*/
|
|
58
|
+
export declare function electronUpdaterRequirements(config: CompatibilityOptions & {
|
|
59
|
+
readonly blockmap?: unknown;
|
|
60
|
+
} & {
|
|
61
|
+
readonly [platform in PlatformKey]?: CompatibilityOptions | null;
|
|
62
|
+
}, builtTargets: Iterable<readonly [Pick<Platform, "name" | "buildConfigurationKey">, Iterable<string>]>): Array<ElectronUpdaterRequirement>;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=electronUpdaterCompatibility.d.ts.map
|