From 1092d359abc94aa74b86b77b3e3159ef80e48a0f Mon Sep 17 00:00:00 2001 From: alwaysmesmerizingyou Date: Sat, 22 Aug 2026 21:48:23 -0700 Subject: [PATCH] clean old nsis bundles and strictly match installer version to prevent uploading outdated exe --- release.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/release.js b/release.js index 391cfeb..742c7ea 100644 --- a/release.js +++ b/release.js @@ -158,13 +158,21 @@ async function main() { await ensureWebView2Loader(); + const bundleDir = path.join(__dirname, 'src-tauri', 'target', 'release', 'bundle'); + if (fs.existsSync(bundleDir)) { + fs.rmSync(bundleDir, { recursive: true, force: true }); + } + + console.log('Compiling Windows Tauri installer locally...'); execSync('npm run build', { stdio: 'inherit' }); const nsisDir = path.join(__dirname, 'src-tauri/target/release/bundle/nsis'); if (fs.existsSync(nsisDir)) { - const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe')); + const targetVersion = version.startsWith('v') ? version.substring(1) : version; + const files = fs.readdirSync(nsisDir).filter(f => f.endsWith('.exe') && f.includes(targetVersion)); + if (files.length > 0) { const originalName = files[0]; installerPath = path.join(nsisDir, originalName);