summaryrefslogtreecommitdiffstats
path: root/logic/updater
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-21 14:25:16 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-21 14:25:16 +0100
commit01dbebdfc81abab00048f48e68a4e04d391bc50e (patch)
tree861e08b1158467b5e5894548ed72c35fc1b44317 /logic/updater
parent0f6ad12fd8d4b1b727891f6fa0fb69f09f64e827 (diff)
downloadMultiMC-01dbebdfc81abab00048f48e68a4e04d391bc50e.tar
MultiMC-01dbebdfc81abab00048f48e68a4e04d391bc50e.tar.gz
MultiMC-01dbebdfc81abab00048f48e68a4e04d391bc50e.tar.lz
MultiMC-01dbebdfc81abab00048f48e68a4e04d391bc50e.tar.xz
MultiMC-01dbebdfc81abab00048f48e68a4e04d391bc50e.zip
Fix issues with the updater
* Bad URLs used for downloading update files * MD5ETagDownload resetting the expected ETag after failure to the failed file MD5 checksum * Delete MD5ETagDownload downloaded files if the download fails.
Diffstat (limited to 'logic/updater')
-rw-r--r--logic/updater/DownloadUpdateTask.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/logic/updater/DownloadUpdateTask.cpp b/logic/updater/DownloadUpdateTask.cpp
index cc06104a..b017afeb 100644
--- a/logic/updater/DownloadUpdateTask.cpp
+++ b/logic/updater/DownloadUpdateTask.cpp
@@ -396,7 +396,6 @@ DownloadUpdateTask::processFileLists(NetJob *job,
// We need to download the file to the updatefiles folder and add a task
// to copy it to its install path.
auto download = MD5EtagDownload::make(source.url, dlPath);
- download->m_check_md5 = true;
download->m_expected_md5 = entry.md5;
job->addNetAction(download);
}
@@ -487,9 +486,13 @@ bool DownloadUpdateTask::writeInstallScript(UpdateOperationList &opsList, QStrin
QString DownloadUpdateTask::preparePath(const QString &path)
{
- QString foo = path;
- foo.replace("$PWD", qApp->applicationDirPath());
- return QUrl::fromLocalFile(foo).toString(QUrl::FullyEncoded);
+ if(path.startsWith("$PWD"))
+ {
+ QString foo = path;
+ foo.replace("$PWD", qApp->applicationDirPath());
+ return QUrl::fromLocalFile(foo).toString(QUrl::FullyEncoded);
+ }
+ return path;
}
void DownloadUpdateTask::fileDownloadFinished()