mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-30 07:35:59 +00:00
Changed: Don't copy twice the same file under other platforms than Windows
This commit is contained in:
parent
d776a00980
commit
8338ff2a34
1 changed files with 13 additions and 2 deletions
|
@ -734,13 +734,23 @@ void COperationDialog::copyInstaller()
|
||||||
|
|
||||||
if (!newInstallerFullPath.isEmpty())
|
if (!newInstallerFullPath.isEmpty())
|
||||||
{
|
{
|
||||||
|
QString srcDir = config->getSrcServerDirectory();
|
||||||
|
|
||||||
|
if (srcDir.isEmpty()) srcDir = config->getInstallerCurrentDirPath();
|
||||||
|
|
||||||
// always copy new installers
|
// always copy new installers
|
||||||
CFilesCopier copier(this);
|
CFilesCopier copier(this);
|
||||||
copier.setIncludeFilter(config->getInstallerRequiredFiles());
|
copier.setIncludeFilter(config->getInstallerRequiredFiles());
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
copier.addFile(oldInstallerFullPath);
|
copier.addFile(oldInstallerFullPath);
|
||||||
copier.setSourceDirectory(config->getSrcServerDirectory().isEmpty() ? QApplication::applicationDirPath():config->getSrcServerDirectory());
|
#endif
|
||||||
|
copier.setSourceDirectory(srcDir);
|
||||||
copier.setDestinationDirectory(config->getInstallationDirectory());
|
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
|
// copied file
|
||||||
oldInstallerFullPath = config->getInstallationDirectory() + "/" + QFileInfo(oldInstallerFullPath).fileName();
|
oldInstallerFullPath = config->getInstallationDirectory() + "/" + QFileInfo(oldInstallerFullPath).fileName();
|
||||||
|
@ -754,6 +764,7 @@ void COperationDialog::copyInstaller()
|
||||||
// rename new installer with final name
|
// rename new installer with final name
|
||||||
QFile::rename(oldInstallerFullPath, newInstallerFullPath);
|
QFile::rename(oldInstallerFullPath, newInstallerFullPath);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// create menu directory if defined
|
// create menu directory if defined
|
||||||
QString path = config->getMenuDirectory();
|
QString path = config->getMenuDirectory();
|
||||||
|
|
Loading…
Reference in a new issue