From 4427d286139227a15e226d9954f5877fd7578bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Sat, 9 Nov 2024 12:24:31 +0800 Subject: [PATCH] build --- .github/scripts/build_lunahook.py | 15 --------------- .github/scripts/packlunahook.py | 11 ++++++----- .gitignore | 2 ++ cpp/LunaHook/scripts/build32xp_local.bat | 4 ++-- cpp/LunaHook/scripts/buildxpen.bat | 3 --- cpp/LunaHook/scripts/edit_target.py | 9 ++++++++- 6 files changed, 18 insertions(+), 26 deletions(-) delete mode 100644 cpp/LunaHook/scripts/buildxpen.bat diff --git a/.github/scripts/build_lunahook.py b/.github/scripts/build_lunahook.py index 8e2c3fc1..9d28b04c 100644 --- a/.github/scripts/build_lunahook.py +++ b/.github/scripts/build_lunahook.py @@ -34,25 +34,12 @@ if len(sys.argv) and sys.argv[1] == "merge": rf'"C:\Program Files\7-Zip\7z.exe" a -m0=Deflate -mx9 {target} {targetdir}' ) exit() -vcltlFile = "https://github.com/Chuyu-Team/VC-LTL5/releases/download/v5.0.9/VC-LTL-5.0.9-Binary.7z" -vcltlFileName = "VC-LTL-5.0.9-Binary.7z" - print(sys.version) print(__file__) print(rootDir) -def installVCLTL(): - os.chdir(rootDir) - if os.path.exists("temp"): - return # already installed - os.makedirs(rootDir + "\\temp", exist_ok=True) - subprocess.run(f"curl -Lo temp\\{vcltlFileName} {vcltlFile}") - subprocess.run(f"7z x temp\\{vcltlFileName} -otemp\\VC-LTL5") - subprocess.run("cmd /c temp\\VC-LTL5\\Install.cmd") - - def build_langx(lang, bit, onlycore): config = ( f"-DBUILD_PLUGIN=OFF -DWINXP=OFF -DLANGUAGE={lang} -DBUILD_GUI=ON -DBUILD_CLI=ON" @@ -95,8 +82,6 @@ call dobuildxp.bat ) os.system(f"cmd /c do.bat") - -# installVCLTL() os.chdir(os.path.join(rootDir, "scripts")) if sys.argv[1] == "plg32": os.system(f"cmd /c buildplugin32.bat") diff --git a/.github/scripts/packlunahook.py b/.github/scripts/packlunahook.py index 12807538..caa615d6 100644 --- a/.github/scripts/packlunahook.py +++ b/.github/scripts/packlunahook.py @@ -7,11 +7,12 @@ if not rootDir: rootDir=os.path.abspath(os.path.join(rootDir,'../../cpp/LunaHook')) os.chdir(rootDir) -for f in os.listdir("builds"): - if os.path.isdir("builds/" + f) == False: +os.chdir('./builds') +for f in os.listdir("."): + if os.path.isdir("./" + f) == False: continue - for dirname, _, fs in os.walk("builds/" + f): + for dirname, _, fs in os.walk("./" + f): if ( dirname.endswith("translations") or dirname.endswith("translations") @@ -31,8 +32,8 @@ for f in os.listdir("builds"): "D3Dcompiler_47.dll", ]: os.remove(path) - targetdir = "builds/" + f - target = "builds/" + f + ".zip" + targetdir = "./" + f + target = "./" + f + ".zip" os.system( rf'"C:\Program Files\7-Zip\7z.exe" a -m0=Deflate -mx9 {target} {targetdir}' ) diff --git a/.gitignore b/.gitignore index abd0340e..462e0aa9 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ cpp/libs/onnxruntime-static.zip cpp/libs/onnxruntime-static/onnxruntime-static.7z cpp/libs/opencv-static/opencv-static.7z cpp/LunaHook/.vscode/settings.json +cpp/LunaHook/YY-Thunks +cpp/LunaHook/scripts/YY-Thunks-1.0.7-Binary.zip diff --git a/cpp/LunaHook/scripts/build32xp_local.bat b/cpp/LunaHook/scripts/build32xp_local.bat index d7c9b542..b6097407 100644 --- a/cpp/LunaHook/scripts/build32xp_local.bat +++ b/cpp/LunaHook/scripts/build32xp_local.bat @@ -1,3 +1,3 @@ -cmake -DBUILD_PLUGIN=OFF -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_xp -cmake -DBUILD_PLUGIN=OFF -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh_xp +cmake -DBUILD_PLUGIN=OFF -DBUILD_GUI=ON -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_xp +@REM cmake -DBUILD_PLUGIN=OFF -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh_xp call dobuildxp.bat \ No newline at end of file diff --git a/cpp/LunaHook/scripts/buildxpen.bat b/cpp/LunaHook/scripts/buildxpen.bat deleted file mode 100644 index ca5d6349..00000000 --- a/cpp/LunaHook/scripts/buildxpen.bat +++ /dev/null @@ -1,3 +0,0 @@ -cmake -DBUILD_PLUGIN=OFF -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp -cmake --build ../build/x86_xp --config Release --target ALL_BUILD -j 14 -call dobuildxp.bat \ No newline at end of file diff --git a/cpp/LunaHook/scripts/edit_target.py b/cpp/LunaHook/scripts/edit_target.py index 60ea6e82..c5330ab7 100644 --- a/cpp/LunaHook/scripts/edit_target.py +++ b/cpp/LunaHook/scripts/edit_target.py @@ -10,4 +10,11 @@ for f in ['../build/x86_zh_xp','../build/x86_xp']: file=pf.read() file=file.replace('>v143<','>v141_xp<') with open(path,'w',encoding='utf-8-sig') as pf: - pf.write(file) \ No newline at end of file + pf.write(file) + + +url = "https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.0.7/YY-Thunks-1.0.7-Binary.zip" +target = "../YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj" +if os.path.exists(target) == False: + os.system(rf"curl -SLo YY-Thunks-1.0.7-Binary.zip " + url) + os.system(rf"7z x -y YY-Thunks-1.0.7-Binary.zip -o../YY-Thunks") \ No newline at end of file