Skip to content

Fix Windows installer clean-machine Python setup#9

Merged
LuisMRaimundo merged 1 commit into
mainfrom
installer/windows-private-runtime-pr
Jun 15, 2026
Merged

Fix Windows installer clean-machine Python setup#9
LuisMRaimundo merged 1 commit into
mainfrom
installer/windows-private-runtime-pr

Conversation

@LuisMRaimundo

Copy link
Copy Markdown
Owner

Summary

Makes the Windows installer work on a clean Windows 10/11 x64 machine (no Python, Tesseract, or Poppler). Base: current main.

Root cause

The installer only worked where Python/Tesseract/Poppler already existed. The clean-machine route relied on a fragile custom-TargetDir Python install (which silently fails into repair mode when a Python already exists) and installed packages into that interpreter directly. There was no guaranteed project environment.

Fix: managed Python + project-local venv

  • Python hierarchy: detect valid existing Python (py launcher / PATH / registry / per-user locations); else Install managed Python (default) using the official python.org installer in normal per-user mode (no fragile TargetDir), then locate it.
  • Always create a project-local venv at installers/runtime/windows/venv and install requirements.txt into it.
  • Launch uses the venv Python (venv\Scripts\python.exe).
  • Custom Python is advanced-only, never default, never C:\Python; validated (3.10+, pip, tkinter) before continuing with the exact failing condition.

Wizard

Python page now has 3 explicit options: Recommended: managed, Use detected compatible Python, Advanced: custom. Managed is selected by default when no compatible Python is detected.

Policies

  • Process-local PATH by default (prepends venv\Scripts, base Python, Tesseract, Poppler); user/system PATH opt-in only.
  • Tesseract/Poppler failures are warning-only; GUI still launches. Python/tkinter/pip/packages is hard-fail.
  • gui_ready derives from venv validation, independent of OCR capability.

install_state.json

Records python_mode (managed_installed/detected_existing/custom), base_python_path, venv_python_path, packages_installed, tesseract_mode/tesseract_path, poppler_mode/poppler_bin_path, path_policy, gui_ready, ocr_capability, install_timestamp, installer_version.

Tests

  • python -m unittest discover -s tests -v -> 50 passed
  • installers\windows\tests\Run-InstallerTests.bat -> 51 passed

Manual clean-machine test

  1. On a clean Windows 10/11 x64 VM (no Python/Tesseract/Poppler), remove any old Text-seeker folder.
  2. Download this PR branch ZIP and extract to a simple path (e.g. C:\ts).
  3. Run installers\windows\Install and Run.bat.
  4. Leave Install managed Python selected; finish the wizard; click Install.
  5. Confirm the GUI opens.
  6. Run doctor:
    installers\runtime\windows\venv\Scripts\python.exe installers\common\bootstrap.py doctor
  7. Report installers\runtime\windows\install.log (and python-installer.log).

Co-authored-by: Cursor <cursoragent@cursor.com>
@LuisMRaimundo LuisMRaimundo merged commit b6c7e3e into main Jun 15, 2026
2 of 3 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