diff --git a/VM/VirtualMachine.pro b/VM/VirtualMachine.pro new file mode 100644 index 0000000..f7d847f --- /dev/null +++ b/VM/VirtualMachine.pro @@ -0,0 +1,44 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2022-07-12T13:39:19 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = VirtualMachine +TEMPLATE = app +QT += network + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +FORMS += \ + mainwindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + 图标.qrc diff --git a/VM/VirtualMachine.pro.user b/VM/VirtualMachine.pro.user new file mode 100644 index 0000000..56949d6 --- /dev/null +++ b/VM/VirtualMachine.pro.user @@ -0,0 +1,327 @@ + + + + + + EnvironmentId + {f2c8d716-7409-4b6a-a949-e01d13120d3a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {c19ffccf-bd9e-4c0f-b3ec-050420072cca} + 0 + 0 + 0 + + /home/gfdgd_xi/build-VirtualMachine-unknown-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/gfdgd_xi/build-VirtualMachine-unknown-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/gfdgd_xi/build-VirtualMachine-unknown-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + VirtualMachine + VirtualMachine2 + Qt4ProjectManager.Qt4RunConfiguration:/home/gfdgd_xi/Desktop/deep-wine-runner/VM/VirtualMachine.pro + VirtualMachine.pro + + 3768 + false + true + true + false + false + true + true + + /home/gfdgd_xi/build-VirtualMachine-unknown-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/VM/Windows7X64Auto.iso b/VM/Windows7X64Auto.iso new file mode 100755 index 0000000..d65f3f6 Binary files /dev/null and b/VM/Windows7X64Auto.iso differ diff --git a/VM/Windows7X86Auto.iso b/VM/Windows7X86Auto.iso new file mode 100755 index 0000000..afea6b2 Binary files /dev/null and b/VM/Windows7X86Auto.iso differ diff --git a/VM/[--verbose b/VM/[--verbose new file mode 100644 index 0000000..e69de29 diff --git a/VM/[common-opts] b/VM/[common-opts] new file mode 100644 index 0000000..e69de29 diff --git a/VM/] b/VM/] new file mode 100644 index 0000000..e69de29 diff --git a/VM/api/__init__.py b/VM/api/__init__.py new file mode 100644 index 0000000..d8ca3f9 --- /dev/null +++ b/VM/api/__init__.py @@ -0,0 +1,112 @@ +################################################ +# 作者: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}\"") \ No newline at end of file diff --git a/VM/api/__pycache__/__init__.cpython-37.pyc b/VM/api/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..777dda9 Binary files /dev/null and b/VM/api/__pycache__/__init__.cpython-37.pyc differ diff --git a/VM/global b/VM/global new file mode 100644 index 0000000..e69de29 diff --git a/VM/host: b/VM/host: new file mode 100644 index 0000000..e69de29 diff --git a/VM/icon.png b/VM/icon.png new file mode 100755 index 0000000..b164d46 Binary files /dev/null and b/VM/icon.png differ diff --git a/VM/main.cpp b/VM/main.cpp new file mode 100644 index 0000000..b48f94e --- /dev/null +++ b/VM/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/VM/mainwindow.cpp b/VM/mainwindow.cpp new file mode 100644 index 0000000..2ccfe04 --- /dev/null +++ b/VM/mainwindow.cpp @@ -0,0 +1,38 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include +#include +#include +#include + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + ui->tabWidget->setTabPosition(QTabWidget::West); // 标签靠左 +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::on_browser_clicked() +{ + // 浏览镜像文件 + QString filePath = QFileDialog::getOpenFileName(this, "选择 ISO 文件", "~", "ISO 镜像文件(*.iso);;所有文件(*.*)"); + if(filePath != ""){ + ui->isoPath->setText(filePath); + } +} + +void MainWindow::on_install_clicked() +{ + QProcess progress; + QStringList list; + list << ui->isoPath->text() << QString::number(ui->systemVersion->currentIndex()); + qDebug() << QCoreApplication::applicationDirPath() + QString("/run.py"); + progress.startDetached(QCoreApplication::applicationDirPath() + QString("/run.py"), list); + ui->tabWidget->setCurrentIndex(1); +} diff --git a/VM/mainwindow.h b/VM/mainwindow.h new file mode 100644 index 0000000..f72d399 --- /dev/null +++ b/VM/mainwindow.h @@ -0,0 +1,27 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private slots: + void on_browser_clicked(); + + void on_install_clicked(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/VM/mainwindow.ui b/VM/mainwindow.ui new file mode 100644 index 0000000..203dfcc --- /dev/null +++ b/VM/mainwindow.ui @@ -0,0 +1,291 @@ + + + MainWindow + + + + 0 + 0 + 807 + 429 + + + + MainWindow + + + + + + + QTabWidget::Rounded + + + 0 + + + + 设置 + + + 设置 + + + + + + + + 镜像路径: + + + + + + + 请选择系统镜像 + + + + + + + 浏览…… + + + + + + + + + + + 系统版本: + + + + + + + + + + 请选择系统类型(如果识别不了请自行选择,如果选择错误或不支持将无法进行自动安装) + + + + Windows 7 32 位(支持自动安装) + + + + + Windows 7 64 位(支持自动安装) + + + + + 其它 Windows 系统(不支持自动安装) + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 安装 + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10.5pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">使用迅雷或者网盘下载以下任意一个链接然后在上面选择即可:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">(如果下载这个,系统版本选第一项,一般推荐这个)ed2k://|file|cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486.iso|2653276160|7503E4B9B8738DFCB95872445C72AEFB|/</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">(如果下载这个,系统版本选第二项)ed2k://|file|cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso|3420557312|B58548681854236C7939003B583A8078|/</span></p> +<hr /></body></html> + + + + + + + + 安装/使用帮助 + + + + + + false + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10.5pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">给小白的一段话</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">其实本质上跑完安装程序就没有然后了,顶多如果想要运行舒服一点点,可以安装加强功能,直接拉到最底下看就可以了</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果爱折腾的话,下面的都看看也无所谓的</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(如果鼠标被锁定到里面了按下键盘右边的“Ctrl”键就可以了)</p> +<hr /> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">安装是否需要人工进行操作?</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果您下载的镜像本程序支持,则大部分不用,已经尽量省去了让新手头疼的虚拟机程序安装,创建、设置虚拟机,虚拟磁盘分区,寻找原版镜像文件等内容</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712191756.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">但有些设置依旧需要人工自行设置,例如安装界面密钥的输入、系统的激活(涉及版权问题,不会考虑省略)、增强功能的安装、需要使用的软件等等</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712192850.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712193527.png" /></p> +<hr /> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">什么样的镜像本程序不支持?</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1、过老的镜像,如 Windows XP、Windows Server 2003 等等,将完全无法自动安装,需要手动安装</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2、非 Windows 7 安装镜像</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">3、Windows 7 企业版镜像</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">4、选择了错误的 Windows 7 位数的镜像,部分/全部无法自动处理安装</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<hr /> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">如何安装加强功能?</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1、点击“设备”=》“加强功能”</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图_VirtualBox Machine_20220712142929.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2、打开“计算机”,找到名为“VirtualBox Guest Additions”的光盘,双击进入,然后双击打开名为“VBoxWindowsAdditions”的程序</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712143006.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">3、在弹出的界面点击“是”</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712143018.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">4、一直点“Next”</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712143029.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712143037.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">5、全部选择,然后点击“Install”进行安装</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712143044.png" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">6、等待安装完毕后,选择“Reboot now”然后点击“Finish”重启此虚拟机即可安装成功(选择“Reboot now”并点“Finish”会自动重新启动)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712143103.png" /></p></body></html> + + + + + + + + + 0 + 0 + + + + 关于 + + + + + + + + + 0 + 0 + + + + + 200 + 313 + + + + + 200 + 313 + + + + border-image: url(:/icon.png); + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10.5pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">此为 wine 运行器附属组件,基于 C++ Qt、Python 和 Virtualbox 制作,通过运行安装 Windows 操作系统的虚拟机实现在 Linux 运行 Windows exe 程序的功能。</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">基于 GPL V3 协议开源</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">项目地址:</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Gitee:<a href="https://gitee.com/gfdgd-xi/deep-wine-runner"><span style=" font-size:11pt; text-decoration: underline; color:#0082fa;">https://gitee.com/gfdgd-xi/deep-wine-runner</span></a></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Github:<a href="https://github.com/gfdgd-xi/deep-wine-runner"><span style=" font-size:11pt; text-decoration: underline; color:#0082fa;">https://github.com/gfdgd-xi/deep-wine-runner</span></a></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Gitlink:<a href="https://gitlink.org.cn/gfdgd_xi/deep-wine-runner"><span style=" font-size:11pt; text-decoration: underline; color:#0082fa;">https://gitlink.org.cn/gfdgd_xi/deep-wine-runner</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">该组件制作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢</p> +<hr /> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">参考文献:</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Droid Sans Mono','monospace','monospace'; font-size:11pt; color:#6a9955;">https://juejin.cn/post/7080484519328874510</span></p></body></html> + + + + + + + + + + + + 退出 + + + + + 关于 + + + + + + + diff --git a/VM/run.py b/VM/run.py new file mode 100755 index 0000000..f6c4390 --- /dev/null +++ b/VM/run.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +import os +import api +import sys +import psutil + +if __name__ == "__main__": + 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(2) + vm.SetMemory(psutil.virtual_memory().total // 1024 // 1024 // 3) + vm.SetDisplayMemory(32) + vm.SetNetBridge(net) + vm.EnabledAudio() + vm.EnabledClipboardMode() + vm.EnabledDraganddrop() + vm.ShareFile("ROOT", "/") + vm.ShareFile("HOME", api.homePath) + vm.Start() \ No newline at end of file diff --git a/VM/win7.xml b/VM/win7.xml new file mode 100755 index 0000000..05dece3 --- /dev/null +++ b/VM/win7.xml @@ -0,0 +1,144 @@ + + + + win7 + 721bf798-852e-4e2c-bfa7-c151037433b7 + + + + + + 4194304 + 4194304 + 2 + + hvm + + + + + + + + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + + + + +
+ + + + + + +
+ + +
+ + + +
+ + + +
+ + + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + + +
+ + + + + + + + + + +
+ + + + + + + + +
+ +