开始外观修改
9
RunVM.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
cd `dirname $0`
|
||||
which VBoxManage
|
||||
if test $? == 0 ; then
|
||||
VM/VirtualMachine
|
||||
exit
|
||||
fi
|
||||
echo 未安装 VirtualBox,开始安装,安装结束重新运行即可
|
||||
./launch.sh deepin-terminal -C "pkexec apt install virtualbox-6.1 -y && zenity --info --text=\"安装完毕,关闭此对话框和安装终端重新运行程序即可\" --no-wrap" --keep-open
|
24
VM-source/.qmake.stash
Normal file
@ -0,0 +1,24 @@
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 8
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3
|
||||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_GCC_MAJOR_VERSION \
|
||||
QMAKE_GCC_MINOR_VERSION \
|
||||
QMAKE_GCC_PATCH_VERSION
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
/usr/include/c++/8 \
|
||||
/usr/include/x86_64-linux-gnu/c++/8 \
|
||||
/usr/include/c++/8/backward \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/8/include \
|
||||
/usr/local/include \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed \
|
||||
/usr/include/x86_64-linux-gnu \
|
||||
/usr/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/8 \
|
||||
/usr/lib/x86_64-linux-gnu \
|
||||
/usr/lib \
|
||||
/lib/x86_64-linux-gnu \
|
||||
/lib
|
88
VM-source/ISO/Autounattend-x64.xml
Executable file
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="windowsPE">
|
||||
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<SetupUILanguage>
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
</SetupUILanguage>
|
||||
<InputLocale>zh-CN</InputLocale>
|
||||
<SystemLocale>zh-CN</SystemLocale>
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
<UserLocale>zh-CN</UserLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UserData>
|
||||
<ProductKey>
|
||||
<Key />
|
||||
</ProductKey>
|
||||
<AcceptEula>true</AcceptEula>
|
||||
</UserData>
|
||||
<ImageInstall>
|
||||
<OSImage>
|
||||
<InstallFrom>
|
||||
<MetaData wcm:action="add">
|
||||
<Key>/image/index</Key>
|
||||
<Value>4</Value>
|
||||
</MetaData>
|
||||
</InstallFrom>
|
||||
<InstallTo>
|
||||
<DiskID>0</DiskID>
|
||||
<PartitionID>1</PartitionID>
|
||||
</InstallTo>
|
||||
</OSImage>
|
||||
</ImageInstall>
|
||||
<DiskConfiguration>
|
||||
<Disk wcm:action="add">
|
||||
<CreatePartitions>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<Size>130000</Size>
|
||||
<Type>Primary</Type>
|
||||
</CreatePartition>
|
||||
</CreatePartitions>
|
||||
<DiskID>0</DiskID>
|
||||
<WillWipeDisk>true</WillWipeDisk>
|
||||
<ModifyPartitions>
|
||||
<ModifyPartition wcm:action="add">
|
||||
<Active>true</Active>
|
||||
<Extend>false</Extend>
|
||||
<Format>NTFS</Format>
|
||||
<Label>OS</Label>
|
||||
<Letter>C</Letter>
|
||||
<Order>1</Order>
|
||||
<PartitionID>1</PartitionID>
|
||||
</ModifyPartition>
|
||||
</ModifyPartitions>
|
||||
</Disk>
|
||||
</DiskConfiguration>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UserAccounts>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Password>
|
||||
<Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
<DisplayName>Windows</DisplayName>
|
||||
<Group>Administrators</Group>
|
||||
<Name>Windows</Name>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<OOBE>
|
||||
<NetworkLocation>Work</NetworkLocation>
|
||||
<ProtectYourPC>3</ProtectYourPC>
|
||||
</OOBE>
|
||||
<TimeZone>China Standard Time</TimeZone>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="specialize">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ComputerName>*</ComputerName>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
||||
</unattend>
|
85
VM-source/ISO/Autounattend.xml.zip
Executable file
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="windowsPE">
|
||||
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<SetupUILanguage>
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
</SetupUILanguage>
|
||||
<InputLocale>zh-CN</InputLocale>
|
||||
<SystemLocale>zh-CN</SystemLocale>
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
<UserLocale>zh-CN</UserLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UserData>
|
||||
<AcceptEula>true</AcceptEula>
|
||||
</UserData>
|
||||
<ImageInstall>
|
||||
<OSImage>
|
||||
<InstallFrom>
|
||||
<MetaData wcm:action="add">
|
||||
<Value>5</Value>
|
||||
<Key>/image/index</Key>
|
||||
</MetaData>
|
||||
</InstallFrom>
|
||||
<InstallTo>
|
||||
<DiskID>0</DiskID>
|
||||
<PartitionID>1</PartitionID>
|
||||
</InstallTo>
|
||||
</OSImage>
|
||||
</ImageInstall>
|
||||
<DiskConfiguration>
|
||||
<Disk wcm:action="add">
|
||||
<CreatePartitions>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Type>Primary</Type>
|
||||
<Order>1</Order>
|
||||
<Size>130000</Size>
|
||||
</CreatePartition>
|
||||
</CreatePartitions>
|
||||
<WillWipeDisk>true</WillWipeDisk>
|
||||
<DiskID>0</DiskID>
|
||||
<ModifyPartitions>
|
||||
<ModifyPartition wcm:action="add">
|
||||
<Active>true</Active>
|
||||
<Extend>false</Extend>
|
||||
<Format>NTFS</Format>
|
||||
<Label>OS</Label>
|
||||
<Letter>C</Letter>
|
||||
<Order>1</Order>
|
||||
<PartitionID>1</PartitionID>
|
||||
</ModifyPartition>
|
||||
</ModifyPartitions>
|
||||
</Disk>
|
||||
</DiskConfiguration>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UserAccounts>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Password>
|
||||
<Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
<DisplayName>Windows</DisplayName>
|
||||
<Group>Administrators</Group>
|
||||
<Name>Windows</Name>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<OOBE>
|
||||
<NetworkLocation>Work</NetworkLocation>
|
||||
<ProtectYourPC>3</ProtectYourPC>
|
||||
</OOBE>
|
||||
<TimeZone>China Standard Time</TimeZone>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="specialize">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ComputerName>*</ComputerName>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage cpi:source="wim:l:/xiayuhao/system-iso/windows-iso/windows-7/windows-7-sp1-x86/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
||||
</unattend>
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
BIN
VM-source/VirtualMachine
Executable file
BIN
VM-source/Windows7X64Auto.iso
Normal file
BIN
VM-source/Windows7X86Auto.iso
Normal file
125
VM-source/api/__init__.py
Normal file
@ -0,0 +1,125 @@
|
||||
################################################
|
||||
# 作者: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
|
BIN
VM-source/api/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
VM-source/icon.png
Executable file
After Width: | Height: | Size: 35 KiB |
50
VM-source/run.py
Executable file
@ -0,0 +1,50 @@
|
||||
#!/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()
|
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 190 KiB After Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
Before Width: | Height: | Size: 190 KiB After Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 219 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 1006 KiB After Width: | Height: | Size: 1006 KiB |
Before Width: | Height: | Size: 428 KiB After Width: | Height: | Size: 428 KiB |
177
demo1.py
Normal file
@ -0,0 +1,177 @@
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
|
||||
root = tk.Tk()
|
||||
root.title("wine运行器1.6.0")
|
||||
#root.geometry("1275x900")
|
||||
|
||||
frame_up = tk.Frame(root)
|
||||
|
||||
frame_left = tk.Frame(frame_up)#快速启动区
|
||||
frame_left.config(bd=30)
|
||||
#
|
||||
frame_left_1 = tk.Frame(frame_left)#左侧标题
|
||||
left_title = tk.Label(frame_left_1,text="快速启动")
|
||||
left_title.config(font=("幼圆",24))
|
||||
left_title.pack(anchor="w")
|
||||
frame_left_1.grid(row=0,sticky="w" + "e")
|
||||
#
|
||||
frame_left_2 = tk.Frame(frame_left)#容器路径
|
||||
##
|
||||
label_l_1 = tk.Label(frame_left_2,text="请选择容器的路径:")
|
||||
label_l_1.config(font=("幼圆",16))
|
||||
label_l_1.grid(row=0,column=0,sticky='w')
|
||||
##
|
||||
combo_l_1 = ttk.Combobox(frame_left_2, width=50)
|
||||
combo_l_1.grid(row=1,column=0)
|
||||
##
|
||||
button_l_1 = tk.Button(frame_left_2,text="浏览")
|
||||
button_l_1.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_l_1.grid(row=1,column=1)
|
||||
##
|
||||
frame_left_2.grid(row=1)
|
||||
#
|
||||
frame_left_3 = tk.Frame(frame_left)#程序路径
|
||||
label_l_2 = tk.Label(frame_left_3,text="请选择待执行程序:")
|
||||
label_l_2.config(font=("幼圆",16))
|
||||
label_l_2.grid(row=0,column=0,sticky='w')
|
||||
##
|
||||
combo_l_2 = ttk.Combobox(frame_left_3, width=50)
|
||||
combo_l_2.grid(row=1,column=0)
|
||||
##
|
||||
button_l_2 = tk.Button(frame_left_3,text="浏览")
|
||||
button_l_2.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_l_2.grid(row=1,column=1)
|
||||
##
|
||||
frame_left_3.grid(row=2)
|
||||
#
|
||||
frame_left_4 = tk.Frame(frame_left)#wine的版本
|
||||
##
|
||||
label_l_3 = tk.Label(frame_left_4,text="请选择wine的版本")
|
||||
label_l_3.config(font=("幼圆",16))
|
||||
label_l_3.grid(row=0,column=0,sticky='w')
|
||||
##
|
||||
OptionList = ["deppin-wine5","wine"]
|
||||
variable = tk.StringVar(frame_left_4)
|
||||
variable.set(OptionList[0])
|
||||
choose_1 = tk.OptionMenu(frame_left_4,variable,*OptionList)
|
||||
choose_1.grid(row=1,column=0)
|
||||
##
|
||||
label_l_4 = tk.Label(frame_left_4,text=" "*4)#占位用字符串
|
||||
label_l_4.grid(row=1,column=1)
|
||||
##
|
||||
button_l_3 = tk.Button(frame_left_4,text="运行程序")
|
||||
button_l_3.config(font=("幼圆",12),padx=21,pady=3)
|
||||
button_l_3.grid(row=1,column=2)
|
||||
##
|
||||
label_l_5 = tk.Label(frame_left_4,text=" "*13)#占位用字符串
|
||||
label_l_5.grid(row=1,column=3)
|
||||
##
|
||||
button_l_4 = tk.Button(frame_left_4,text="终止程序")
|
||||
button_l_4.config(font=("幼圆",12),padx=21,pady=3)
|
||||
button_l_4.grid(row=1,column=4)
|
||||
##
|
||||
frame_left_4.grid(row=3)
|
||||
#
|
||||
frame_left.grid(row=0,column=0)#第一行第一列
|
||||
|
||||
frame_right = tk.Frame(frame_up)#高级配置区
|
||||
frame_right.config(bd=30)
|
||||
#
|
||||
frame_right_1 = tk.Frame(frame_right)
|
||||
right_title = tk.Label(frame_right_1,text="高级功能")
|
||||
right_title.config(font=("幼圆",24))
|
||||
right_title.pack(anchor="w")
|
||||
frame_right_1.grid(row=0,sticky="w" + "e")
|
||||
#
|
||||
frame_right_2 = tk.Frame(frame_right)
|
||||
##
|
||||
label_r_1 = tk.Label(frame_right_2,text="创建快捷方式(Desktop文件):")
|
||||
label_r_1.config(font=("幼圆",16))
|
||||
label_r_1.grid(row=0,column=0)
|
||||
##
|
||||
frame_right_2.grid(row=1,sticky='w')
|
||||
#
|
||||
frame_right_3 = tk.Frame(frame_right)
|
||||
##
|
||||
label_r_2 = tk.Label(frame_right_3,text="名称:")
|
||||
label_r_2.config(font=("幼圆",14))
|
||||
label_r_2.grid(row=0,column=0)
|
||||
##
|
||||
entry1 = tk.Entry(frame_right_3,width=15)
|
||||
entry1.grid(row=0,column=1)
|
||||
##
|
||||
empty1 = tk.Label(frame_right_3,text=" "*5)
|
||||
empty1.grid(row=0,column=2)
|
||||
##
|
||||
button_r_1 = tk.Button(frame_right_3,text="创建到桌面")
|
||||
button_r_1.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_r_1.grid(row=0,column=3)
|
||||
##
|
||||
empty2 = tk.Label(frame_right_3,text=" "*5)
|
||||
empty2.grid(row=0,column=4)
|
||||
##
|
||||
button_r_2 = tk.Button(frame_right_3,text="创建到开始菜单")
|
||||
button_r_2.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_r_2.grid(row=0,column=5)
|
||||
##
|
||||
frame_right_3.grid(row=2,sticky='w')
|
||||
#
|
||||
frame_right_4 = tk.Frame(frame_right)
|
||||
##
|
||||
label_r_2 = tk.Label(frame_right_4,text="管理该程序:")
|
||||
label_r_2.config(font=("幼圆",16))
|
||||
label_r_2.grid(row=0,column=0)
|
||||
##
|
||||
frame_right_4.grid(row=3,sticky='w')
|
||||
#
|
||||
frame_right_5 = tk.Frame(frame_right)
|
||||
##
|
||||
button_r_3 = tk.Button(frame_right_5,text="卸载程序")
|
||||
button_r_3.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_r_3.grid(column=0)
|
||||
##
|
||||
empty3 = tk.Label(frame_right_5,text=" "*5)
|
||||
empty3.grid(row=0,column=1)
|
||||
##
|
||||
button_r_4 = tk.Button(frame_right_5,text="提取图标")
|
||||
button_r_4.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_r_4.grid(row=0,column=2)
|
||||
##
|
||||
frame_right_5.grid(row=4,sticky='w')
|
||||
#
|
||||
frame_right_6 = tk.Frame(frame_right)
|
||||
##
|
||||
label_r_3 = tk.Label(frame_right_6,text="管理该wine")
|
||||
label_r_3.config(font=("幼圆",16))
|
||||
label_r_3.grid(row=0,column=0)
|
||||
##
|
||||
frame_right_6.grid(row=5,sticky='w')
|
||||
#
|
||||
frame_right_7 = tk.Frame(frame_right)
|
||||
##
|
||||
button_r_5 = tk.Button(frame_right_7,text="配置容器")
|
||||
button_r_5.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_r_5.grid(row=0,column=0)
|
||||
##
|
||||
empty4 = tk.Label(frame_right_7,text=" "*5)
|
||||
empty4.grid(row=0,column=1)
|
||||
##
|
||||
button_r_6 = tk.Button(frame_right_7,text="安装字体")
|
||||
button_r_6.config(font=("幼圆",12),padx=20,pady=3)
|
||||
button_r_6.grid(row=0,column=2)
|
||||
##
|
||||
frame_right_7.grid(row=6,sticky='w')
|
||||
#
|
||||
frame_right.grid(row=0,column=1,sticky='n')#第一行第二列
|
||||
|
||||
frame_up.grid(row=0,sticky='w')
|
||||
|
||||
frame_down = tk.Frame(root,bd=30)
|
||||
returnText = tk.Text(frame_down,width=120)
|
||||
returnText.insert("end", "此可以查看到 Wine 应用安装时的程序返回值")
|
||||
returnText.config(state=tk.DISABLED)
|
||||
returnText.grid(row=0,column=0,sticky='e'+'w')
|
||||
frame_down.grid(row=1,sticky='w')
|
||||
|
||||
root.mainloop()
|
@ -506,6 +506,9 @@ def GetScreenSize():
|
||||
def UOSPackageScript():
|
||||
threading.Thread(target=os.system, args=[f"python3 '{programPath}/deepin-wine-packager-with-script.py'"]).start()
|
||||
|
||||
def RunVM():
|
||||
threading.Thread(target=os.system, args=[f"bash '{programPath}/RunVM.sh'"]).start()
|
||||
|
||||
class UpdateWindow():
|
||||
data = {}
|
||||
def ShowWindow():
|
||||
@ -1094,7 +1097,7 @@ frame_right.grid(row=0,column=1,sticky='n')#第一行第二列
|
||||
frame_up.grid(row=0,sticky='w')
|
||||
|
||||
frame_down = tk.Frame(win,bd=30)
|
||||
returnText = tk.Text(frame_down,width=120)
|
||||
returnText = tk.Text(frame_down,width=120, height=15)
|
||||
returnText.insert("end", "此可以查看到 Wine 应用安装时的程序返回值")
|
||||
returnText.config(state=tk.DISABLED)
|
||||
returnText.grid(row=0,column=0,sticky='e'+'w')
|
||||
@ -1152,6 +1155,9 @@ winbind = tk.Menu()
|
||||
winbind.add_command(label="安装 winbind", command=lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt install winbind -y' --keep-open"))
|
||||
winbind.add_command(label="卸载 winbind", command=lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt purge winbind -y' --keep-open"))
|
||||
wineOption.add_cascade(label="安装/卸载 winbind", menu=winbind)
|
||||
virtualMachine = tk.Menu(menu, tearoff=0, background="white")
|
||||
menu.add_cascade(label="虚拟机", menu=virtualMachine)
|
||||
virtualMachine.add_command(label="使用 Virtualbox 虚拟机运行 Windows 应用", command=RunVM)
|
||||
safeWebsize = tk.Menu(menu, tearoff=0, background="white")
|
||||
menu.add_cascade(label="云沙箱", menu=safeWebsize)
|
||||
safeWebsize.add_command(label="360 沙箱云", command=lambda: webbrowser.open_new_tab("https://ata.360.net/"))
|
||||
@ -1189,6 +1195,7 @@ wineDefultMenu.configure(activebackground="dodgerblue")
|
||||
wineInstall.configure(activebackground="dodgerblue")
|
||||
opengl.configure(activebackground="dodgerblue")
|
||||
winbind.configure(activebackground="dodgerblue")
|
||||
virtualMachine.configure(activebackground="dodgerblue")
|
||||
safeWebsize.configure(activebackground="dodgerblue")
|
||||
moreProgram.configure(activebackground="dodgerblue")
|
||||
help.configure(activebackground="dodgerblue")
|
||||
|
8
main.py
@ -506,6 +506,9 @@ def GetScreenSize():
|
||||
def UOSPackageScript():
|
||||
threading.Thread(target=os.system, args=[f"python3 '{programPath}/deepin-wine-packager-with-script.py'"]).start()
|
||||
|
||||
def RunVM():
|
||||
threading.Thread(target=os.system, args=[f"bash '{programPath}/RunVM.sh'"]).start()
|
||||
|
||||
class UpdateWindow():
|
||||
data = {}
|
||||
def ShowWindow():
|
||||
@ -1000,6 +1003,9 @@ winbind = tk.Menu()
|
||||
winbind.add_command(label="安装 winbind", command=lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt install winbind -y' --keep-open"))
|
||||
winbind.add_command(label="卸载 winbind", command=lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt purge winbind -y' --keep-open"))
|
||||
wineOption.add_cascade(label="安装/卸载 winbind", menu=winbind)
|
||||
virtualMachine = tk.Menu(menu, tearoff=0, background="white")
|
||||
menu.add_cascade(label="虚拟机", menu=virtualMachine)
|
||||
virtualMachine.add_command(label="使用 Virtualbox 虚拟机运行 Windows 应用", command=RunVM)
|
||||
safeWebsize = tk.Menu(menu, tearoff=0, background="white")
|
||||
menu.add_cascade(label="云沙箱", menu=safeWebsize)
|
||||
safeWebsize.add_command(label="360 沙箱云", command=lambda: webbrowser.open_new_tab("https://ata.360.net/"))
|
||||
@ -1007,7 +1013,6 @@ safeWebsize.add_command(label="微步云沙箱", command=lambda: webbrowser.open
|
||||
safeWebsize.add_command(label="VIRUSTOTAL", command=lambda: webbrowser.open_new_tab("https://www.virustotal.com/"))
|
||||
|
||||
help = tk.Menu(menu, tearoff=0, background="white") # 设置“帮助”菜单栏
|
||||
|
||||
menu.add_cascade(label="帮助", menu=help)
|
||||
help.add_command(label="程序官网", command=OpenProgramURL) # 设置“程序官网”项
|
||||
help.add_separator()
|
||||
@ -1036,6 +1041,7 @@ wineDefultMenu.configure(activebackground="dodgerblue")
|
||||
wineInstall.configure(activebackground="dodgerblue")
|
||||
opengl.configure(activebackground="dodgerblue")
|
||||
winbind.configure(activebackground="dodgerblue")
|
||||
virtualMachine.configure(activebackground="dodgerblue")
|
||||
safeWebsize.configure(activebackground="dodgerblue")
|
||||
moreProgram.configure(activebackground="dodgerblue")
|
||||
help.configure(activebackground="dodgerblue")
|
||||
|