diff --git a/src/native/updater.ts b/src/native/updater.ts index 98ccff3..e9c5f49 100644 --- a/src/native/updater.ts +++ b/src/native/updater.ts @@ -79,11 +79,11 @@ async function downloadAndInstall(url: string, version: string) { const res = await fetch(url); if (!res.ok) throw new Error(`Download failed: ${res.status}`); + const installDir = dirname(process.execPath); + await pipeline(Readable.fromWeb(res.body as Parameters[0]), createWriteStream(zipPath)); console.log(`[updater] download complete, extracting to ${installDir}`); - const installDir = dirname(process.execPath); - await new Promise((resolve, reject) => { const cmd = process.platform === "win32"