mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2026-04-04 22:50:24 +08:00
3.2.1基本完成
This commit is contained in:
33
deb/opt/apps/deepin-wine-runner/VM/StartQemu.py
Normal file
33
deb/opt/apps/deepin-wine-runner/VM/StartQemu.py
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import traceback
|
||||
|
||||
def ReadTXT(file: str):
|
||||
with open(file, "r") as file:
|
||||
things = file.read()
|
||||
return things
|
||||
|
||||
# 运行
|
||||
command = "qemu-system-x86_64"
|
||||
#if "--kvm" in sys.argv:
|
||||
# command = "kvm"
|
||||
|
||||
homePath = os.path.expanduser('~')
|
||||
try:
|
||||
setting = json.loads(ReadTXT(f"{homePath}/.config/deepin-wine-runner/QemuSetting.json"))
|
||||
except:
|
||||
print("无法读取配置")
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
option = f"-nic model=rtl8139 --hda \"$HOME/Qemu/Windows/Windows.qcow2\" -usb -m {setting['Memory']}M -smp {setting['CPU']} "
|
||||
if setting["EnableKVM"]:
|
||||
command = "kvm"
|
||||
if setting["EnableRDP"]:
|
||||
option += "-net user,hostfwd=tcp::3389-:3389 "
|
||||
if setting["EnableVNC"]:
|
||||
option += f"-display gtk -display vnc=:{setting['VNC']} "
|
||||
if setting["EnableSound"]:
|
||||
option += "-soundhw all "
|
||||
os.system(f"{command} {option}")
|
||||
@@ -11,4 +11,4 @@ if os.path.exists("/usr/lib/x86_64-linux-gnu/") and not os.system("which qemu-x8
|
||||
os.system(f"qemu-x86_64 '{programPath}/VirtualMachine-x86_64'")
|
||||
exit()
|
||||
print("未安装环境,立即安装!")
|
||||
os.system(f"python3 '{programPath}/../RunCommandWithTerminal.py' '{programPath}/../InstallRuntime/amd64.sh'")
|
||||
os.system(f"python3 '{programPath}/../RunCommandWithTerminal.py' '{programPath}/../InstallRuntime/amd64.sh'")
|
||||
|
||||
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-armv7l
Executable file
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-armv7l
Executable file
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-i686
Executable file
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-i686
Executable file
Binary file not shown.
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-mips
Executable file
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-mips
Executable file
Binary file not shown.
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-ppc
Executable file
BIN
deb/opt/apps/deepin-wine-runner/VM/VirtualMachine-ppc
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user