From: tobtoht Date: Fri, 25 Feb 2022 13:55:39 +0000 (+0100) Subject: TorManager: set correct dir when Feather is installed X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=87fec5d0f9517a0ff787ca67632ec242a9f4141b;p=gamesguru%2Ffeather.git TorManager: set correct dir when Feather is installed --- diff --git a/src/utils/TorManager.cpp b/src/utils/TorManager.cpp index 48c228a4..b3ddf080 100644 --- a/src/utils/TorManager.cpp +++ b/src/utils/TorManager.cpp @@ -20,7 +20,12 @@ TorManager::TorManager(QObject *parent) connect(m_checkConnectionTimer, &QTimer::timeout, this, &TorManager::checkConnection); this->torDir = Config::defaultConfigDir().filePath("tor"); - this->torDataPath = QDir(this->torDir).filePath("data"); +#if defined(PLATFORM_INSTALLER) + // When installed, use directory relative to application path. + this->torDir = QDir(Utils::applicationPath()).filePath("tor"); +#endif + + this->torDataPath = Config::defaultConfigDir().filePath("tor/data"); m_process.setProcessChannelMode(QProcess::MergedChannels); @@ -164,6 +169,11 @@ bool TorManager::unpackBins() { this->torPath = QDir(this->torDir).filePath(torBin); +#if defined(PLATFORM_INSTALLER) + // We don't need to unpack if Tor was installed using the installer + return true; +#endif + SemanticVersion embeddedVersion = SemanticVersion::fromString(QString(TOR_VERSION)); SemanticVersion filesystemVersion = this->getVersion(torPath); qDebug() << QString("Tor versions: embedded %1, filesystem %2").arg(embeddedVersion.toString(), filesystemVersion.toString());