Qt: Fix error writing config on first launch

This commit is contained in:
Connor McLaughlin 2022-10-04 20:41:56 +10:00 committed by refractionpcsx2
parent 15b91fb6a4
commit 905e573520
1 changed files with 6 additions and 0 deletions

View File

@ -90,8 +90,14 @@ bool CommonHost::InitializeCriticalFolders()
// allow SetDataDirectory() to change settings directory (if we want to split config later on)
if (EmuFolders::Settings.empty())
{
EmuFolders::Settings = Path::Combine(EmuFolders::DataRoot, "inis");
// Create settings directory if it doesn't exist. If we're not using portable mode, it won't.
if (!FileSystem::DirectoryExists(EmuFolders::Settings.c_str()))
FileSystem::CreateDirectoryPath(EmuFolders::Settings.c_str(), false);
}
// Write crash dumps to the data directory, since that'll be accessible for certain.
CrashHandler::SetWriteDirectory(EmuFolders::DataRoot);