新增预编译文件

This commit is contained in:
gfdgd xi 2023-04-09 19:25:55 +08:00
parent fa8a2a0685
commit a1d61c2b65
10 changed files with 1 additions and 176 deletions

View File

@ -13,7 +13,7 @@ package:
#cd wine && make #cd wine && make
make clean -j$(nproc) make clean -j$(nproc)
cp -rv helperset deb/opt/apps/deepin-wine-runner/ cp -rv helperset deb/opt/apps/deepin-wine-runner/
cp -rv VM-source/VirtualMachine VM #cp -rv VM-source/VirtualMachine VM
cp -rv VM-source/deepin-wine-runner.svg VM cp -rv VM-source/deepin-wine-runner.svg VM
cp -rv VM-source/Windows7X64Auto.iso VM cp -rv VM-source/Windows7X64Auto.iso VM
cp -rv VM-source/Windows7X86Auto.iso VM cp -rv VM-source/Windows7X86Auto.iso VM

BIN
VM/VirtualMachine-aarch64 Executable file

Binary file not shown.

BIN
VM/VirtualMachine-loongarch64 Executable file

Binary file not shown.

BIN
VM/VirtualMachine-mips64 Executable file

Binary file not shown.

BIN
VM/VirtualMachine-ppc64el Executable file

Binary file not shown.

BIN
VM/VirtualMachine-s390x Executable file

Binary file not shown.

BIN
VM/VirtualMachine-x86_64 Executable file

Binary file not shown.

View File

