From 4fc06a0c633aa88c79b17d2082530d752ceabc20 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 1 Oct 2016 13:10:05 +0200 Subject: [PATCH] Merge with develop --- .../client/ryzom_installer/src/configfile.cpp | 6 +++--- .../ryzom_installer/src/migratedialog.cpp | 5 ++--- .../tools/client/ryzom_installer/src/utils.cpp | 18 ++++++++++++++++++ .../tools/client/ryzom_installer/src/utils.h | 1 + .../translations/ryzom_installer_de.ts | 16 ++++++++-------- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index c9ca60b9e..b18e0ad36 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -676,7 +676,7 @@ bool CConfigFile::shouldCreateDesktopShortcut() const QString shortcut = profile.getClientDesktopShortcutFullPath(); - return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(shortcut)); + return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(appendLinkExtension(shortcut))); } bool CConfigFile::shouldCreateMenuShortcut() const @@ -687,7 +687,7 @@ bool CConfigFile::shouldCreateMenuShortcut() const QString shortcut = profile.getClientMenuShortcutFullPath(); - return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(shortcut)); + return !shortcut.isEmpty() && !NLMISC::CFile::isExists(qToUtf8(appendLinkExtension(shortcut))); } bool CConfigFile::shouldCopyInstaller() const @@ -749,7 +749,7 @@ QStringList CConfigFile::getInstallerRequiredFiles() const #if _MSC_VER == 1900 // VC++ 2015 files << "msvcp140.dll"; - files << "msvcr140.dll"; + files << "vcrunrime140.dll"; #elif _MSC_VER == 1800 // VC++ 2013 files << "msvcp120.dll"; diff --git a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp index b930d39cc..0395a90dd 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp @@ -119,9 +119,8 @@ void CMigrateDialog::accept() // check free disk space qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData()); - const CServer &server = CConfigFile::getInstance()->getServer(); - - if (freeSpace < server.dataUncompressedSize) + // compare with exact size of current directory + if (freeSpace < getDirectorySize(m_currentDirectory, true)) { QMessageBox::StandardButton res = QMessageBox::warning(this, tr("Not enough free disk space"), tr("You don't have enough free space on this disk, please make more space or choose a directory on another disk.")); return; diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index a06ca053b..c4c9e3a02 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -282,6 +282,24 @@ bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathOb #endif +QString appendLinkExtension(const QString &link) +{ + QString extension; + +#ifdef Q_OS_WIN32 + extension = ".lnk"; +#elif Q_OS_MAC + // TODO +#else + extension = ".desktop"; +#endif + + // already the good extension + if (link.indexOf(extension) > -1) return link; + + return link + extension; +} + QString getVersionFromExecutable(const QString &path) { // launch executable with --version argument diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index 1ad94b24b..e5df1812d 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -52,6 +52,7 @@ 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); +QString appendLinkExtension(const QString &link); QString getVersionFromExecutable(const QString &path); diff --git a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts index 986d27d4b..9b7178086 100644 --- a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts +++ b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts @@ -104,22 +104,22 @@ Unable to write in directory - + In das Verzeichnis konnte nicht geschrieben werden You don't have the permission to write in this directory with your current user account, please choose another directory. - + Du hast nicht die Berechtigungen, um mit deinem derzeitigen Benutzer-Konto in dieses Verzeichnis zu schreiben, bitte wähle ein anderes Verzeichnis. Directory not empty - + Verzeichnist ist nicht leer This directory is not empty, please choose another one. - + Dieses Verzeichnis ist nicht leer, bitte wähle ein anderes. @@ -175,22 +175,22 @@ Unable to write in directory - + Kann nicht in dieses Verzeichnis schreiben You don't have the permission to write in this directory with your current user account, please choose another directory. - + Du hast nicht die Berechtigungen, mit deinem derzeitigen Benutzer-Konto in dieses Verzeichnis zu schreiben, bitte wähle ein anderes Verzeichnis. Directory not empty - + Verzeichnis ist nicht leer This directory is not empty, please choose another one. - + Dieses Verzeichnis ist nicht leer, bitte wähle ein anderes.