make sure updater take into consideration UserData

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-06-29 14:02:09 +03:00
parent 196b2b5a3e
commit eab53c6e42
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -328,6 +328,9 @@ PrismUpdaterApp::PrismUpdaterApp(int& argc, char** argv) : QApplication(argc, ar
adjustedBy = "Command line"; adjustedBy = "Command line";
m_dataPath = dirParam; m_dataPath = dirParam;
#ifndef Q_OS_MACOS #ifndef Q_OS_MACOS
if (QDir(FS::PathCombine(m_rootPath, "UserData")).exists()) {
m_isPortable = true;
}
if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) { if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) {
m_isPortable = true; m_isPortable = true;
} }
@ -338,7 +341,11 @@ PrismUpdaterApp::PrismUpdaterApp(int& argc, char** argv) : QApplication(argc, ar
adjustedBy = "Persistent data path"; adjustedBy = "Persistent data path";
#ifndef Q_OS_MACOS #ifndef Q_OS_MACOS
if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) { if (auto portableUserData = FS::PathCombine(m_rootPath, "UserData"); QDir(portableUserData).exists()) {
m_dataPath = portableUserData;
adjustedBy = "Portable user data path";
m_isPortable = true;
} else if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) {
m_dataPath = m_rootPath; m_dataPath = m_rootPath;
adjustedBy = "Portable data path"; adjustedBy = "Portable data path";
m_isPortable = true; m_isPortable = true;