Skip to content

Conversation

@wszqkzqk
Copy link
Contributor

@wszqkzqk wszqkzqk commented Dec 10, 2025

The current pymol.bat launcher generation on Windows attempts to write relative paths to python.exe and the PyMOL module. However, when the build directory differs from the installation directory (e.g., during package repackaging for MSYS2/mingw-w64), this results in incorrect, hardcoded absolute paths that break the launcher:

"%~dp0\../../../../../../../../../M/msys64/ucrt64/bin/python.exe" "%~dp0\../../../../../../../../../M/msys64/ucrt64/lib/python3.12/site-packages/pymol/__init__.py" %*

This PR fixes the issue specifically for the mingw-w64/msys2 building and packaging by simplifying the launcher logic. Instead of computing fragile relative paths, it now uses the reliable invocation, which ensures the launcher always uses the Python interpreter adjacent to the batch file:

"%~dp0\python.exe" -m pymol %*

With the protection of if clause, it will not affect non-mingw/msys2 behavior.

Tested on my own machine.

Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
wszqkzqk added a commit to wszqkzqk/MINGW-packages that referenced this pull request Dec 10, 2025
* Backport schrodinger/pymol-open-source#487
* Prevent hardcoded paths in pymol.bat launcher

Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
wszqkzqk added a commit to wszqkzqk/MINGW-packages that referenced this pull request Dec 10, 2025
* Backport schrodinger/pymol-open-source#487
* Prevent hardcoded paths in pymol.bat launcher

Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
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.

1 participant