mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-05-23 00:19:50 +08:00
新增安装qemu/vbox功能
This commit is contained in:
parent
002a6e309d
commit
fd78edd2f7
2
Makefile
2
Makefile
@ -38,6 +38,8 @@ package:
|
||||
cp -rv IconList.json deb/opt/apps/deepin-wine-runner
|
||||
cp -rv GetEXEVersion.exe deb/opt/apps/deepin-wine-runner
|
||||
cp -rv MountWithoutHome.sh deb/opt/apps/deepin-wine-runner
|
||||
cp -rv RunCommandWithTerminal.py deb/opt/apps/deepin-wine-runner
|
||||
cp -rv QemuSystemInstall.sh deb/opt/apps/deepin-wine-runner
|
||||
echo "[]" > deb/opt/apps/deepin-wine-runner/wine/winelist.json
|
||||
rm -rfv deb/opt/apps/deepin-wine-runner/wine/winelist.json
|
||||
cp -rv req deb/opt/apps/deepin-wine-runner
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import PyQt5.QtWidgets as QtWidgets
|
||||
|
4
QemuSystemInstall.sh
Executable file
4
QemuSystemInstall.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
pkexec apt install qemu-system -y
|
||||
echo 安装完成!按回车键退出
|
||||
read
|
10
RunCommandWithTerminal.py
Normal file
10
RunCommandWithTerminal.py
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
from Model import *
|
||||
if len(sys.argv) < 2:
|
||||
print("请加入需要的命令")
|
||||
sys.exit(1)
|
||||
o = ""
|
||||
for i in sys.argv[1:]:
|
||||
o += f"'{i}' "
|
||||
OpenTerminal(o)
|
@ -95,6 +95,7 @@ DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KGuiAddons.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KI18n.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIconThemes.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIdleTime.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOCore.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOFileWidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOGui.pri \
|
||||
@ -287,6 +288,7 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KGuiAddons.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KI18n.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIconThemes.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIdleTime.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOCore.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOFileWidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOGui.pri \
|
||||
@ -459,6 +461,7 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KGuiAddons.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KI18n.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIconThemes.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIdleTime.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOCore.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOFileWidgets.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_KIOGui.pri:
|
||||
|
@ -28,12 +28,15 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->setTabPosition(QTabWidget::West); // 标签靠左
|
||||
// 选择最优虚拟机
|
||||
if(!system("which qemu-x86_64")){
|
||||
if(!system("which qemu-system-x86_64")){
|
||||
ui->vmChooser->setCurrentIndex(0);
|
||||
}
|
||||
if(!system("which vboxmanage")){
|
||||
ui->vmChooser->setCurrentIndex(1);
|
||||
}
|
||||
if(!QFile::exists(QCoreApplication::applicationDirPath() + "/../RunCommandWithTerminal.py")){
|
||||
ui->getQemu->setDisabled(true);
|
||||
}
|
||||
// 允许输出 qDebug 信息
|
||||
QLoggingCategory::defaultCategory()->setEnabled(QtDebugMsg, true);
|
||||
// 判断是否安装 vbox(无需判断)
|
||||
@ -76,7 +79,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
// 设置程序标题
|
||||
this->setWindowTitle("Windows 应用适配工具 " + versionValue.toString());
|
||||
// 读取谢明列表
|
||||
ui->textBrowser_2->setHtml("<p>程序版本号:" + versionValue.toString() + "</p>" + ui->textBrowser_2->toHtml() +
|
||||
ui->textBrowser_2->setHtml("<p>程序版本号:" + versionValue.toString() + ", " + GetRunCommand("arch") + "</p>" + ui->textBrowser_2->toHtml() +
|
||||
"<hr/><h1>谢明列表</h1>" + thankText);
|
||||
connect(ui->textBrowser_2, &QTextBrowser::anchorClicked, this, [=](const QUrl &link){
|
||||
QDesktopServices::openUrl(link);
|
||||
@ -156,7 +159,7 @@ void MainWindow::on_install_clicked()
|
||||
{
|
||||
switch (ui->vmChooser->currentIndex()) {
|
||||
case 0:
|
||||
if(system("which qemu-x86_64")){
|
||||
if(system("which qemu-system-x86_64")){
|
||||
if(QMessageBox::question(this, "提示", "您似乎没有安装 Qemu,是否继续创建虚拟机?") == QMessageBox::No){
|
||||
return;
|
||||
}
|
||||
@ -173,3 +176,13 @@ void MainWindow::on_install_clicked()
|
||||
buildvbox(ui->isoPath->text(), ui->systemVersion->currentIndex(), ui->vmChooser->currentIndex());
|
||||
return;
|
||||
}
|
||||
|
||||
void MainWindow::on_getvbox_clicked()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://www.virtualbox.org/wiki/Linux_Downloads"));
|
||||
}
|
||||
|
||||
void MainWindow::on_getQemu_clicked()
|
||||
{
|
||||
system(("python3 '" + QCoreApplication::applicationDirPath() + "/../RunCommandWithTerminal.py' '" + QCoreApplication::applicationDirPath() + "/../QemuSystemInstall.sh'").toLatin1());
|
||||
}
|
||||
|
@ -26,6 +26,10 @@ private slots:
|
||||
void on_install_clicked();
|
||||
|
||||
|
||||
void on_getvbox_clicked();
|
||||
|
||||
void on_getQemu_clicked();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
long m_cpuAll;
|
||||
|
@ -145,6 +145,20 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="getQemu">
|
||||
<property name="text">
|
||||
<string>安装 Qemu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="getvbox">
|
||||
<property name="text">
|
||||
<string>获取VirtualBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="install">
|
||||
<property name="text">
|
||||
@ -228,7 +242,7 @@ p, li { white-space: pre-wrap; }
|
||||
<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;">3、在这里修改即可</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_20220712223705.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;"><span style=" font-size:26pt; font-weight:600;">安装加强功能有什么好处?(只限使用 VirtualBox)</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;">2、支持虚拟机根据窗口大小自动设置分辨率</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">3、支持文件共享、剪切板共享、文件拖放</p>
|
||||
|
@ -13,9 +13,13 @@ vbox::vbox(QString name, QString managerPath) {
|
||||
}
|
||||
|
||||
int vbox::Create(QString type){
|
||||
return system(("\"" + managerPath + "\" createvm --name \""
|
||||
system(("\"" + managerPath + "\" createvm --name \""
|
||||
+ name + "\" --ostype \"" + type +
|
||||
"\" --register").toLatin1());
|
||||
return system(("\"" + managerPath + "\" modifyvm \""
|
||||
+ name + "\" --ostype \"" + type +
|
||||
"\" ").toLatin1());
|
||||
//vboxmanage modifyvm testvm --ostype
|
||||
}
|
||||
int vbox::CreateDisk(QString path, int size){
|
||||
return system(("\"" + managerPath + "\" createvdi --filename \"" + path + "\" --size \"" + QString::number(size) + "\"").toLatin1());
|
||||
|
Loading…
x
Reference in New Issue
Block a user