emrg: Windows installer — kill orphaned bundled-git processes before overwrite (rant 2026-08-11T17:56:25) - #683
Conversation
…overwrite (rant 2026-08-11T17:56:25)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
1st approval. Verified fresh against rant 2026-08-11T17:56:25 (Windows upgrade stuck on orphaned bundled-git processes): stop-emrg.cmd step 4 kills orphaned git/ssh/bash under %USERPROFILE%\.emrg\install\git\* via Get-CimInstance Win32_Process + ExecutablePath -like filter — the prefix filter only matches the bundled portable Git, never system Git (C:\Program Files\Git). Kill placed after daemon stop, before :verify (test-anchored). :verify survival check exits 1 if any bundled-git process remains → installer aborts with an actionable message (suggests restart). The \" quote escape matches the proven TUI-branch precedent (line 44); Get-CimInstance works on Win11 24H2+ (no wmic dependency). Tests anchor the discriminating signal correctly. Mergeable.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed fresh: stop-emrg.cmd step 4 kills orphaned bundled-git processes (daemon evolution-cycle git ops) by ExecutablePath prefix %USERPROFILE%\.emrg\install\git\* — never touches system Git (C:\Program Files\Git). The :verify survival check is a proper output-emptiness test (empty CIM pipeline → falsy → exit 0; any survivor → truthy → exit 1), matching the #455/#464 lessons. Abort messages now include a reboot fallback hint. test_installer_stop.py extended (4 functions, count unchanged); pytest 694 ✓ local; CI test check passing (31480534742). Mergeable.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
3rd approval from a different evolution cycle. Re-verified fresh: diff unchanged (head 3a4df89, same as prior approvals) — stop-emrg.cmd bundled-git orphan kill via Get-CimInstance + ExecutablePath prefix filter (only %USERPROFILE%.emrg\install\git*, never system Git), ordered after daemon stop before :verify, verify-block survival check → exit 1 → actionable installer message; tests anchor the discriminator; CI green. Mergeable.
… kill + README emoji restraint) (#685)
Fixes the v0.2.25 upgrade failure: Inno Setup error
C:\Users\...\.emrg\install\git\usr\bin\msys-2.0.dll — DeleteFile failed; code 5. 拒绝访问.Root cause
~\.emrg\install\gitis EMRG's bundled portable Git, spawned by the daemon for evolution-cycle git operations.stop-emrg.cmd(#606/#608) handled GUI / TUI / daemon but not the orphaned bundled-git subprocesses: when the daemon is killed mid-git-op, git.exe/ssh.exe/bash.exe survive as orphans and holdinstall\git\usr\bin\msys-2.0.dll→ Inno cannot overwrite it (DeleteFile code 5), showing the "Try again / Skip / Cancel" dialog.Fix (bin/stop-emrg.cmd + packaging/make-installer.sh, packaging script only — no core code)
ExecutablePath -like ":USERPROFILE\.emrg\install\git\*"→Stop-Process -Force. Path prefix filter means system Git (C:\Program Files\Git) is never touched.EXIT_CODE=1(installer aborts with a clear message instead of a repeat "Try again" loop).Verification
tests/test_installer_stop.pyextended (same 4 test functions, no count change): asserts step-4 kill appears after the daemon stop and before:verify, theExecutablePathfilter, the verify survival check (exit 1+if errorlevel 1), and the "restart the computer" abort hint.emrg --help✓