diff options
| author | selsta <selsta@sent.at> | 2026-03-21 20:10:21 +0100 |
|---|---|---|
| committer | selsta <selsta@sent.at> | 2026-03-21 22:36:04 +0100 |
| commit | e2a8efca864f7e3af7b5d602f6e76e26f377e585 (patch) | |
| tree | 91756b032ab927df0330a357d87a6cfe72f69058 /src/p2pool/P2PoolManager.cpp | |
| parent | b74815e8b3fd69351fac044b767367da0b5f2914 (diff) | |
| download | monzero-gui-e2a8efca864f7e3af7b5d602f6e76e26f377e585.tar.gz monzero-gui-e2a8efca864f7e3af7b5d602f6e76e26f377e585.tar.xz monzero-gui-e2a8efca864f7e3af7b5d602f6e76e26f377e585.zip | |
installer: move p2pool to LocalAppData
Diffstat (limited to 'src/p2pool/P2PoolManager.cpp')
| -rw-r--r-- | src/p2pool/P2PoolManager.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/p2pool/P2PoolManager.cpp b/src/p2pool/P2PoolManager.cpp index 5cfd48fc..5acd162f 100644 --- a/src/p2pool/P2PoolManager.cpp +++ b/src/p2pool/P2PoolManager.cpp @@ -29,6 +29,7 @@ #include "P2PoolManager.h" #include "net/http_client.h" #include "common/util.h" +#include "main/oshelper.h" #include "qt/utils.h" #include <QElapsedTimer> #include <QFile> @@ -41,6 +42,7 @@ #include <QApplication> #include <QProcess> #include <QMap> +#include <QStandardPaths> #include <QCryptographicHash> #if defined(Q_OS_MACOS) && defined(__aarch64__) && !defined(Q_OS_MACOS_AARCH64) @@ -241,9 +243,14 @@ P2PoolManager::P2PoolManager(QObject *parent) started = false; // Platform dependent path to p2pool #ifdef Q_OS_WIN - m_p2poolPath = QApplication::applicationDirPath() + "/p2pool"; + if (OSHelper().installed()) { + m_p2poolPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/p2pool"; + } else { + m_p2poolPath = QApplication::applicationDirPath() + "/p2pool"; + } + if (!QDir(m_p2poolPath).exists()) { - QDir().mkdir(m_p2poolPath); + QDir().mkpath(m_p2poolPath); } m_p2pool = m_p2poolPath + "/p2pool.exe"; #elif defined(Q_OS_UNIX) |
