fix: Windows desktop updater — sign setup.exe, preserve latest.json on deploy

Sign *-setup.exe for updater manifest, pick newest bundle per platform,
reconcile after git checkout, and stop overwriting latest.json with empty
placeholder. Bump desktop to 0.1.3.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Macbook
2026-06-14 12:03:48 +09:00
parent b0b0fcb682
commit 967df18287
6 changed files with 56 additions and 15 deletions
+22 -1
View File
@@ -15,12 +15,33 @@ fi
VERSION="$(node -p "require('$CONF').version" 2>/dev/null || echo '0.1.0')"
LATEST_JSON="$UPDATES_DIR/latest.json"
BUILD_INFO="$UPDATES_DIR/build-info.json"
if [[ -f "$BUILD_INFO" ]]; then
BI_VER="$(node -p "require('$BUILD_INFO').version || ''" 2>/dev/null || true)"
if [[ -n "$BI_VER" ]]; then
VERSION="$(node <<NODE
const cmp = (a, b) => {
const pa = a.split('.').map(Number), pb = b.split('.').map(Number);
for (let i = 0; i < 3; i++) { const d = (pa[i]||0)-(pb[i]||0); if (d) return d; }
return 0;
};
console.log(cmp('$BI_VER', '$VERSION') > 0 ? '$BI_VER' : '$VERSION');
NODE
)"
fi
fi
if [[ -f "$LATEST_JSON" ]]; then
EXISTING="$(node <<NODE
const fs = require('fs');
const confV = '$VERSION';
let existing = '0.0.0';
try { existing = JSON.parse(fs.readFileSync('$LATEST_JSON', 'utf8')).version || '0.0.0'; } catch {}
let hasPlatforms = false;
try {
const j = JSON.parse(fs.readFileSync('$LATEST_JSON', 'utf8'));
existing = j.version || '0.0.0';
hasPlatforms = j.platforms && Object.keys(j.platforms).length > 0;
} catch {}
if (!hasPlatforms) { console.log(confV); process.exit(0); }
const cmp = (a, b) => {
const pa = a.split('.').map(Number), pb = b.split('.').map(Number);
for (let i = 0; i < 3; i++) {