File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,19 +37,21 @@ public class PostgresBinaryLocator : IPostgresBinaryLocator
3737
3838 var commonPaths = new [ ]
3939 {
40- @"C:\Program Files\PostgreSQL\*\bin " ,
41- @"C:\PostgreSQL\*\bin "
40+ @"C:\Program Files\PostgreSQL" ,
41+ @"C:\PostgreSQL"
4242 } ;
4343
44- foreach ( var pattern in commonPaths )
44+ foreach ( var basePath in commonPaths )
4545 {
46- var directory = Path . GetDirectoryName ( pattern ) ;
47- if ( directory != null && Directory . Exists ( directory ) )
46+ if ( Directory . Exists ( basePath ) )
4847 {
49- var files = Directory . GetFiles ( directory , $ "{ executableName } .exe", SearchOption . AllDirectories ) ;
50- if ( files . Length > 0 )
48+ foreach ( var versionDir in Directory . GetDirectories ( basePath ) )
5149 {
52- return files [ 0 ] ;
50+ var exePath = Path . Combine ( versionDir , "bin" , $ "{ executableName } .exe") ;
51+ if ( File . Exists ( exePath ) )
52+ {
53+ return exePath ;
54+ }
5355 }
5456 }
5557 }
You can’t perform that action at this time.
0 commit comments