diff --git a/pgadmin/pgAdmin3.cpp b/pgadmin/pgAdmin3.cpp index e86f46c..5b794e5 100644 --- a/pgadmin/pgAdmin3.cpp +++ b/pgadmin/pgAdmin3.cpp @@ -880,6 +880,21 @@ void pgAdmin3::InitXtraPaths() #ifdef __WXMSW__ wxString programFiles = wxGetenv(wxT("ProgramFiles")); wxString programFilesX86 = wxGetenv(wxT("ProgramFiles(x86)")); + + // If we install a 32-bit pgAdmin in a 64-bit machine, + // We will be getting the both values as "Drive:\Program Files(x86)". + // Since, all 32-bit applications return "ProgramFiles" as ProgramFiles(x86). + // In that case, we need to remove the (x86) from that path, + // to look into the ProgramFiles as well for the pg_dump.exe + // + if (programFiles == programFilesX86) + { + wxString tmp; + if (programFiles.EndsWith(wxT("(x86)"), &tmp)) + { + programFiles = tmp; + } + } #endif // First, check and invalidate the paths if they're no good.