Skip to content

Template 0.1.47: the Windows uninstall stops the app's running processes - #72

Merged
guijacquemet merged 2 commits into
mainfrom
claude/laughing-wright-s6cht3
Dec 4, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/laughing-wright-s6cht3

Conversation

@guijacquemet

Copy link
Copy Markdown
Collaborator

Summary

Template 0.1.47: on Windows, the uninstall stops the app's running processes first, so it removes the whole app folder.

The testers of LabConstrictor-CAREamics 0.0.5 found the app folder left behind on two Windows 11 computers: 433 MB on one and 4.1 GB on the other. What stayed was python.exe, python3.dll, python312.dll, the VC++ runtime DLLs and the folders DLLs, Lib, Library and <app>. Jupyter was still open.

Windows cannot delete a file that a running process uses. The uninstaller asks for those files to be deleted at the next restart, but Windows does that only for an administrator, and the apps are installed for one user. The --busy round trip of #71 showed the same files staying in CI, even after the process ended.

Changes

  • app/bash_bat_scripts/pre_uninstall.bat: one PowerShell command, after three REM lines, placed just before echo Pre-uninstall completed!. It:

    • stops every process whose program is inside the app folder: a Jupyter server and its kernels, a napari or Fiji tool worker;
    • spares its own process chain (the uninstaller and cmd), _conda.exe and Uninstall-*.exe;
    • waits up to 15 s for each process to end.

    Notebook edits since Jupyter's last autosave are lost. Linux and macOS are unchanged, because rm -rf removes files that are in use.

  • Installer round trip: --busy is now strict. The running Python of the app must be stopped and the folder must be gone, on the real Windows installer.

  • Migration v0_1_46_to_v0_1_47.py: adds the four lines before echo Pre-uninstall completed! and keeps the file's line endings. It reports SKIPPED when that line is missing, and does nothing on a second run.

    • The design note is .tools/docs/migration_0_1_47.md. It also covers removing what an older uninstall left.
    • Tests: tests/test_template_sync_0_1_47.py, plus the helper tests/_v0_1_47.py, chained from _v0_1_46.

Checks

  • Local: pytest tests (635 passed), ruff and mypy.
  • The PowerShell runs only on Windows, so the round trip in this PR's CI is the test of it.

Checklist

  • Changes a button label, form field, workflow or artifact name, installer name or file path? No.
  • Bumped template_version if users must act (0.1.47)
  • Screenshots still valid

Generated by Claude Code

Testers who uninstalled while Jupyter was open found the app folder left
behind (python.exe, its DLLs, Lib, DLLs, Library: 0.4 to 4 GB): Windows
cannot delete files in use, and the restart-time deletion the uninstaller
asks for needs an administrator. pre_uninstall.bat now stops every process
whose program is inside the app folder (sparing the uninstaller and its
helpers) and waits for them, so the uninstall removes the whole folder.

The installer round trip's --busy mode becomes strict: the running Python
of the app must be stopped and the folder gone. Migration 0.1.47 adds the
lines before "echo Pre-uninstall completed!" (line endings kept, SKIPPED
when that line is missing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AoUT3RtgWWsiVVarX
… by full path, a log of what was stopped

The busy round trip found the running Python of the app still running
after the uninstall, with nothing to show why. The command now takes the
app folder from %~dp0 (not the PREFIX variable), calls PowerShell by its
full path and writes %TEMP%\labconstrictor_pre_uninstall.log, which the
uninstaller shows and the round trip prints and uploads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AoUT3RtgWWsiVVarX
@guijacquemet
guijacquemet merged commit 0a3feed into main Dec 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants