diff --git a/src/native/updater.ts b/src/native/updater.ts index e9c5f49..055e455 100644 --- a/src/native/updater.ts +++ b/src/native/updater.ts @@ -88,7 +88,7 @@ async function downloadAndInstall(url: string, version: string) { const cmd = process.platform === "win32" ? `powershell -Command "Expand-Archive -Force -Path '${zipPath}' -DestinationPath '${extractDir}'; $sub = (Get-ChildItem '${extractDir}' | Select-Object -First 1).FullName; Copy-Item -Recurse -Force \\"$sub\\*\\" '${installDir}'"` - : `unzip -o "${zipPath}" -d "${extractDir}" && SUBDIR=$(ls "${extractDir}" | head -1) && cp -rT "${extractDir}/$SUBDIR" "${installDir}"`; + : `unzip -o "${zipPath}" -d "${extractDir}" && SUBDIR=$(ls "${extractDir}" | head -1) && rm -f "${installDir}/sanctum" && cp -rT "${extractDir}/$SUBDIR" "${installDir}"`; exec(cmd, { shell: process.platform === "win32" ? undefined : "/bin/bash" }, (err, _stdout, stderr) => { if (err) { console.error("[updater] extract failed:", stderr); reject(err); }