|
|
@ -713,23 +713,25 @@ void COperationDialog::copyInstaller()
|
|
|
|
QString oldInstallerFullPath = QApplication::applicationFilePath();
|
|
|
|
QString oldInstallerFullPath = QApplication::applicationFilePath();
|
|
|
|
QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename;
|
|
|
|
QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename;
|
|
|
|
|
|
|
|
|
|
|
|
if (!QFile::exists(newInstallerFullPath))
|
|
|
|
// always copy new installers
|
|
|
|
|
|
|
|
CFilesCopier copier(this);
|
|
|
|
|
|
|
|
copier.setIncludeFilter(config->getInstallerRequiredFiles());
|
|
|
|
|
|
|
|
copier.addFile(oldInstallerFullPath);
|
|
|
|
|
|
|
|
copier.setSourceDirectory(config->getSrcServerDirectory().isEmpty() ? QApplication::applicationDirPath():config->getSrcServerDirectory());
|
|
|
|
|
|
|
|
copier.setDestinationDirectory(config->getInstallationDirectory());
|
|
|
|
|
|
|
|
copier.exec();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// copied file
|
|
|
|
|
|
|
|
oldInstallerFullPath = config->getInstallationDirectory() + "/" + QFileInfo(oldInstallerFullPath).fileName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// rename old filename if different
|
|
|
|
|
|
|
|
if (oldInstallerFullPath != newInstallerFullPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CFilesCopier copier(this);
|
|
|
|
// delete previous installer
|
|
|
|
copier.setIncludeFilter(config->getInstallerRequiredFiles());
|
|
|
|
QFile::remove(newInstallerFullPath);
|
|
|
|
copier.addFile(oldInstallerFullPath);
|
|
|
|
|
|
|
|
copier.setSourceDirectory(config->getSrcServerDirectory().isEmpty() ? QApplication::applicationDirPath():config->getSrcServerDirectory());
|
|
|
|
// rename new installer with final name
|
|
|
|
copier.setDestinationDirectory(config->getInstallationDirectory());
|
|
|
|
QFile::rename(oldInstallerFullPath, newInstallerFullPath);
|
|
|
|
copier.exec();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// copied file
|
|
|
|
|
|
|
|
oldInstallerFullPath = config->getInstallationDirectory() + "/" + QFileInfo(oldInstallerFullPath).fileName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// rename old filename if different
|
|
|
|
|
|
|
|
if (oldInstallerFullPath != newInstallerFullPath)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QFile::rename(oldInstallerFullPath, newInstallerFullPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// create menu directory if defined
|
|
|
|
// create menu directory if defined
|
|
|
|