From 35598a2c45363e2a3dd258db1f6293c5451e2cd9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 2 Aug 2023 20:36:29 +0200 Subject: [PATCH] Changed the unsafe upgrade check to use std::filesystem::path --- es-app/src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 88bc153fe..2c11ee2c7 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -831,15 +831,15 @@ int main(int argc, char* argv[]) // If this is the case an unsafe upgrade has taken place, probably by simply unpacking // the new release on top of the old one. bool releaseFileExists {true}; - const std::string releaseFile {"r" + std::to_string(PROGRAM_RELEASE_NUMBER) + ".rel"}; - if (!Utils::FileSystem::exists(Utils::FileSystem::getExePath() + "/" + releaseFile)) { - releaseFileExists = Utils::FileSystem::createEmptyFile( - Utils::FileSystem::getExePath() + "/" + releaseFile); - } + const std::filesystem::path releaseFile {Utils::FileSystem::getExePath() + "/r" + + std::to_string(PROGRAM_RELEASE_NUMBER) + + ".rel"}; + if (!Utils::FileSystem::exists(releaseFile.string())) + releaseFileExists = Utils::FileSystem::createEmptyFile(releaseFile); if (releaseFileExists) { for (auto& file : Utils::FileSystem::getMatchingFiles( Utils::FileSystem::getExePath() + "/*.rel")) { - if (Utils::FileSystem::getFileName(file) != releaseFile) { + if (Utils::FileSystem::getFileName(file) != releaseFile.filename()) { LOG(LogWarning) << "It seems as if an unsafe upgrade has been made"; ViewController::getInstance()->unsafeUpgradeDialog(); break;