diff --git a/launchers/qt/src/Helper.h b/launchers/qt/src/Helper.h index 669dd26f3b..2d1f06052f 100644 --- a/launchers/qt/src/Helper.h +++ b/launchers/qt/src/Helper.h @@ -21,6 +21,7 @@ bool replaceDirectory(const QString& orginalDirectory, const QString& newDirecto void closeInterfaceIfRunning(); void waitForInterfaceToClose(); bool isLauncherAlreadyRunning(); +QString getBundlePath(); #endif #ifdef Q_OS_WIN diff --git a/launchers/qt/src/Helper_darwin.mm b/launchers/qt/src/Helper_darwin.mm index 47866a8ffb..684143e11b 100644 --- a/launchers/qt/src/Helper_darwin.mm +++ b/launchers/qt/src/Helper_darwin.mm @@ -42,6 +42,10 @@ void launchClient(const QString& clientPath, const QString& homePath, const QStr } +QString getBundlePath() { + return QString::fromNSString([[NSBundle mainBundle] bundlePath]); +} + void launchAutoUpdater(const QString& autoUpdaterPath) { NSException *exception; diff --git a/launchers/qt/src/LauncherState.cpp b/launchers/qt/src/LauncherState.cpp index 97911c8a4d..ec5a2c048d 100644 --- a/launchers/qt/src/LauncherState.cpp +++ b/launchers/qt/src/LauncherState.cpp @@ -79,7 +79,6 @@ QString LauncherState::getClientExecutablePath() const { #endif } - QString LauncherState::getConfigFilePath() const { QDir clientDirectory = getClientDirectory(); return clientDirectory.absoluteFilePath("config.json"); @@ -89,7 +88,7 @@ QString LauncherState::getLauncherFilePath() const { #if defined(Q_OS_WIN) return _launcherDirectory.absoluteFilePath("launcher.exe"); #elif defined(Q_OS_MACOS) - return _launcherDirectory.absoluteFilePath("launcher.app"); + return getBundlePath() + "/Contents/MacOS/HQ Launcher"; #endif }