Add error popup if unable to find game executable

This commit is contained in:
VoxelTek 2025-06-26 16:28:47 +10:00
parent d11b646585
commit 57c269e6de

View File

@ -11,6 +11,7 @@
#include "res/resource.h" #include "res/resource.h"
#include <QKeyEvent> #include <QKeyEvent>
#include <QMessageBox>
#include <QProcess> #include <QProcess>
#include <mxdirectx/legodxinfo.h> #include <mxdirectx/legodxinfo.h>
#include <ui_maindialog.h> #include <ui_maindialog.h>
@ -164,9 +165,21 @@ void CMainDialog::launch()
} }
QDir::setCurrent(QCoreApplication::applicationDirPath()); QDir::setCurrent(QCoreApplication::applicationDirPath());
#ifdef _WIN32 #ifdef _WIN32
QProcess::startDetached("./isle.exe"); if (!QProcess::startDetached("./isle.exe")) {
QMessageBox msgBox;
msgBox.setText("Unable to locate isle executable!");
msgBox.setWindowTitle("Error");
msgBox.exec();
}
#else #else
QProcess::startDetached("./isle"); if (!QProcess::startDetached("./isle")) { // Check in isle-config directory
if (!QProcess::startDetached("isle")) { // Check in $PATH
QMessageBox msgBox;
msgBox.setText("Unable to locate isle executable!");
msgBox.setWindowTitle("Error");
msgBox.exec();
}
}
#endif #endif
QDialog::accept(); QDialog::accept();
} }