fix(updater): ensure updater knows binaries are in ./bin/ on linux and can find them

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-06-30 21:24:30 -07:00
parent cd527c44a4
commit 1fd90e9dd0
No known key found for this signature in database
GPG key ID: E10E321EB160949B
3 changed files with 40 additions and 26 deletions

View file

@ -1126,7 +1126,7 @@ bool Application::updaterEnabled()
#if defined(Q_OS_MAC)
return BuildConfig.UPDATER_ENABLED;
#else
return BuildConfig.UPDATER_ENABLED && QFileInfo(FS::PathCombine(applicationDirPath(), updaterBinaryName())).isFile();
return BuildConfig.UPDATER_ENABLED && QFileInfo(FS::PathCombine(m_rootPath, updaterBinaryName())).isFile();
#endif
}
@ -1135,6 +1135,8 @@ QString Application::updaterBinaryName()
auto exe_name = QStringLiteral("%1_updater").arg(BuildConfig.LAUNCHER_APP_BINARY_NAME);
#if defined Q_OS_WIN32
exe_name.append(".exe");
#else
exe_name.prepend("bin/");
#endif
return exe_name;
}
@ -1215,7 +1217,7 @@ void Application::performMainStartupAction()
#ifdef Q_OS_MAC
m_updater.reset(new MacSparkleUpdater());
#else
m_updater.reset(new PrismExternalUpdater(m_mainWindow, applicationDirPath(), m_dataPath));
m_updater.reset(new PrismExternalUpdater(m_mainWindow, m_rootPath, m_dataPath));
#endif
qDebug() << "<> Updater started.";
}