diff --git a/CHANGES b/CHANGES index b5df6a2be..36adbc375 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 0.10.1: (Future) Other fixes: + - Qt: Manually split filename to avoid overzealous splitting (fixes mgba.io/i/2681) - Res: Fix species name location in Ruby/Sapphire revs 1/2 (fixes mgba.io/i/2685) 0.10.0: (2022-10-11) diff --git a/src/platform/qt/ApplicationUpdater.cpp b/src/platform/qt/ApplicationUpdater.cpp index ce752ecce..f26e58101 100644 --- a/src/platform/qt/ApplicationUpdater.cpp +++ b/src/platform/qt/ApplicationUpdater.cpp @@ -137,7 +137,15 @@ QUrl ApplicationUpdater::parseManifest(const QByteArray& manifest) { QString ApplicationUpdater::destination() const { QFileInfo path(updateInfo().url.path()); QDir dir(ConfigController::configDir()); - return dir.filePath(QLatin1String("update.") + path.completeSuffix()); + // QFileInfo::completeSuffix will eat all .'s in the filename...including + // ones in the version string, turning mGBA-1.0.0-win32.7z into + // 0.0-win32.7z instead of the intended .7z + // As a result, so we have to split out the complete suffix manually. + QString suffix(path.suffix()); + if (path.completeBaseName().endsWith(".tar")) { + suffix = "tar." + suffix; + } + return dir.filePath(QLatin1String("update.") + suffix); } const char* ApplicationUpdater::platform() {