From 626eba195df91fd97d204fb5d21757c0e902261b Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 27 Jul 2016 11:54:35 +0200 Subject: [PATCH] Changed: List all required files and copy them, see #279 --HG-- branch : develop --- .../client/ryzom_installer/CMakeLists.txt | 4 ++ .../ryzom_installer/res/ryzom_installer.png | Bin 0 -> 6646 bytes .../client/ryzom_installer/src/configfile.cpp | 45 ++++++++++++++++ .../client/ryzom_installer/src/configfile.h | 2 + .../tools/client/ryzom_installer/src/main.cpp | 35 ++++++++++++- .../ryzom_installer/src/operationdialog.cpp | 7 +-- .../client/ryzom_installer/src/utils.cpp | 49 ------------------ .../tools/client/ryzom_installer/src/utils.h | 2 - 8 files changed, 86 insertions(+), 58 deletions(-) create mode 100644 code/ryzom/tools/client/ryzom_installer/res/ryzom_installer.png diff --git a/code/ryzom/tools/client/ryzom_installer/CMakeLists.txt b/code/ryzom/tools/client/ryzom_installer/CMakeLists.txt index b096af884..2726ea489 100644 --- a/code/ryzom/tools/client/ryzom_installer/CMakeLists.txt +++ b/code/ryzom/tools/client/ryzom_installer/CMakeLists.txt @@ -51,3 +51,7 @@ IF(WITH_PCH) ENDIF() INSTALL(TARGETS ryzom_installer_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client) + +IF(UNIX AND NOT APPLE) + INSTALL(FILES res/ryzom_installer.png DESTINATION ${RYZOM_SHARE_PREFIX} COMPONENT client) +ENDIF() diff --git a/code/ryzom/tools/client/ryzom_installer/res/ryzom_installer.png b/code/ryzom/tools/client/ryzom_installer/res/ryzom_installer.png new file mode 100644 index 0000000000000000000000000000000000000000..67e3034ef83fc784834c7c42a375fcb816dcae5c GIT binary patch literal 6646 zcmV004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv0RI600RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru-wPKG2qhfh zDJTE{80ASsK~!kot(sYkWLbXJf9I}oV~@y)jNB`;Dr;Z5ySl5odse)R-7sV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ymMWPhnM#vX z%aYhkLeGwaeJhGLwKRRKlzdw$bra|SiBbyj9c1%85dgSSp2JyKA@!zM#fl~j!%?Vt z1!oh~^Qo?1kcPdI8rG~dtdcTJ6W!20yzn5AQi&{;T9zbwns`Q<42(4HYH8BeK9I>R zrPLizhaf^exa{(61^fR@;G6M6ZHe-+Q$)iadM>94UAKj%)qrIMCzKHD3bCeym{me6 zBgg?tD3uAN5}~9klIx;yrF*7SLF*-0XQLTSa0000bbVXQnWMOn= zI&E)cX=Zr$G&(RiIx{ybFflqXFtRBcga7~l07*qoM6N<$f)bne AegFUf literal 0 HcmV?d00001 diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 71dc77ca8..cb0ceed99 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -831,6 +831,51 @@ QString CConfigFile::getInstallerMenuLinkFullPath() const #endif } +QStringList CConfigFile::getInstallerRequiredFiles() const +{ + // list of all files required by installer (and its executable too) + QStringList files; + +#ifdef Q_OS_WIN + + // VC++ runtimes +#if _MSC_VER == 1900 + // VC++ 2015 + files << "msvcp140.dll"; + files << "msvcr140.dll"; +#elif _MSC_VER == 1800 + // VC++ 2013 + files << "msvcp120.dll"; + files << "msvcr120.dll"; +#elif _MSC_VER == 1700 + // VC++ 2012 + files << "msvcp110.dll"; + files << "msvcr110.dll"; +#elif _MSC_VER == 1600 + // VC++ 2010 + files << "msvcp100.dll"; + files << "msvcr100.dll"; +#elif _MSC_VER == 1500 + // VC++ 2008 + files << "msvcp90.dll"; + files << "msvcr90.dll"; +#else + // unsupported compiler +#endif + +#elif defined(Q_OS_MAC) + // TODO: for OS X +#else + // icon under Linux + files << "ryzom_installer.png"; +#endif + + // include current executable + files << QFileInfo(QApplication::applicationFilePath()).fileName(); + + return files; +} + QString CConfigFile::getSrcServerClientBNPFullPath() const { return QString("%1/unpack/exedll_%2.bnp").arg(getSrcServerDirectory()).arg(getClientArch()); diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index 2ac3070f2..de3440086 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -181,6 +181,8 @@ public: QString getInstallerFullPath() const; QString getInstallerMenuLinkFullPath() const; + QStringList getInstallerRequiredFiles() const; + QString getSrcServerClientBNPFullPath() const; OperationStep getInstallNextStep() const; diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index f46790110..82ab9939c 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -47,6 +47,39 @@ #define new DEBUG_NEW #endif +// copy all specified files from current directory to destination directory +bool copyInstallerFiles(const QStringList &files, const QString &destination) +{ + QString path = QApplication::applicationDirPath(); + + foreach(const QString &file, files) + { + // convert to absolute path + QString srcPath = path + "/" + file; + QString dstPath = destination + "/" + file; + + if (QFile::exists(srcPath)) + { + if (QFile::exists(dstPath)) + { + if (!QFile::remove(dstPath)) + { + qDebug() << "Unable to delete" << dstPath; + } + } + + if (!QFile::copy(srcPath, dstPath)) + { + qDebug() << "Unable to copy" << srcPath << "to" << dstPath; + + return false; + } + } + } + + return true; +} + int main(int argc, char *argv[]) { #if defined(_MSC_VER) && defined(_DEBUG) @@ -115,7 +148,7 @@ int main(int argc, char *argv[]) if (QApplication::applicationDirPath() != tempPath) { // copy installer and required files to TEMP directory - if (copyInstallerExecutable(tempPath)) + if (copyInstallerFiles(config.getInstallerRequiredFiles(), tempPath)) { QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index c24943f7d..eec9d231e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -715,13 +715,8 @@ void COperationDialog::copyInstaller() if (!QFile::exists(newInstallerFullPath)) { - QStringList filter; - filter << "msvcp100.dll"; - filter << "msvcr100.dll"; - filter << "ryzom_installer.png"; - CFilesCopier copier(this); - copier.setIncludeFilter(filter); + copier.setIncludeFilter(config->getInstallerRequiredFiles()); copier.addFile(oldInstallerFullPath); copier.setSourceDirectory(config->getSrcServerDirectory().isEmpty() ? QApplication::applicationDirPath():config->getSrcServerDirectory()); copier.setDestinationDirectory(config->getInstallationDirectory()); diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index 1e3c324a7..cdbadc246 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -239,52 +239,3 @@ bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathOb } #endif - -bool copyInstallerExecutable(const QString &destination) -{ - QString path = QApplication::applicationDirPath(); - - QStringList files; -#ifdef Q_OS_WIN - - // VC++ runtimes -#if _MSC_VER == 1900 - files << "msvcp140.dll"; - files << "msvcr140.dll"; -#else _MSC_VER == 1600 - files << "msvcp100.dll"; - files << "msvcr100.dll"; -#endif - -#else -#endif - - files << QFileInfo(QApplication::applicationFilePath()).fileName(); - - foreach(const QString &file, files) - { - // convert to absolute path - QString srcPath = path + "/" + file; - QString dstPath = destination + "/" + file; - - if (QFile::exists(srcPath)) - { - if (QFile::exists(dstPath)) - { - if (!QFile::remove(dstPath)) - { - qDebug() << "Unable to delete" << dstPath; - } - } - - if (!QFile::copy(srcPath, dstPath)) - { - qDebug() << "Unable to copy" << srcPath << "to" << dstPath; - - return false; - } - } - } - - return true; -} diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index 8072f69d6..363c30b9e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -51,6 +51,4 @@ wchar_t* qToWide(const QString &str); bool createLink(const QString &link, const QString &name, const QString &executable, const QString &arguments, const QString &icon, const QString &workingDir); bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathObj); -bool copyInstallerExecutable(const QString &destination); - #endif