新增安装Windows11功能(只限VirtualBox)

This commit is contained in:
gfdgd xi 2023-08-13 21:05:18 +08:00
parent a2424e08ba
commit a1b2915e3a
4 changed files with 48 additions and 21 deletions

View File

@ -7,7 +7,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -77,7 +77,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -147,7 +147,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -217,7 +217,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -287,7 +287,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -357,7 +357,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -427,7 +427,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -497,7 +497,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -567,7 +567,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -637,7 +637,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -707,7 +707,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -777,7 +777,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -847,7 +847,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -917,7 +917,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -987,7 +987,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -1057,7 +1057,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -1127,7 +1127,7 @@
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-OUNQoP/clang-uiheader-OYkbQU",
"/tmp/QtCreator-NXqKOr/clang-uiheader-YSsUJt",
"-nostdinc",
"-nostdinc++",
"-pipe",

View File

@ -110,15 +110,24 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
switch (id) {
case 0:
vm.Create("Windows7");
vm.SetDisplayMemory(32);
break;
case 1:
vm.Create("Windows7_64");
vm.SetDisplayMemory(32);
break;
case 2:
vm.Create("WindowsNT_64");
vm.SetDisplayMemory(32);
break;
case 3:
vm.Create("WindowsNT_64");
vm.SetDisplayMemory(32);
vm.EnabledUEFI(true);
break;
case 4:
vm.Create("Windows11_64");
vm.SetDisplayMemory(128);
vm.EnabledUEFI(true);
break;
}
@ -158,7 +167,6 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
infoUtils::memoryRate(memory, memoryAll, swap, swapAll);
//memoryRate(memory, memoryAll, swap, swapAll);
vm.SetMemory(memoryAll / 3 / 1024);
vm.SetDisplayMemory(32);
vm.SetNetBridge(net);
vm.EnabledAudio();
vm.EnabledClipboardMode();
@ -180,16 +188,25 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
switch (id) {
case 0:
vm.Create("Windows7");
vm.SetDisplayMemory(32);
break;
case 1:
vm.Create("Windows7_64");
vm.SetDisplayMemory(32);
break;
case 2:
vm.Create("WindowsNT_64");
vm.SetDisplayMemory(32);
break;
case 3:
vm.Create("WindowsNT_64");
vm.EnabledUEFI(true);
vm.SetDisplayMemory(32);
break;
case 4:
vm.Create("Windows11_64");
vm.SetDisplayMemory(128);
vm.EnabledUEFI(true);
break;
}
QDir dir("/home/gfdgd_xi/Qemu/Windows/");
@ -213,8 +230,8 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
if(QFile::exists("/usr/share/virtualbox/VBoxGuestAdditions.iso")){
vm.MountISO("/usr/share/virtualbox/VBoxGuestAdditions.iso", "storage_controller_1", 1, 1);
}
vm.SetCPU(get_nprocs(), GetCPUSocket(), GetCPUCore());
// VirtualBox 的 CPU 数量设置方法和 Qemu 不一样
vm.SetCPU(GetCPUCore(), GetCPUSocket(), GetCPUCore());
long memory = 0;
long memoryAll = 0;
long swap = 0;
@ -222,7 +239,6 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
infoUtils::memoryRate(memory, memoryAll, swap, swapAll);
//memoryRate(memory, memoryAll, swap, swapAll);
vm.SetMemory(memoryAll / 3 / 1024);
vm.SetDisplayMemory(32);
vm.SetNetBridge(net);
vm.EnabledAudio();
vm.EnabledClipboardMode();

View File

@ -196,6 +196,12 @@ void MainWindow::on_install_clicked()
file.close();
}
break;
case 4:
if(ui->vmChooser->currentIndex() == 0){
QMessageBox::warning(this, "提示", "Qemu 不支持该选项!");
return;
}
break;
default:
if(ui->vmChooser->currentIndex() == 0 && QFile::exists(QDir::homePath() + "/.config/deepin-wine-runner/QEMU-EFI")){
QFile::remove(QDir::homePath() + "/.config/deepin-wine-runner/QEMU-EFI");

View File

@ -94,6 +94,11 @@
<string>其他 Windows 系统不支持自动安装UEFI 启动,推荐 Windows 8 及以上)</string>
</property>
</item>
<item>
<property name="text">
<string>安装 WIndows 11不支持自动安装</string>
</property>
</item>
</widget>
</item>
</layout>