From 8338ff2a3498c870f0e1f2abfdaf6896f4bda40c Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 17 Oct 2016 11:23:49 +0200 Subject: [PATCH] Changed: Don't copy twice the same file under other platforms than Windows --- .../ryzom_installer/src/operationdialog.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 3b65152d3..702b445fe 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -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();