fix(updater): logs/ folder

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-06-26 01:41:51 -07:00
parent 1f70589deb
commit c0f0462550
No known key found for this signature in database
GPG Key ID: E10E321EB160949B
3 changed files with 12 additions and 5 deletions

View File

@ -831,7 +831,13 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
m_updater.reset(new MacSparkleUpdater()); m_updater.reset(new MacSparkleUpdater());
#else #else
m_updater.reset(new PrismExternalUpdater(m_rootPath, m_dataPath)); auto exe_name = QStringLiteral("%1_updater").arg(BuildConfig.LAUNCHER_APP_BINARY_NAME);
#if defined Q_OS_WIN32
exe_name.append(".exe");
#endif
auto updater_binary = QFileInfo(QDir(m_rootPath).absoluteFilePath(exe_name));
if (updater_binary.isFile())
m_updater.reset(new PrismExternalUpdater(m_rootPath, m_dataPath));
#endif #endif
qDebug() << "<> Updater started."; qDebug() << "<> Updater started.";
} }
@ -1058,7 +1064,7 @@ void Application::performMainStartupAction()
{ {
m_status = Application::Initialized; m_status = Application::Initialized;
auto update_log_path = FS::PathCombine(m_dataPath, "prism_launcher_update.log"); auto update_log_path = FS::PathCombine(m_dataPath, "logs", "prism_launcher_update.log");
auto update_lock = QFileInfo(FS::PathCombine(m_dataPath, ".prism_launcher_update.lock")); auto update_lock = QFileInfo(FS::PathCombine(m_dataPath, ".prism_launcher_update.lock"));
if (update_lock.exists()) { if (update_lock.exists()) {

View File

@ -42,7 +42,7 @@ class UpdateAvailableDialog : public QDialog {
const QString& availableVersion, const QString& availableVersion,
const QString& releaseNotes, const QString& releaseNotes,
QWidget* parent = 0); QWidget* parent = 0);
~UpdateAvailableDialog(); ~UpdateAvailableDialog() = default;
private: private:
Ui::UpdateAvailableDialog* ui; Ui::UpdateAvailableDialog* ui;

View File

@ -343,10 +343,11 @@ PrismUpdaterApp::PrismUpdaterApp(int& argc, char** argv) : QApplication(argc, ar
#endif #endif
} }
m_updateLogPath = FS::PathCombine(m_dataPath, "prism_launcher_update.log"); m_updateLogPath = FS::PathCombine(m_dataPath, "logs", "prism_launcher_update.log");
{ // setup logging { // setup logging
static const QString logBase = BuildConfig.LAUNCHER_NAME + "Updater" + (m_checkOnly ? "-CheckOnly" : "") + "-%0.log"; static const QString baseLogFile = BuildConfig.LAUNCHER_NAME + "Updater" + (m_checkOnly ? "-CheckOnly" : "") + "-%0.log";
static const QString logBase = FS::PathCombine("logs", baseLogFile);
auto moveFile = [](const QString& oldName, const QString& newName) { auto moveFile = [](const QString& oldName, const QString& newName) {
QFile::remove(newName); QFile::remove(newName);
QFile::copy(oldName, newName); QFile::copy(oldName, newName);