From 29953bde6d48b7021b7df55ca3e84e33dc33ddb1 Mon Sep 17 00:00:00 2001 From: Muyue Date: Mon, 27 Apr 2026 14:29:59 +0200 Subject: [PATCH] fix(install): kill running muyue before extracting (v0.7.7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User reported v0.7.6 install silently no-op'd when v0.7.5 was still running: $dest = "$env:LOCALAPPDATA\Muyue" Expand-Archive -Path "$env:TEMP\muyue.zip" -DestinationPath $dest -Force # No error, but the running v0.7.5 .exe stays in place because # Windows refuses to overwrite a locked file. After 'install', the # 'muyue' command still launches v0.7.5. Add a Stop-Process step at the top of the install snippet: Get-Process muyue, muyue-windows-amd64 -ErrorAction SilentlyContinue | Stop-Process -Force Start-Sleep -Milliseconds 500 -ErrorAction SilentlyContinue makes it idempotent (no error on a clean first install). The 500ms sleep gives Windows time to release the file handle before Expand-Archive opens the destination paths. Snippet bumps to 6 lines; explanatory note added so users updating from a previous version know why this step matters. - internal/version/version.go: 0.7.6 → 0.7.7 - CHANGELOG.md: v0.7.7 entry --- .gitea/workflows/ci-main.yml | 3 +++ CHANGELOG.md | 14 ++++++++++++++ internal/version/version.go | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-main.yml b/.gitea/workflows/ci-main.yml index 0f1fae8..5148f10 100644 --- a/.gitea/workflows/ci-main.yml +++ b/.gitea/workflows/ci-main.yml @@ -152,12 +152,15 @@ jobs: echo "" echo "**Windows (x86_64)** — sans privilèges admin, crée les raccourcis Bureau + Menu Démarrer + commande \`muyue\` dans la session courante :" echo "\`\`\`powershell" + echo "Get-Process muyue, muyue-windows-amd64 -ErrorAction SilentlyContinue | Stop-Process -Force; Start-Sleep -Milliseconds 500" echo "\$dest = \"\$env:LOCALAPPDATA\\Muyue\"; New-Item -ItemType Directory -Force -Path \$dest | Out-Null" echo "Invoke-WebRequest -Uri \"${DL_URL}/muyue-windows-amd64.zip\" -OutFile \"\$env:TEMP\\muyue.zip\"" echo "Expand-Archive -Path \"\$env:TEMP\\muyue.zip\" -DestinationPath \$dest -Force" echo "& \"\$dest\\muyue-windows-amd64.exe\" install-shortcuts" echo "\$env:Path += \";\$dest\"" echo "\`\`\`" + echo "" + echo "Le 1ʳᵉ ligne tue toute instance Muyue déjà lancée (sinon Windows refuse d'écraser le \`.exe\` verrouillé et l'install échoue silencieusement). Si vous mettez à jour depuis une version précédente, c'est obligatoire." } > /tmp/stable_changelog.md echo "path=/tmp/stable_changelog.md" >> $GITHUB_OUTPUT diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f2358f..74e4b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## v0.7.7 + +### Fix : install Windows échoue silencieusement quand une version précédente tourne + +Symptôme rapporté en mettant à jour de v0.7.5 → v0.7.6 : `Expand-Archive ... -Force` semble réussir mais le `.exe` n'est en réalité pas écrasé (Windows refuse de remplacer un fichier verrouillé), donc après l'install, `muyue` lance toujours l'ancienne version. Aucun message d'erreur visible — d'où le côté traître. + +**Fix** : ajout d'une 1ʳᵉ ligne au snippet d'install qui tue toute instance Muyue déjà lancée : + +```powershell +Get-Process muyue, muyue-windows-amd64 -ErrorAction SilentlyContinue | Stop-Process -Force; Start-Sleep -Milliseconds 500 +``` + +`-ErrorAction SilentlyContinue` rend l'étape idempotente (pas d'erreur si rien ne tourne, cas d'install propre). Le `Start-Sleep` 500ms laisse Windows libérer le file handle. Le snippet officiel passe à 6 lignes ; une note explicative est ajoutée dans la section *Install* du changelog généré. + ## v0.7.6 ### Trois fixes Windows + une amélioration agent diff --git a/internal/version/version.go b/internal/version/version.go index e51f8c4..c475816 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -7,7 +7,7 @@ import ( const ( Name = "muyue" - Version = "0.7.6" + Version = "0.7.7" Author = "La Légion de Muyue" ) -- 2.49.1