diff --git a/launcher/InstanceImportTask.cpp b/launcher/InstanceImportTask.cpp index 04600daa9..d3cc3bd02 100644 --- a/launcher/InstanceImportTask.cpp +++ b/launcher/InstanceImportTask.cpp @@ -113,18 +113,26 @@ QString InstanceImportTask::getRootFromZip(QStringList files) if (!isRunning()) { return {}; } + auto cleanPath = [](QString path) { + if (path == ".") + return QString(); + QString result = path; + if (result.startsWith("./")) + result = result.mid(2); + return result; + }; for (auto&& fileName : files) { setDetails(fileName); QFileInfo fileInfo(fileName); if (fileInfo.fileName() == "instance.cfg") { qDebug() << "MultiMC:" << true; m_modpackType = ModpackType::MultiMC; - return fileInfo.path(); + return cleanPath(fileInfo.path()); } if (fileInfo.fileName() == "manifest.json") { qDebug() << "Flame:" << true; m_modpackType = ModpackType::Flame; - return fileInfo.path(); + return cleanPath(fileInfo.path()); } QCoreApplication::processEvents(); } diff --git a/launcher/archive/ArchiveWriter.cpp b/launcher/archive/ArchiveWriter.cpp index c0028d365..4f01e7cea 100644 --- a/launcher/archive/ArchiveWriter.cpp +++ b/launcher/archive/ArchiveWriter.cpp @@ -56,7 +56,7 @@ bool ArchiveWriter::open() } else if (lowerName.endsWith(".tar.xz") || lowerName.endsWith(".txz")) { archive_write_set_format_pax_restricted(m_archive); archive_write_add_filter_xz(m_archive); - } else if (lowerName.endsWith(".zip") || lowerName.endsWith(".jar")) { + } else if (lowerName.endsWith(".zip") || lowerName.endsWith(".jar") || lowerName.endsWith(".mrpack")) { archive_write_set_format_zip(m_archive); } else if (lowerName.endsWith(".tar")) { archive_write_set_format_pax_restricted(m_archive);