Changed: Launch upgrade script from 7z or ZIP archives if present, see #279
--HG-- branch : develop
This commit is contained in:
parent
d2e3a795d8
commit
b4f1f0868c
2 changed files with 17 additions and 6 deletions
|
@ -553,9 +553,11 @@ void COperationDialog::extractDownloadedClient()
|
||||||
m_currentOperation = tr("Extract client files required by server %1").arg(server.name);
|
m_currentOperation = tr("Extract client files required by server %1").arg(server.name);
|
||||||
m_currentOperationProgressFormat = tr("Extracting %1...");
|
m_currentOperationProgressFormat = tr("Extracting %1...");
|
||||||
|
|
||||||
|
QString destinationDirectory = server.getDirectory();
|
||||||
|
|
||||||
CFilesExtractor extractor(this);
|
CFilesExtractor extractor(this);
|
||||||
extractor.setSourceFile(config->getInstallationDirectory() + "/" + config->expandVariables(server.clientDownloadFilename));
|
extractor.setSourceFile(config->getInstallationDirectory() + "/" + config->expandVariables(server.clientDownloadFilename));
|
||||||
extractor.setDestinationDirectory(server.getDirectory());
|
extractor.setDestinationDirectory(destinationDirectory);
|
||||||
|
|
||||||
if (extractor.exec())
|
if (extractor.exec())
|
||||||
{
|
{
|
||||||
|
@ -564,6 +566,8 @@ void COperationDialog::extractDownloadedClient()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
launchUpgradeScript(destinationDirectory, server.clientFilename);
|
||||||
|
|
||||||
emit done();
|
emit done();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -652,7 +656,14 @@ void COperationDialog::extractBnpClient()
|
||||||
extractor.setDestinationDirectory(destinationDirectory);
|
extractor.setDestinationDirectory(destinationDirectory);
|
||||||
extractor.exec();
|
extractor.exec();
|
||||||
|
|
||||||
QString upgradeScript = destinationDirectory + "/upgd_nl.";
|
launchUpgradeScript(destinationDirectory, server.clientFilename);
|
||||||
|
|
||||||
|
emit done();
|
||||||
|
}
|
||||||
|
|
||||||
|
void COperationDialog::launchUpgradeScript(const QString &directory, const QString &executable)
|
||||||
|
{
|
||||||
|
QString upgradeScript = directory + "/upgd_nl.";
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
upgradeScript += "bat";
|
upgradeScript += "bat";
|
||||||
|
@ -665,9 +676,9 @@ void COperationDialog::extractBnpClient()
|
||||||
QProcess process;
|
QProcess process;
|
||||||
|
|
||||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
env.insert("RYZOM_CLIENT", QDir::toNativeSeparators(destinationDirectory + "/" + server.clientFilename));
|
env.insert("RYZOM_CLIENT", QDir::toNativeSeparators(directory + "/" + executable));
|
||||||
env.insert("UNPACKPATH", QDir::toNativeSeparators(destinationDirectory + "/unpack"));
|
env.insert("UNPACKPATH", QDir::toNativeSeparators(directory + "/unpack"));
|
||||||
env.insert("ROOTPATH", QDir::toNativeSeparators(destinationDirectory));
|
env.insert("ROOTPATH", QDir::toNativeSeparators(directory));
|
||||||
env.insert("STARTUPPATH", "");
|
env.insert("STARTUPPATH", "");
|
||||||
process.setProcessEnvironment(env);
|
process.setProcessEnvironment(env);
|
||||||
|
|
||||||
|
@ -694,7 +705,6 @@ void COperationDialog::extractBnpClient()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit done();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void COperationDialog::copyInstaller()
|
void COperationDialog::copyInstaller()
|
||||||
|
|
|
@ -132,6 +132,7 @@ protected:
|
||||||
virtual bool operationShouldStop();
|
virtual bool operationShouldStop();
|
||||||
|
|
||||||
void renamePartFile();
|
void renamePartFile();
|
||||||
|
void launchUpgradeScript(const QString &directory, const QString &executable);
|
||||||
|
|
||||||
// hacks to prevent an infinite loop
|
// hacks to prevent an infinite loop
|
||||||
void acceptDelayed();
|
void acceptDelayed();
|
||||||
|
|
Loading…
Reference in a new issue