From cb733675344f8b72770f7733c3ca3f9429cedfa0 Mon Sep 17 00:00:00 2001 From: dsc Date: Wed, 21 Oct 2020 17:56:39 +0200 Subject: [PATCH] Write proper .exe on Windows Signed-off-by: dsc --- src/utils/tor.cpp | 4 ++++ src/utils/xmrig.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils/tor.cpp b/src/utils/tor.cpp index 5eb0411..fcfff44 100644 --- a/src/utils/tor.cpp +++ b/src/utils/tor.cpp @@ -202,6 +202,10 @@ bool Tor::unpackBins() { QFile f(torFile); QFileInfo fileInfo(f); this->torPath = QDir(this->torDir).filePath(fileInfo.fileName()); +#if defined(Q_OS_WIN) + if(!this->torPath.endsWith(".exe")) + this->torPath += ".exe"; +#endif qDebug() << "Writing Tor executable to " << this->torPath; f.copy(torPath); f.close(); diff --git a/src/utils/xmrig.cpp b/src/utils/xmrig.cpp index e74431e..994d60e 100644 --- a/src/utils/xmrig.cpp +++ b/src/utils/xmrig.cpp @@ -122,13 +122,17 @@ bool XmRig::unpackBins() { QFile f(rigFile); QFileInfo fileInfo(f); this->rigPath = QDir(this->rigDir).filePath(fileInfo.fileName()); +#if defined(Q_OS_WIN) + if(!this->rigPath.endsWith(".exe")) + this->rigPath += ".exe"; +#endif qDebug() << "Writing XMRig executable to " << this->rigPath; f.copy(rigPath); f.close(); #if defined(Q_OS_UNIX) - QFile torBin(this->rigPath); - torBin.setPermissions(QFile::ExeGroup | QFile::ExeOther | QFile::ExeOther | QFile::ExeUser); + QFile rigBin(this->rigPath); + rigBin.setPermissions(QFile::ExeGroup | QFile::ExeOther | QFile::ExeOther | QFile::ExeUser); #endif return true; }