mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 02:52:03 +08:00
支持跟进vbox安装功能
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -77,7 +77,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -147,7 +147,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -217,7 +217,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -287,7 +287,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -357,7 +357,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -427,7 +427,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -497,7 +497,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -567,7 +567,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -637,7 +637,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -707,7 +707,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -777,7 +777,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -847,7 +847,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -917,7 +917,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -987,7 +987,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -1057,77 +1057,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
"-std=gnu++11",
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-D_REENTRANT",
|
||||
"-fPIC",
|
||||
"-fsyntax-only",
|
||||
"-m64",
|
||||
"--target=x86_64-linux-gnu",
|
||||
"-DQ_CREATOR_RUN",
|
||||
"-DQT_DEPRECATED_WARNINGS",
|
||||
"-DQT_NO_DEBUG",
|
||||
"-DQT_WIDGETS_LIB",
|
||||
"-DQT_GUI_LIB",
|
||||
"-DQT_NETWORK_LIB",
|
||||
"-DQT_CORE_LIB",
|
||||
"-I",
|
||||
"/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtWidgets",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtGui",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtNetwork",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtCore",
|
||||
"-I",
|
||||
"/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++",
|
||||
"-isystem",
|
||||
"/usr/include/c++/11",
|
||||
"-isystem",
|
||||
"/usr/include/x86_64-linux-gnu/c++/11",
|
||||
"-isystem",
|
||||
"/usr/include/c++/11/backward",
|
||||
"-isystem",
|
||||
"/usr/local/include",
|
||||
"-isystem",
|
||||
"/usr/lib/llvm-13/lib/clang/13.0.1/include",
|
||||
"-isystem",
|
||||
"/usr/include/x86_64-linux-gnu",
|
||||
"-isystem",
|
||||
"/usr/include",
|
||||
"-fmessage-length=0",
|
||||
"-fdiagnostics-show-note-include-stack",
|
||||
"-fretain-comments-from-system-headers",
|
||||
"-fmacro-backtrace-limit=0",
|
||||
"-ferror-limit=1000",
|
||||
"-x",
|
||||
"c++-header",
|
||||
"-Wno-unknown-pragmas",
|
||||
"-Wno-unknown-warning-option",
|
||||
"-Wno-documentation-unknown-command",
|
||||
"/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/ui_mainwindow.h"
|
||||
],
|
||||
"directory": "/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/.qtc_clangd",
|
||||
"file": "/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/ui_mainwindow.h"
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
"clang",
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -1188,5 +1118,75 @@
|
||||
],
|
||||
"directory": "/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/.qtc_clangd",
|
||||
"file": "/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/ui_qemusetting.h"
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
"clang",
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-GlmWVk/clang-uiheader-woUjcu",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
"-std=gnu++11",
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-D_REENTRANT",
|
||||
"-fPIC",
|
||||
"-fsyntax-only",
|
||||
"-m64",
|
||||
"--target=x86_64-linux-gnu",
|
||||
"-DQ_CREATOR_RUN",
|
||||
"-DQT_DEPRECATED_WARNINGS",
|
||||
"-DQT_NO_DEBUG",
|
||||
"-DQT_WIDGETS_LIB",
|
||||
"-DQT_GUI_LIB",
|
||||
"-DQT_NETWORK_LIB",
|
||||
"-DQT_CORE_LIB",
|
||||
"-I",
|
||||
"/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtWidgets",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtGui",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtNetwork",
|
||||
"-I",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtCore",
|
||||
"-I",
|
||||
"/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++",
|
||||
"-isystem",
|
||||
"/usr/include/c++/11",
|
||||
"-isystem",
|
||||
"/usr/include/x86_64-linux-gnu/c++/11",
|
||||
"-isystem",
|
||||
"/usr/include/c++/11/backward",
|
||||
"-isystem",
|
||||
"/usr/local/include",
|
||||
"-isystem",
|
||||
"/usr/lib/llvm-13/lib/clang/13.0.1/include",
|
||||
"-isystem",
|
||||
"/usr/include/x86_64-linux-gnu",
|
||||
"-isystem",
|
||||
"/usr/include",
|
||||
"-fmessage-length=0",
|
||||
"-fdiagnostics-show-note-include-stack",
|
||||
"-fretain-comments-from-system-headers",
|
||||
"-fmacro-backtrace-limit=0",
|
||||
"-ferror-limit=1000",
|
||||
"-x",
|
||||
"c++-header",
|
||||
"-Wno-unknown-pragmas",
|
||||
"-Wno-unknown-warning-option",
|
||||
"-Wno-documentation-unknown-command",
|
||||
"/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/ui_mainwindow.h"
|
||||
],
|
||||
"directory": "/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/.qtc_clangd",
|
||||
"file": "/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/ui_mainwindow.h"
|
||||
}
|
||||
]
|
||||
@@ -106,7 +106,7 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
|
||||
//vbox *box = new vbox("Window");
|
||||
//vbox vm("Windows");
|
||||
qemu vm("Windows");
|
||||
|
||||
bool setISOAlready = 0;
|
||||
switch (id) {
|
||||
case 0:
|
||||
vm.Create("Windows7");
|
||||
@@ -129,20 +129,42 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
|
||||
vm.Create("Windows11_64");
|
||||
vm.SetDisplayMemory(128);
|
||||
vm.EnabledUEFI(true);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
case 5:
|
||||
vm.Create("WindowsXP_32");
|
||||
vm.SetDisplayMemory(32);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
case 6:
|
||||
vm.Create("WindowsNT_64");
|
||||
vm.SetDisplayMemory(32);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
case 7:
|
||||
vm.Create("WindowsNT_64");
|
||||
vm.SetDisplayMemory(32);
|
||||
vm.EnabledUEFI(true);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
}
|
||||
vm.CreateDiskControl();
|
||||
//vm.CreateDiskControl("storage_controller_2");
|
||||
vm.CreateDisk(QDir::homePath() + "/Qemu/Windows/Windows.qcow2", 131072);
|
||||
vm.MountDisk(QDir::homePath() + "/Qemu/Windows/Windows.qcow2");
|
||||
vm.MountISO(isoPath, "storage_controller_1", 0, 1);
|
||||
switch (id) {
|
||||
case 0:
|
||||
vm.MountISO(programPath + "/Windows7X86Auto.iso", "storage_controller_1", 1, 2);
|
||||
break;
|
||||
case 1:
|
||||
vm.MountISO(programPath + "/Windows7X64Auto.iso", "storage_controller_1", 1, 2);
|
||||
break;
|
||||
if(!setISOAlready){
|
||||
vm.MountISO(isoPath, "storage_controller_1", 0, 1);
|
||||
switch (id) {
|
||||
case 0:
|
||||
vm.MountISO(programPath + "/Windows7X86Auto.iso", "storage_controller_1", 1, 2);
|
||||
break;
|
||||
case 1:
|
||||
vm.MountISO(programPath + "/Windows7X64Auto.iso", "storage_controller_1", 1, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
vm.AutoInstall(isoPath);
|
||||
}
|
||||
/*vm.MountISO(isoPath, "storage_controller_1", 0, 1);
|
||||
switch (id) {
|
||||
@@ -184,7 +206,7 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
|
||||
//vbox *box = new vbox("Window");
|
||||
vbox vm("Windows");
|
||||
//qemu vm("Windows");
|
||||
|
||||
bool setISOAlready = 1;
|
||||
switch (id) {
|
||||
case 0:
|
||||
vm.Create("Windows7");
|
||||
@@ -207,22 +229,44 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
|
||||
vm.Create("Windows11_64");
|
||||
vm.SetDisplayMemory(128);
|
||||
vm.EnabledUEFI(true);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
vm.Create("WindowsXP_32");
|
||||
vm.SetDisplayMemory(32);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
case 6:
|
||||
vm.Create("WindowsNT_64");
|
||||
vm.SetDisplayMemory(32);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
case 7:
|
||||
vm.Create("WindowsNT_64");
|
||||
vm.SetDisplayMemory(32);
|
||||
vm.EnabledUEFI(true);
|
||||
setISOAlready = 1;
|
||||
break;
|
||||
}
|
||||
QDir dir("/home/gfdgd_xi/Qemu/Windows/");
|
||||
dir.mkpath("/home/gfdgd_xi/Qemu/Windows/");
|
||||
vm.CreateDiskControl();
|
||||
//vm.CreateDiskControl("storage_controller_2");
|
||||
vm.CreateDisk(QDir::homePath() + "/VirtualBox VMs/Windows/Windows.vdi", 131072);
|
||||
vm.MountDisk(QDir::homePath() + "/VirtualBox VMs/Windows/Windows.vdi");
|
||||
vm.MountISO(isoPath, "storage_controller_1", 0, 1);
|
||||
switch (id) {
|
||||
case 0:
|
||||
vm.MountISO(programPath + "/Windows7X86Auto.iso", "storage_controller_1", 1, 0);
|
||||
break;
|
||||
case 1:
|
||||
vm.MountISO(programPath + "/Windows7X64Auto.iso", "storage_controller_1", 1, 0);
|
||||
break;
|
||||
if(!setISOAlready){
|
||||
vm.MountISO(isoPath, "storage_controller_1", 0, 1);
|
||||
switch (id) {
|
||||
case 0:
|
||||
vm.MountISO(programPath + "/Windows7X86Auto.iso", "storage_controller_1", 1, 0);
|
||||
break;
|
||||
case 1:
|
||||
vm.MountISO(programPath + "/Windows7X64Auto.iso", "storage_controller_1", 1, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
vm.AutoInstall(isoPath);
|
||||
}
|
||||
|
||||
// 判断 VirtualBox Guest ISO 是否存在
|
||||
|
||||
@@ -197,6 +197,9 @@ void MainWindow::on_install_clicked()
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if(ui->vmChooser->currentIndex() == 0){
|
||||
QMessageBox::warning(this, "提示", "Qemu 不支持该选项!");
|
||||
return;
|
||||
|
||||
@@ -99,6 +99,21 @@
|
||||
<string>安装 WIndows 11(不支持自动安装)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>安装其他 Windows XP(支持自动安装,只支持 VirtualBox)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>安装其他 Windows (支持自动安装,传统启动,只支持 VirtualBox)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>安装其他 Windows(支持自动安装,UEFI 启动,只支持 VirtualBox)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -133,3 +133,6 @@ int qemu::EnabledUEFI(bool status){
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
int qemu::AutoInstall(QString iso){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
int SetKeyboardPS2();
|
||||
int OpenUSB();
|
||||
int EnabledUEFI(bool status);
|
||||
int AutoInstall(QString iso);
|
||||
private:
|
||||
QString commandOption = "";
|
||||
|
||||
|
||||
@@ -108,3 +108,6 @@ int vbox::EnabledUEFI(bool status){
|
||||
}
|
||||
return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --firmware=bios").toLatin1());
|
||||
}
|
||||
int vbox::AutoInstall(QString iso){
|
||||
return system(("vboxmanage unattended install '" + name + "' '--iso=" + iso + "'").toLatin1());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
int SetKeyboardPS2();
|
||||
int OpenUSB();
|
||||
int EnabledUEFI(bool status);
|
||||
|
||||
int AutoInstall(QString iso);
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user