新增UEFI支持

This commit is contained in:
2023-08-10 13:21:30 +08:00
parent cd356e5f7f
commit 056a30c29d
13 changed files with 1570 additions and 375 deletions

View File

@@ -177,6 +177,30 @@ 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") && !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;
}
@@ -188,7 +212,7 @@ void MainWindow::on_getvbox_clicked()
void MainWindow::on_getQemu_clicked()
{
system(("python3 '" + QCoreApplication::applicationDirPath() + "/../RunCommandWithTerminal.py' '" + QCoreApplication::applicationDirPath() + "/../QemuSystemInstall.sh'").toLatin1());
system(("python3 '" + QCoreApplication::applicationDirPath() + "/../RunCommandWithTerminal.py' pkexec '" + QCoreApplication::applicationDirPath() + "/../QemuSystemInstall.sh'").toLatin1());
}
void MainWindow::on_vmChooser_currentIndexChanged(int index)