LunaHook-mirror/build.py

36 lines
1.1 KiB
Python
Raw Normal View History

2024-04-26 16:45:45 +08:00
import os, sys
2024-04-26 11:13:32 +08:00
import subprocess
rootDir = os.path.dirname(__file__)
2024-04-26 19:20:31 +08:00
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"
2024-04-26 19:06:02 +08:00
2024-04-26 19:20:31 +08:00
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")
2024-04-26 19:06:02 +08:00
2024-04-26 19:20:31 +08:00
if sys.argv[1]=='pack':
2024-04-26 19:06:02 +08:00
os.chdir(os.path.join(rootDir, "scripts"))
os.system(f"python pack.py pack")
2024-04-26 19:20:31 +08:00
else:
installVCLTL()
2024-04-26 19:06:02 +08:00
os.chdir(os.path.join(rootDir, "scripts"))
2024-04-26 19:20:31 +08:00
if sys.argv[1]=='plg32':
os.system(f"cmd /c buildplugin32.bat")
elif sys.argv[1]=='plg64':
os.system(f"cmd /c buildplugin64.bat")
elif sys.argv[1]=='en':
os.system(f"cmd /c builden.bat")
elif sys.argv[1]=='zh':
os.system(f"cmd /c buildzh.bat")
elif sys.argv[1]=='xp':
os.system(f"cmd /c build32xp.bat")