From 80cbda23e521ee507c8ae75bd72d0197c8ec64f6 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 18 Oct 2016 10:27:44 +0200 Subject: [PATCH] Merge with develop --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 2 +- .../client/ryzom_installer/src/configfile.cpp | 14 +++++++++++++- .../client/ryzom_installer/src/filesextractor.cpp | 9 +++++++-- .../tools/client/ryzom_installer/src/main.cpp | 4 ++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index ac70a7cd7..3f2dca9b6 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -622,7 +622,7 @@ bool CDriverGL::setupDisplay() checkForPerPixelLightingSupport(); #ifndef USE_OPENGLES - // if EXTVertexShader is used, bind the standard GL arrays, and allocate constant + // if EXTVertexShader is used, bind the standard GL arrays, and allocate constant if (!_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader) { _EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT); diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index a069331f3..babad9397 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -983,7 +983,19 @@ OperationStep CConfigFile::getInstallNextStep() const case -1: return LaunchInstalledInstaller; // continue only if 0 and launched Installer is the installed one - default: if (getInstallerCurrentFilePath() != getInstallerInstalledFilePath() && QFile::exists(getInstallerInstalledFilePath())) return LaunchInstalledInstaller; + default: + { +#ifdef Q_OS_WIN32 + QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + + // check if launched from TEMP directory + bool rightPath = getInstallerCurrentDirPath().startsWith(tempPath); +#else + bool rightPath = false; +#endif + + if (!rightPath && getInstallerCurrentFilePath() != getInstallerInstalledFilePath() && QFile::exists(getInstallerInstalledFilePath())) return LaunchInstalledInstaller; + } } // no default profile diff --git a/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp b/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp index e038d93bc..bdc092d04 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp @@ -448,8 +448,6 @@ bool CFilesExtractor::extract7z() // errors only occur when returned size is -1 if (currentProcessedSize < 0) { - error = QApplication::tr("Unable to write output file %1").arg(destPath); - res = SZ_ERROR_FAIL; break; } @@ -458,6 +456,13 @@ bool CFilesExtractor::extract7z() } while (currentSizeToProcess > 0); + if (offset != outSizeProcessed) + { + error = QApplication::tr("Unable to write output file %1 (%2 bytes written but expecting %3 bytes)").arg(destPath).arg(offset).arg(outSizeProcessed); + res = SZ_ERROR_FAIL; + break; + } + outFile.close(); totalUncompressed += SzArEx_GetFileSize(&db, i); diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 8d5f9b9da..4982fcad8 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); // check if launched from TEMP directory - if (step == Done && !QApplication::applicationDirPath().startsWith(tempPath)) + if (step == Done && !config.getInstallerCurrentDirPath().startsWith(tempPath)) { // try to delete all temporary installers QDir tempDir(tempPath); @@ -263,7 +263,7 @@ int main(int argc, char *argv[]) { #if defined(Q_OS_WIN) && !defined(_DEBUG) // restart Installer, so it could be copied in TEMP and allowed to update itself - if (QProcess::startDetached(QApplication::applicationFilePath())) return 0; + if (QProcess::startDetached(config.getInstallerInstalledFilePath())) return 0; #endif } }