Changed: Delete installer files in TEMP directory after a reboot, see #279

This commit is contained in:
kervala 2016-07-27 11:55:31 +02:00
parent 1b3c882d3a
commit b308063431

View file

@ -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;