From e0eb97922d5ef4a1448e76f13374ebfda7fda403 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 27 Mar 2013 20:48:33 +0100 Subject: - added hooks for getFileVersion* functions - automatic donwload retry - support for storing multiple download urls - improved "query info" functionality - some cleanup to download manager code - external fomod installer dialog are now brought to front - added shell... functions to have windows handle problematic situations - added visual clue when filters are active - esps are now automatically activated when installing a mod - added option to never endorse a mod - added "previous" and "next" buttons to mod info dialog - improved the way messagedialog text is shortened - coloring in mod info dialog now visible in other color schemes - plugin list is now saved automatically - vanilla bsas are now enabled even if they are not listed in the ini file - bugfix: setting mod to maximum now doesn't try to place the mod below overwrite --- src/selfupdater.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/selfupdater.cpp') diff --git a/src/selfupdater.cpp b/src/selfupdater.cpp index 503c2596..78c7dea7 100644 --- a/src/selfupdater.cpp +++ b/src/selfupdater.cpp @@ -90,10 +90,10 @@ SelfUpdater::~SelfUpdater() void SelfUpdater::testForUpdate() { -/* if (QFile::exists(QCoreApplication::applicationDirPath() + "/mo_test_update.7z")) { + if (QFile::exists(QCoreApplication::applicationDirPath() + "/mo_test_update.7z")) { emit updateAvailable(); return; - }*/ + } if (m_UpdateRequestID == -1) { m_UpdateRequestID = m_Interface->requestDescription( @@ -104,11 +104,11 @@ void SelfUpdater::testForUpdate() void SelfUpdater::startUpdate() { -/* if (QFile::exists(QCoreApplication::applicationDirPath() + "/mo_test_update.7z")) { + if (QFile::exists(QCoreApplication::applicationDirPath() + "/mo_test_update.7z")) { m_UpdateFile.setFileName(QCoreApplication::applicationDirPath() + "/mo_test_update.7z"); installUpdate(); return; - }*/ + } if ((m_UpdateRequestID == -1) && (!m_NewestVersion.isEmpty())) { @@ -243,9 +243,13 @@ void SelfUpdater::installUpdate() } else if (outputName == "ModOrganizer") { data[i]->setSkip(true); } - QFile file(mopath.mid(0).append("/").append(outputName)); - if (file.exists()) { - file.rename(backupPath.mid(0).append("/").append(outputName)); + QFileInfo file(mopath.mid(0).append("/").append(outputName)); + if (file.exists() && file.isFile()) { + if (!shellMove(QStringList(mopath.mid(0).append("/").append(outputName)), + QStringList(backupPath.mid(0).append("/").append(outputName)))) { + reportError(tr("failed to move outdated files: %1. Please update manually.").arg(windowsErrorString(::GetLastError()))); + return; + } } } -- cgit v1.3.1