diff --git a/src/config.cpp b/src/config.cpp index 109119f0..813fb7f7 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -154,14 +154,26 @@ void Config::setupUserConfig() { // Config::getSkyFolder(type ...) QDir::setCurrent(getSkyFolder()); - // copy configs - QString localEtcPath = QString(PREFIX "/etc/skyscraper/"); + QString rpInst = "/opt/retropie/supplementary/skyscraper/Skyscraper"; + bool isRpInstall = QFileInfo(rpInst).isFile(); + QString manualInst = PREFIX "/Skyscraper"; + bool exeIsSymlink = QFileInfo(manualInst).isSymLink(); - if (!QFileInfo::exists(localEtcPath)) { + if (!exeIsSymlink && isRpInstall) { + printf("\033[1;31mDuplicate installation of Skyscraper found:\n%s " + "and\n%s\nPlease remove one or the other to avoid " + "confusion.\033[0m\n", + manualInst.toStdString().c_str(), rpInst.toStdString().c_str()); + exit(1); + } + + QString localEtcPath = QString(PREFIX "/etc/skyscraper/"); + if (!QFileInfo::exists(localEtcPath) || isRpInstall) { // RetroPie or Windows installation type: handled externally return; } + // copy configs QMap> configFiles = { {"ARTWORK.md", QPair("", FileOp::OVERWRITE)}, {"artwork.xml.example1", QPair("", FileOp::OVERWRITE)},