fix(install): kill running muyue before extracting (v0.7.7) #16
Reference in New Issue
Block a user
Delete Branch "release/v0.7.7"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug rapporté
En mettant à jour de v0.7.5 → v0.7.6 :
Cause
Expand-Archive -Forcene peut pas écraser un fichier verrouillé sous Windows. Si v0.7.5 tourne au moment de l'extract :muyue.exe(la copie canonique créée parinstall-shortcuts) est verrouillé par le process en coursFix
Ajout d'une 1ʳᵉ ligne au snippet d'install :
-ErrorAction SilentlyContinue→ idempotent (no-op si rien ne tourne, cas install propre)Start-Sleep 500ms→ laisse Windows libérer le file handle avantExpand-ArchiveSnippet officiel passe à 6 lignes ; note explicative ajoutée pour les utilisateurs qui mettent à jour depuis une version précédente.
Versioning
Test plan
muyue versionaffiche v0.7.7User 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