mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 02:52:03 +08:00
新增架构检测
This commit is contained in:
@@ -2,6 +2,18 @@
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
#include <QCoreApplication>
|
||||
#include <QProcess>
|
||||
#include <QMessageBox>
|
||||
|
||||
QString GetRunCommand(QString command){
|
||||
QProcess process;
|
||||
process.start(command);
|
||||
process.waitForStarted();
|
||||
process.waitForFinished();
|
||||
QString re = process.readAllStandardOutput();
|
||||
process.close();
|
||||
return re;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -11,6 +23,11 @@ int main(int argc, char *argv[])
|
||||
trans->load("virtualmachine-en_US.qm");
|
||||
|
||||
a.installTranslator(trans);
|
||||
// 判断是否为 !amd64
|
||||
if(GetRunCommand("arch").replace(" ", "").replace("\n", "") == QString("x86_64")){
|
||||
QMessageBox::critical(NULL, "错误", "此程序不支持非 X86 架构,立即退出");
|
||||
return 0;
|
||||
}
|
||||
MainWindow w;
|
||||
|
||||
w.show();
|
||||
|
||||
Reference in New Issue
Block a user