From 419131091cb3385dffb21f4627b5719be31d9f83 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 27 Jul 2016 11:55:31 +0200 Subject: [PATCH] Changed: Delete installer files in TEMP directory after a reboot, see #279 --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index eec9d231e..1a4cf9f13 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -1118,8 +1118,6 @@ void COperationDialog::deleteComponentsInstaller() CConfigFile *config = CConfigFile::getInstance(); - // TODO: delete installer - deleteAddRemoveEntry(); // delete menu @@ -1132,7 +1130,22 @@ void COperationDialog::deleteComponentsInstaller() dir.removeRecursively(); } - // TODO: + path = config->getInstallerFullPath(); + QStringList files = config->getInstallerRequiredFiles(); + + foreach(const QString &file, files) + { + QString fullPath = path + "/" + file; + + // delete file + if (!QFile::remove(fullPath)) + { +#ifdef Q_OS_WIN32 + // under Windows, a running executable is locked, so we need to delete it later + MoveFileExW(qToWide(QDir::toNativeSeparators(fullPath)), NULL, MOVEFILE_DELAY_UNTIL_REBOOT); +#endif + } + } // reset it once it's done m_removeComponents.installer = false;