From fedb98b089a365d2d34c491406a8b0804f34225c 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: Sun, 28 Apr 2024 21:06:01 +0800 Subject: [PATCH] redirect --- LunaTranslator/pack.py | 13 ++++++++++++- LunaTranslator/requirements.txt | 2 +- build.py | 4 ---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/LunaTranslator/pack.py b/LunaTranslator/pack.py index d89b6212..386e1a72 100644 --- a/LunaTranslator/pack.py +++ b/LunaTranslator/pack.py @@ -10,13 +10,24 @@ if x86: downlevel=r'C:\Windows\SysWOW64\downlevel' target='LunaTranslator_x86' baddll='DLL64' + gooddll='DLL32' + py37Path = "C:\\hostedtoolcache\\windows\\Python\\3.7.9\\x86\\python.exe" + py37Pathlocal=os.environ['LOCALAPPDATA']+r'\Programs\Python\Python37-32\python.exe' + webviewappendix=r'Lib\site-packages\webviewpy\platform\win32\x86\webview.dll' else: baddll='DLL32' + gooddll='DLL64' target='LunaTranslator' launch=r'..\plugins\builds\_x64' nuitkadist=r'..\build\x64\LunaTranslator_main.dist' targetdir=r'..\build\LunaTranslator' downlevel=r'C:\Windows\system32\downlevel' + py37Path = "C:\\hostedtoolcache\\windows\\Python\\3.7.9\\x64\\python.exe" + py37Pathlocal=os.environ['LOCALAPPDATA']+r'\Programs\Python\Python37\python.exe' + webviewappendix=r'Lib\site-packages\webviewpy\platform\win32\x64\webview.dll' +if os.path.exists(py37Path)==False: + py37Path=py37Pathlocal +py37Pathwebview=os.path.join(os.path.dirname(py37Path),webviewappendix) if isdebug: targetdir+=r'_debug' target+='_debug' @@ -44,7 +55,7 @@ for f in ['LunaTranslator_admin.exe','LunaTranslator.exe']: shutil.copy(os.path.join(launch,f),targetdir) shutil.copytree(r'.\files',rf'{targetdir}\files') shutil.copy(r'..\LICENSE',targetdir) - +shutil.copy(py37Pathwebview,rf'{targetdir}\files\plugins\{gooddll}') for f in ['transoptimi','hiraparse','ocrengines','translator','cishu','tts','network','textoutput','scalemethod']: shutil.copytree(rf'.\LunaTranslator\{f}',rf'{targetdir_in}\{f}') diff --git a/LunaTranslator/requirements.txt b/LunaTranslator/requirements.txt index f68aaf8c..ffc2e788 100644 --- a/LunaTranslator/requirements.txt +++ b/LunaTranslator/requirements.txt @@ -1,6 +1,6 @@ PyQt5==5.15.10 PyQt5-Qt5==5.15.2 -webviewpy==0.0.3 +webviewpy==0.0.4 nuitka==2.0.5 imageio pefile \ No newline at end of file diff --git a/build.py b/build.py index e2c36814..b25fac36 100644 --- a/build.py +++ b/build.py @@ -81,10 +81,6 @@ def downloadcommon(): f"curl -LO https://github.com/HIllya51/RESOURCES/releases/download/common/ocr.zip" ) subprocess.run(f"7z x ocr.zip -oALL") - subprocess.run( - f"curl -LO https://github.com/HIllya51/RESOURCES/releases/download/common/webview.zip" - ) - subprocess.run(f"7z x webview.zip -oALL") subprocess.run( f"curl -LO https://github.com/HIllya51/RESOURCES/releases/download/common/magpie.zip" )