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.
This commit is contained in:
Alexei Kotov
2026-03-18 03:04:09 +03:00
parent 427da3cb90
commit b370bce480
+9 -9
View File
@@ -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);
}