diff --git a/.github/scripts/collectall_xp.py b/.github/scripts/collectall_xp.py index ddeafcd2..16245781 100644 --- a/.github/scripts/collectall_xp.py +++ b/.github/scripts/collectall_xp.py @@ -1,9 +1,10 @@ import shutil, os import platform import sys - +os.system('python generate_xp_code.py') os.system("git clone https://github.com/HIllya51/py3.4_pyqt5.5.1") -os.rename("py3.4_pyqt5.5.1", "runtime") +os.rename("py3.4_pyqt5.5.1/Python34", "runtime") + targetdir = r"build\LunaTranslator_x86_winxp" launch = r"..\cpp\builds\_x86" baddll = "DLL64" diff --git a/cpp/exec/PyStand.cpp b/cpp/exec/PyStand.cpp index eccd869f..df5e1d1e 100644 --- a/cpp/exec/PyStand.cpp +++ b/cpp/exec/PyStand.cpp @@ -182,6 +182,11 @@ int PyStand::RunString(const wchar_t *script) { _py_args.push_back((wchar_t *)_py_argv[i].c_str()); } + +#ifdef WINXP + auto Py_SetPath = (void (*)(const wchar_t *))GetProcAddress(_hDLL, "Py_SetPath"); + Py_SetPath(L"./files/runtime/Lib;./files/runtime/DLLs;./files/runtime/Lib/site-packages"); +#endif hr = _Py_Main((int)_py_args.size(), &_py_args[0]); return hr; } diff --git a/py/generate_xp_code.py b/py/generate_xp_code.py index e4989d6c..1bbc8f3c 100644 --- a/py/generate_xp_code.py +++ b/py/generate_xp_code.py @@ -11,7 +11,7 @@ def parsecode(code: str): code = code.replace("self.screen().geometry().height()", "99999") code = code.replace( '"./files/runtime/PyQt5/Qt5/plugins"', - r'"C:\Python34\Lib\site-packages\PyQt5\plugins"', + '"./files/runtime/Lib/site-packages/PyQt5/plugins"', ) code = code.replace("self.parent().devicePixelRatioF()", "1") code = code.replace("self.devicePixelRatioF()", "1")