2022-07-12 20:37:59 +08:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
2022-08-24 16:13:47 +08:00
|
|
|
#include <QTranslator>
|
|
|
|
#include <QCoreApplication>
|
2023-02-19 15:43:24 +08:00
|
|
|
#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;
|
|
|
|
}
|
2022-07-12 20:37:59 +08:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QApplication a(argc, argv);
|
2022-08-24 16:13:47 +08:00
|
|
|
// 语言
|
|
|
|
QTranslator *trans = new QTranslator(&a);
|
|
|
|
trans->load("virtualmachine-en_US.qm");
|
|
|
|
|
|
|
|
a.installTranslator(trans);
|
2023-02-19 15:43:24 +08:00
|
|
|
// 判断是否为 !amd64
|
2023-02-25 08:28:50 +08:00
|
|
|
if(GetRunCommand("arch").replace(" ", "").replace("\n", "") != QString("x86_64")){
|
2023-02-19 15:43:24 +08:00
|
|
|
QMessageBox::critical(NULL, "错误", "此程序不支持非 X86 架构,立即退出");
|
|
|
|
return 0;
|
|
|
|
}
|
2022-07-12 20:37:59 +08:00
|
|
|
MainWindow w;
|
2022-08-24 16:13:47 +08:00
|
|
|
|
2022-07-12 20:37:59 +08:00
|
|
|
w.show();
|
|
|
|
|
|
|
|
return a.exec();
|
|
|
|
}
|