@ -1,125 +0,0 @@
################################################
# 作者gfdgd xi、为什么您不喜欢熊出没和阿布呢
# 版本1.0
# 依照 GPL V3 协议开源
################################################
# 参考文献:
# https://juejin.cn/post/7080484519328874510
################################################
import os
import subprocess
homePath = os.path.expanduser('~')
programPath = os.path.split(os.path.realpath(__file__))[0]
class File:
def __init__(self, path) -> None:
self.path = path
def getFileFolderSize(self):
"""get size for file or folder"""
totalSize = 0
if not os.path.exists(self.path):
return totalSize
if os.path.isfile(self.path):
totalSize = os.path.getsize(self.path) # 5041481
return totalSize
if os.path.isdir(self.path):
with os.scandir(self.path) as dirEntryList:
for curSubEntry in dirEntryList:
curSubEntryFullPath = os.path.join(self.path, curSubEntry.name)
if curSubEntry.is_dir():
curSubFolderSize = self.path(curSubEntryFullPath) # 5800007
totalSize += curSubFolderSize
elif curSubEntry.is_file():
curSubFileSize = os.path.getsize(curSubEntryFullPath) # 1891
totalSize += curSubFileSize
return totalSize
class Manager:
def __init__(self, name: str, managerPath: str="VBoxManage") -> None:
self.name = name
self.managerPath = managerPath
self.vboxVersion = subprocess.getoutput(f"\"{self.managerPath}\" -v")
def Create(self, type: str="Windows7") -> None:
os.system(f"\"{self.managerPath}\" createvm --name \"{self.name}\" --ostype \"{type}\" --register")
def CreateDisk(self, path: str, size: int) -> None:
os.system(f"\"{self.managerPath}\" createvdi --filename \"{path}\" --size \"{size}\"")
def CreateDiskControl(self, controlName: str="storage_controller_1") -> None:
os.system(f"\"{self.managerPath}\" storagectl \"{self.name}\" --name \"{controlName}\" --add ide")
def MountDisk(self, diskPath: str, controlName: str="storage_controller_1", port: int=0, device: int=0) -> None:
os.system(f"\"{self.managerPath}\" storageattach \"{self.name}\" --storagectl \"{controlName}\" --type hdd --port {port} --device {device} --medium \"{diskPath}\"")
def MountISO(self, isoPath: str, controlName: str="storage_controller_1", port: int=1, device: int=0) -> None:
os.system(f"\"{self.managerPath}\" storageattach \"{self.name}\" --storagectl \"{controlName}\" --type dvddrive --port {port} --device {device} --medium \"{isoPath}\"")
def BootFirst(self, bootDrive: str) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --boot1 {bootDrive}")
def SetNetBridge(self, netDriver: str) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --nic1 bridged --cableconnected1 on --nictype1 82540EM --bridgeadapter1 \"{netDriver}\" --intnet1 brigh1 --macaddress1 auto")
#os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --nic1 hostif")
pass
def SetCPU(self, number: int) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --cpus {number}")
def SetMemory(self, memory: int) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --memory {memory}")
def SetRemote(self, setting: bool) -> None:
if setting:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --vrde on")
return
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --vrde off")
def SetRemoteConnectSetting(self, port: int=5540) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --vrdeport {port} --vrdeaddress """)
def Start(self, unShown: bool = False) -> None:
if unShown:
os.system(f"\"{self.managerPath}\" startvm \"{self.name}\" -type headless")
return
os.system(f"\"{self.managerPath}\" startvm \"{self.name}\"")
def Stop(self) -> None:
os.system(f"\"{self.managerPath}\" controlvm \"{self.name}\" poweroff")
def Delete(self) -> None:
os.system(f"\"{self.managerPath}\" unregistervm --delete \"{self.name}\"")
def SetDisplayMemory(self, memory: int) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --vram {memory}")
def InstallGuessAdditions(self, controlName: str="storage_controller_1", port: int=1, device: int=0) -> None:
self.MountISO("/usr/share/virtualbox/VBoxGuestAdditions.iso", controlName, port, device)
def EnabledAudio(self) -> None:
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --audio pulse --audiocontroller hda --audioin on --audioout on")
#os.system("")
def EnabledClipboardMode(self):
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --clipboard-mode bidirectional")
def EnabledDraganddrop(self):
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --draganddrop bidirectional")
def ShareFile(self, name, path):
os.system(f"\"{self.managerPath}\" sharedfolder add \"{self.name}\" -name \"{name}\" -hostpath \"{path}\"")
def SetVBoxSVGA(self):
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --graphicscontroller vboxsvga")
def SetMousePS2(self):
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --mouse usb")
def SetKeyboardPS2(self):
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --keyboard usb")
def OpenUSB(self):
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --usbohci on")
pass

View File

@ -1,50 +0,0 @@
#!/usr/bin/env python3
import os
import api
import sys
import psutil
if __name__ == "__main__":
os.system("clear")
programPath = os.path.split(os.path.realpath(__file__))[0]
if len(sys.argv) < 3 :
print("参数不齐!")
exit()
net = ""
for k, v in psutil.net_if_addrs().items():
for item in v:
if item[0] == 2 and not item[1] == "127.0.0.1" and not item[1] == "192.168.250.1":
net = k
break
if net == "":
exit()
# 创建一个叫Windows的虚拟机
vm = api.Manager("Windows")
if sys.argv[2] == "0":
vm.Create("Windows7")
elif sys.argv[2] == "1":
vm.Create("Windows7_64")
else:
vm.Create("WindowsNT_64")
vm.CreateDisk(f"{api.homePath}/VirtualBox VMs/Windows/Windows.vdi", 131072)
vm.CreateDiskControl()
vm.MountDisk(f"{api.homePath}/VirtualBox VMs/Windows/Windows.vdi")
vm.MountISO(sys.argv[1])
if sys.argv[2] == "0":
vm.MountISO(f"{programPath}/Windows7X86Auto.iso", device=1)
elif sys.argv[2] == "1":
vm.MountISO(f"{programPath}/Windows7X64Auto.iso", device=1)
vm.SetCPU(1)
vm.SetMemory(psutil.virtual_memory().total // 1024 // 1024 // 3)
vm.SetDisplayMemory(32)
vm.SetNetBridge(net)
vm.EnabledAudio()
vm.EnabledClipboardMode()
vm.EnabledDraganddrop()
vm.SetVBoxSVGA()
vm.SetMousePS2()
vm.SetKeyboardPS2()
vm.OpenUSB()
vm.ShareFile("ROOT", "/")
vm.ShareFile("HOME", api.homePath)
vm.Start()