Skip to content
  • Matt Harbison's avatar
    exewrapper: find the proper python3X.dll in the registry · 67d14d4e036c
    Matt Harbison authored
    Previously, we relied on the default library lookup[1], which for us is
    essentially to look on `PATH`.  That has issues- the Python installations are
    not necessarily on `PATH`, so I started copying the DLLs locally in 2960b7fac966
    and ed286d150aa8 during the build to work around that.  However, it's been
    discovered that causes `python3.dll` and `python3X.dll` to get slipped into the
    wheel that gets distributed on PyPI.  Additionally, Mercurial would fail to run
    in a venv if the Python environment that created it isn't on `PATH`, because
    venv creation doesn't copy the DLLs locally.
    
    The logic here is inspired by the `py.exe` launcher[2], though this is simpler
    because we don't care about the architecture- if this is a 32 bit process
    running on Win64, the registry reflection will redirect to where the 32 bit
    Python process wrote its keys.  A nice unintended side effect is to also make
    venvs that don't have their root Python on `PATH` work without all ...
    67d14d4e036c