Skip to content

Commit

Permalink
LLBDS 安装
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingfengdev committed Aug 24, 2024
1 parent d2b71cd commit 7ba87b1
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generate-bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
else:
os.system("pip install rtoml")

os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests imageio pygithub rtoml nuitka")
os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests imageio pygithub rtoml elevate nuitka")

if os.path.exists("dist"):
shutil.rmtree("dist")
Expand Down
68 changes: 68 additions & 0 deletions src/liteloaderbds-install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import os.path
from utils import *
import subprocess
import ctypes

script_license()

print("开始安装LiteLoaderBDS!")


def install_runtime():
print("开始下载VC常用运行库")
download("https://cloud.wujiyan.cc/f/D0DIW/MSVBCRT.AIO.2024.08.16.exe", "vcruntime-install.exe")
print("下载完成")
print("开始安装VC常用运行库")
subprocess.run(["vcruntime-install.exe", "/VERYSILENT"], stdout=subprocess.PIPE, stderr=sys.stderr, check=True)
print("安装完成")
print("开始删除VC常用运行库安装文件")
os.remove("vcruntime-install.exe")
print("删除完成")


def install_lip():
print("开始下载Lip")
download("https://github.com/futrime/lip/releases/download/v0.23.2/lip-windows-amd64-setup.exe", "lip-install.exe")
print("下载完成")
print("开始安装Lip")
subprocess.run(["lip-install.exe", "/S"], stdout=subprocess.PIPE, stderr=sys.stderr, check=True)
print("安装完成")
print("开始删除Lip安装文件")
os.remove("lip-install.exe")
print("删除完成")
print("开始配置代理")
subprocess.run(["lip", "config", "GoModuleProxyURL", "https://goproxy.cn"], stdout=subprocess.PIPE,
stderr=sys.stderr, check=True)
subprocess.run(["lip", "config", "GitHubMirrorURL", "https://github.bibk.top"], stdout=subprocess.PIPE,
stderr=sys.stderr, check=True)
print("代理配置完成")


def install_levi():
install_dir = input("输入服务器的安装目录(默认为BedrockServer):")
if install_dir == "":
install_dir = "BedrockServer"
os.mkdir(install_dir)
os.chdir(install_dir)
print("开始安装服务器")
subprocess.run(["lip", "install", "github.com/LiteLDev/LeviLamina"], stdout=subprocess.PIPE, stderr=sys.stderr,
check=True)
print("安装完成")
os.chdir(os.path.pardir)


def run_admin():
if not ctypes.windll.shell32.IsUserAnAdmin():
print("请以管理员身份运行")
print("用于安装运行库和Lip")
exit_()


if __name__ == "__main__":
run_admin()
install_runtime()
install_lip()
install_levi()
print("安装完成")
print("要启动服务器,只需运行 bedrock_server_mod.exe")
exit_()
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def download(url, local_filepath):
try:
p = parse.urlparse(url)
if p.netloc == "github.com":
url = "https://github.moeyy.xyz/" + url
url = "https://mirror.ghproxy.com/" + url
with requests.get(url, stream=True, headers=headers) as r:
r.raise_for_status()
size = int(r.headers["Content-Length"])
Expand Down

0 comments on commit 7ba87b1

Please sign in to comment.