mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-13 10:32:03 +08:00
启动器图标支持启动UEFI
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -77,7 +77,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -147,7 +147,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -217,7 +217,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -287,7 +287,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -357,7 +357,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -427,7 +427,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -497,7 +497,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -567,7 +567,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -637,7 +637,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -707,7 +707,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -777,7 +777,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -847,7 +847,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -917,7 +917,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -987,7 +987,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-pipe",
|
||||
@@ -1057,77 +1057,7 @@
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-xhHVIb/clang-uiheader-riAtqg",
|
||||
"-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_qemusetting.h"
|
||||
],
|
||||
"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-xhHVIb/clang-uiheader-riAtqg",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-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_mainwindow.h"
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
"clang",
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
|
||||
"-I",
|
||||
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
|
||||
"-I",
|
||||
"/tmp/QtCreator-qyPOGG/clang-uiheader-fvNAaR",
|
||||
"-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_qemusetting.h"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
]
|
||||
@@ -177,13 +177,29 @@ void MainWindow::on_install_clicked()
|
||||
}
|
||||
break;
|
||||
}
|
||||
QFile file(QDir::homePath() + "/.config/deepin-wine-runner/QEMU-EFI");
|
||||
QDir dir(QDir::homePath() + "/.config/deepin-wine-runner");
|
||||
switch (ui->systemVersion->currentIndex()) {
|
||||
case 3:
|
||||
if(QFile::exists("/usr/share/qemu/OVMF.fd")){
|
||||
if(!QFile::exists("/usr/share/qemu/OVMF.fd") && !QFile::exists(QCoreApplication::applicationDirPath() + "/OVMF.fd") && ui->vmChooser->currentIndex() == 0){
|
||||
if(QMessageBox::question(this, "提示", "似乎无法找到 UEFI 固件,是否继续创建虚拟机?\nQemu 固件可以在“安装 Qemu”处安装") == QMessageBox::No){
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(!dir.exists()){
|
||||
dir.mkpath(QDir::homePath() + "/.config/deepin-wine-runner");
|
||||
}
|
||||
if(!QFile::exists(QDir::homePath() + "/.config/deepin-wine-runner/QEMU-EFI")){
|
||||
// 写入用于识别的空文件
|
||||
file.open(QIODevice::WriteOnly);
|
||||
file.write("1");
|
||||
file.close();
|
||||
}
|
||||
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");
|
||||
}
|
||||
}
|
||||
buildvbox(ui->isoPath->text(), ui->systemVersion->currentIndex(), ui->vmChooser->currentIndex());
|
||||
return;
|
||||
|
||||
@@ -86,12 +86,12 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>其它 Windows 系统(不支持自动安装,传统启动)</string>
|
||||
<string>其它 Windows 系统(不支持自动安装,传统启动,推荐 Windows 7 及以下)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>其他 Windows 系统(不支持自动安装,UEFI 启动)</string>
|
||||
<string>其他 Windows 系统(不支持自动安装,UEFI 启动,推荐 Windows 8 及以上)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
||||
@@ -120,8 +120,16 @@ int qemu::OpenUSB(){
|
||||
return 0;
|
||||
}
|
||||
int qemu::EnabledUEFI(bool status){
|
||||
if(status){
|
||||
commandOption += "--bios /usr/share/qemu/OVMF.fd ";
|
||||
if(!status){
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
if(QFile::exists("/usr/share/qemu/OVMF.fd")){
|
||||
commandOption += "--bios /usr/share/qemu/OVMF.fd ";
|
||||
return 0;
|
||||
}
|
||||
if(QFile::exists(QCoreApplication::applicationDirPath() + "/OVMF.fd")){
|
||||
commandOption += "--bios '" + QCoreApplication::applicationDirPath() + "/OVMF.fd' ";
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user