From b370bce4806d3201c69fcf389933e10908a1f57b Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Wed, 18 Mar 2026 03:04:09 +0300 Subject: [PATCH] Restore data directory root Morrowind.ini detection This turned out to be relevant for those data directories that were generated by the wizard from a retail disc. Note the initial disc installation doesn't need to be registered as an installation because of the special case when the settings importer is run. --- apps/wizard/mainwizard.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index 2392bb31e8..755f83fcb2 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -239,15 +239,15 @@ void Wizard::MainWizard::addInstallation(const QString& path) install.hasTribunal = findFiles(QStringLiteral("Tribunal"), path); install.hasBloodmoon = findFiles(QStringLiteral("Bloodmoon"), path); - // Try to autodetect the Morrowind.ini location - // The installation path is the Data Files directory, - // so the INI should be located in the parent directory. - if (dir.cdUp()) - { - const QFile file(dir.filePath(QStringLiteral("Morrowind.ini"))); - if (file.exists()) - install.iniPath = file.fileName(); - } + QFile file(dir.filePath(QStringLiteral("Morrowind.ini"))); + + // Try the parent directory + // In normal Morrowind installations that's where Morrowind.ini is + if (!file.exists() && dir.cdUp()) + file.setFileName(dir.filePath(QStringLiteral("Morrowind.ini"))); + + if (file.exists()) + install.iniPath = file.fileName(); mInstallations.insert(QDir::toNativeSeparators(path), install); }