deep-wine-runner/VM/VirtualMachine

22 lines
1003 B
Plaintext
Raw Normal View History

2023-04-09 21:12:36 +08:00
#!/usr/bin/env python3
import os
import subprocess
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
arch = subprocess.getoutput("dpkg --print-architecture").replace(" ", "").replace("\n", "")
2023-04-09 21:12:36 +08:00
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
os.system(f"{programPath}/VirtualMachine-{arch}")
exit()
2023-09-29 14:38:27 +08:00
# 判断文件是否解压
if not os.path.exists(f"{programPath}/VirtualMachine-amd64"):
# 解压文件
os.system(f"cd '{programPath}' ; tar -xvf vm.tar.gz")
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
os.system(f"{programPath}/VirtualMachine-{arch}")
exit()
2023-04-09 21:12:36 +08:00
# 只能使用 Qemu User 运行程序
if os.path.exists("/usr/lib/x86_64-linux-gnu/") and not os.system("which qemu-x86_64"):
os.system(f"qemu-x86_64 '{programPath}/VirtualMachine-x86_64'")
exit()
print("未安装环境,立即安装!")
2023-04-24 19:49:29 +08:00
os.system(f"python3 '{programPath}/../RunCommandWithTerminal.py' '{programPath}/../InstallRuntime/amd64.sh'")