Repository navigation
installer: find userData by package name too, delete long paths; recover a half-removed env - #18
Merged
Merged
Conversation
…ver a half-removed env Electron names userData after package.json's productName, else its name; an app that sets productName only in electron-builder.yml (Ground Crew) gets %APPDATA%\de-groundcrew while APP_FILENAME is "Ground Crew". installer.nsh looked only at APP_FILENAME, so the uninstaller never offered to remove the env and the update sweep could not see a stray sidecar. It now checks APP_PACKAGE_NAME and PRODUCT_NAME. NSIS's RMDir stops at MAX_PATH, and jupyterlab-widgets puts 330-character paths in the env and the uv cache, so a Yes left 17 files behind. `rd \?\` goes first. A python-env without pyvenv.cfg (what that left) made uv refuse the directory, so every later launch failed at env setup. resolvePythonEnv clears it first. Claude-Session: https://claude.ai/code/session_01H5iXTCbhcT5B6PHa6QD743
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three bugs found by running Ground Crew's real NSIS installer (directelectron/de_ground_crew#542). Two are in
installer.nsh, which had never been run, and one is inpythonEnv.1. The uninstaller and the update sweep looked in the wrong userData folder
Electron names userData after
package.json'sproductName, and falls back to itsname. GC setsproductNameonly inelectron-builder.yml, so its userData is%APPDATA%\de-groundcrew.installer.nshused${APP_FILENAME}, which isGround Crew. As a result:python-env/pythonprocesses).Both now check
${APP_PACKAGE_NAME}and${PRODUCT_NAME}. Both belong to the app, so a sibling app's data is still out of reach.2. "Yes, remove it" left files behind
NSIS's
RMDir /rstops at MAX_PATH. jupyterlab-widgets puts 330-character paths in the env and in the uv cache, so 17 files (3.5 MB) survived. The macro now runsrd /s /q "\?\…"first, andRMDircatches anything left.3. A half-removed env bricked the next install
What #2 left behind is a
python-envwith nopyvenv.cfg. uv refuses that directory ("cannot be used because it is not a valid Python environment"), so after a reinstall GC sat on the env-setup error on every launch.resolvePythonEnvnow clears such a directory before setup (clearBrokenEnv). The directory is the shell's own. The same state can also come from a crash mid-delete.Tested (Windows, GC installer built against this branch, NVIDIA GPU)
python-env,uv-cache,python,requirements.offline.txtandwheelhousewere all removed; settings, logs and Chromium data were kept./SD IDNOdefault).clearBrokenEnvagainst a past-MAX_PATH leftover, a real venv and a missing dir. 175 pass, and the typecheck is clean.