Changed: Don't copy twice the same file under other platforms than Windows

This commit is contained in:
kervala 2016-10-17 11:23:49 +02:00
parent d776a00980
commit 8338ff2a34

View file

@ -734,13 +734,23 @@ void COperationDialog::copyInstaller()
if (!newInstallerFullPath.isEmpty())
{
QString srcDir = config->getSrcServerDirectory();
if (srcDir.isEmpty()) srcDir = config->getInstallerCurrentDirPath();
// always copy new installers
CFilesCopier copier(this);
copier.setIncludeFilter(config->getInstallerRequiredFiles());
#ifdef Q_OS_WIN32
copier.addFile(oldInstallerFullPath);
copier.setSourceDirectory(config->getSrcServerDirectory().isEmpty() ? QApplication::applicationDirPath():config->getSrcServerDirectory());
#endif
copier.setSourceDirectory(srcDir);
copier.setDestinationDirectory(config->getInstallationDirectory());
copier.exec();
if (!copier.exec()) return;
#ifdef Q_OS_WIN32
// only happens under Windows in Debug or when migrating
// copied file
oldInstallerFullPath = config->getInstallationDirectory() + "/" + QFileInfo(oldInstallerFullPath).fileName();
@ -754,6 +764,7 @@ void COperationDialog::copyInstaller()
// rename new installer with final name
QFile::rename(oldInstallerFullPath, newInstallerFullPath);
}
#endif
// create menu directory if defined
QString path = config->getMenuDirectory();