This commit is contained in:
恍兮惚兮 2024-11-15 04:48:32 +08:00
parent cfd96256fc
commit b79dfb22ab
3 changed files with 9 additions and 3 deletions

View File

@ -1,9 +1,10 @@
import shutil, os import shutil, os
import platform import platform
import sys import sys
os.system('python generate_xp_code.py')
os.system("git clone https://github.com/HIllya51/py3.4_pyqt5.5.1") 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" targetdir = r"build\LunaTranslator_x86_winxp"
launch = r"..\cpp\builds\_x86" launch = r"..\cpp\builds\_x86"
baddll = "DLL64" baddll = "DLL64"

View File

@ -182,6 +182,11 @@ int PyStand::RunString(const wchar_t *script)
{ {
_py_args.push_back((wchar_t *)_py_argv[i].c_str()); _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]); hr = _Py_Main((int)_py_args.size(), &_py_args[0]);
return hr; return hr;
} }

View File

@ -11,7 +11,7 @@ def parsecode(code: str):
code = code.replace("self.screen().geometry().height()", "99999") code = code.replace("self.screen().geometry().height()", "99999")
code = code.replace( code = code.replace(
'"./files/runtime/PyQt5/Qt5/plugins"', '"./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.parent().devicePixelRatioF()", "1")
code = code.replace("self.devicePixelRatioF()", "1") code = code.replace("self.devicePixelRatioF()", "1")