From afb07586d37d6ff0787811b4c1c26e4bce5c3ac6 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 20 Sep 2016 17:43:08 +0200 Subject: [PATCH] Changed: Delete previously copied Ryzom Installer from TEMP directory, see #279 --HG-- branch : develop --- .../tools/client/ryzom_installer/src/main.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 8fa43c3d8..9bbb26e50 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -149,8 +149,23 @@ int main(int argc, char *argv[]) QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); // check if launched from TEMP directory - if (step == Done && QApplication::applicationDirPath() != tempPath) + if (step == Done && !QApplication::applicationDirPath().startsWith(tempPath)) { + // try to delete all temporary installers + QDir tempDir(tempPath); + + QStringList filter; + filter << "ryzom_installer_*"; + + QStringList dirs = tempDir.entryList(filter, QDir::Dirs); + + foreach(const QString &dir, dirs) + { + QDir(dir).removeRecursively(); + } + + tempPath += QString("/ryzom_installer_%1").arg(QDateTime::currentMSecsSinceEpoch()); + // copy installer and required files to TEMP directory if (copyInstallerFiles(config.getInstallerRequiredFiles(), tempPath)) {