From 1748e5f8a19802db3b3cfba98578833dad3aba3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Tue, 25 Jun 2024 03:01:20 +0800 Subject: [PATCH] auto --- LunaTranslator/retrieval.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/LunaTranslator/retrieval.py b/LunaTranslator/retrieval.py index 95e08ddc..b3123fb5 100644 --- a/LunaTranslator/retrieval.py +++ b/LunaTranslator/retrieval.py @@ -1,5 +1,6 @@ import modulefinder, shutil, os, sys, pefile import builtins, platform +import sys pyversion = platform.python_version() pyversion2 = "".join(pyversion.split(".")[:2]) @@ -12,11 +13,7 @@ if x86: launch = r"..\plugins\builds\_x86" baddll = "DLL64" gooddll = "DLL32" - py37Path = f"C:\\hostedtoolcache\\windows\\Python\\{pyversion}\\x86\\python.exe" - py37Pathlocal = ( - os.environ["LOCALAPPDATA"] - + rf"\Programs\Python\Python{pyversion2}-32\python.exe" - ) + webviewappendix = r"Lib\site-packages\webviewpy\platform\win32\x86\webview.dll" else: baddll = "DLL32" @@ -26,14 +23,10 @@ else: targetdir = r"..\build\LunaTranslator" downlevel = r"C:\Windows\system32\downlevel" - py37Path = f"C:\\hostedtoolcache\\windows\\Python\\{pyversion}\\x64\\python.exe" - py37Pathlocal = ( - os.environ["LOCALAPPDATA"] + rf"\Programs\Python\Python{pyversion2}\python.exe" - ) webviewappendix = r"Lib\site-packages\webviewpy\platform\win32\x64\webview.dll" -if os.path.exists(py37Path) == False: - py37Path = py37Pathlocal -py37Path = os.path.dirname(py37Path) + +py37Path = sys.executable +print(py37Path) py37Pathwebview = os.path.join(py37Path, webviewappendix)