Skip to content

feat: register Windows installs with the Python launcher - #50

Merged
linghengqian merged 1 commit into
mainfrom
feat/27-pep514-registration
Nov 13, 2026
Merged

linghengqian merged 1 commit into
mainfrom
feat/27-pep514-registration

Conversation

@linghengqian

@linghengqian linghengqian commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds opt-in PEP 514 registration for Windows Python installations, so py.exe and the Python install manager can discover Pythons installed by vfox. This implements the non-controversial part of #27: registration under vfox's own company key, without writing PythonCore or changing what py -3.12 selects.

$env:VFOX_PYTHON_REGISTER_PY_LAUNCHER = "1"
vfox install python@3.12.10
py -V:VersionFox/3.12 -c "import sys; print(sys.version)"

What changed

  • Set VFOX_PYTHON_REGISTER_PY_LAUNCHER=1 to register each Windows install under HKCU\Software\Python\VersionFox\<tag>.
  • Writes DisplayName, SysVersion, SysArchitecture, InstallPath, ExecutablePath, WindowedExecutablePath and a private VfoxManaged marker, following PEP 514.
  • Tags use the full version (3.12.10), with -32/-arm64 for non-default architectures and the existing t suffix for free-threaded builds. Multiple patch versions can coexist.
  • PreUninstall removes an entry only when it is marked as vfox-managed and still points at the version being removed; it also removes an empty VersionFox company key.
  • No default behavior change: with the variable unset, the plugin does not touch the registry.
  • English and Chinese documentation: docs/windows-launcher.md, the platform pages, the development hook contract, and plugin notes.

Why not PythonCore

PythonCore is reserved for python.org's CPython. A per-user PythonCore\<major.minor> entry would shadow an existing official installation, cannot represent multiple patch versions, and is what py -3.12 selects by design. This PR deliberately does not take over that identity. py -3.12 remains PythonCore-only; vfox-installed Pythons are selected with py -V:VersionFox/3.12 or the exact tag.

Tests

  • New offline test tests/pep514_test.lua covers opt-in parsing, tag and architecture handling, generated PowerShell, uv-build nested install prefixes, ownership checks, and failure warnings.
  • vfox plugin test . discovers it automatically, so it runs on both the Linux and Windows plugin-test jobs. It stubs os.execute and io.open, so it never writes the registry.
  • Existing offline tests and the Windows installer layout test pass.
  • stylua --check . passes, and the license check passes.

Refs #27.

@linghengqian
linghengqian force-pushed the feat/27-pep514-registration branch from 35b1087 to ffca6f4 Compare November 13, 2026 02:15
@linghengqian linghengqian added the enhancement New feature or request label Nov 13, 2026
@linghengqian
linghengqian merged commit 31b81ee into main Nov 13, 2026
12 checks passed
@linghengqian
linghengqian deleted the feat/27-pep514-registration branch November 13, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant