mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 13:01:42 +00:00
Merge with develop
--HG-- branch : compatibility-develop
This commit is contained in:
commit
0238b30489
4 changed files with 23 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue