fix: fix tar.exe invocation (#14997)

This commit is contained in:
Alex Rudenko
2026-05-18 08:12:35 +02:00
committed by GitHub
parent 98da648db6
commit 505c07d899
+4 -1
View File
@@ -196,7 +196,10 @@ async function extractZip(
// -x: extract files
// -f: specify the archive file
// -C: extract to the specified directory
await execFileAsync('tar.exe', ['-xf', archivePath, '-C', folderPath]);
const systemRoot =
process.env['SystemRoot'] ?? process.env['SYSTEMROOT'] ?? 'C:\\Windows';
const systemTar = `${systemRoot}\\System32\\tar.exe`;
await execFileAsync(systemTar, ['-xf', archivePath, '-C', folderPath]);
} else {
// -o: overwrite existing files without prompting
// -d: extract files into the specified directory