From 79fb112c889a6cdb13e6c7d03f8ad4923a34e9cd Mon Sep 17 00:00:00 2001 From: "avihal@gmail.com" Date: Thu, 30 Jun 2011 20:54:30 +0000 Subject: [PATCH] Games database: Load from the exe folder (only affects Install mode. Portable was already OK): Prevent DB-not-found error if previous version wasn't uninstalled properly. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4784 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/AppGameDatabase.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/AppGameDatabase.cpp b/pcsx2/gui/AppGameDatabase.cpp index 7fdd95ba46..635d526adc 100644 --- a/pcsx2/gui/AppGameDatabase.cpp +++ b/pcsx2/gui/AppGameDatabase.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "App.h" #include "AppGameDatabase.h" +#include class DBLoaderHelper { @@ -153,7 +154,21 @@ AppGameDatabase& AppGameDatabase::LoadFromFile(const wxString& _file, const wxSt { wxString file(_file); if( wxFileName(file).IsRelative() ) - file = (InstallFolder + file).GetFullPath(); + { + // InstallFolder is the preferred base directory for the DB file, but the registry can point to previous + // installs if uninstall wasn't done properly. + // Since the games DB file is considered part of pcsx2.exe itself, look for it at the exe folder + // regardless of any other settings. + + // Note 1: Portable setup didn't suffer from this as install folder pointed already to the exe folder in portable. + // Note 2: Other folders are either configurable (plugins, memcards, etc) or create their content automatically (inis) + // So the games DB was really the only one that suffers from residues of prior installs. + + //wxDirName dir = InstallFolder; + wxDirName dir = (wxDirName)wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath(); + file = ( dir + file ).GetFullPath(); + } + if (!wxFileExists(file)) {