ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/client/include/wloadlibrary.inc
(Generate patch)

Comparing ibx/trunk/fbintf/client/include/wloadlibrary.inc (file contents):
Revision 263 by tony, Thu Dec 6 15:55:01 2018 UTC vs.
Revision 315 by tony, Thu Feb 25 11:56:36 2021 UTC

# Line 87 | Line 87 | begin
87  
88   //  writeln('Dir = ',InstallDir);
89    {If FIREBIRD environment variable available then try this}
90 <  if not IsValidHandle(FIBLibrary) then
90 >  if not IsValidHandle(FIBLibrary) and (oldFirebirdEV <> '') then
91    begin
92 <    InstallDir := GetEnvironmentVariable('FIREBIRD');
93 <    if (length(InstallDir) > 0) and (InstallDir[length(InstallDir)] <> DirectorySeparator) then
94 <      InstallDir := InstallDir + DirectorySeparator;
92 >    InstallDir := IncludeTrailingPathDelimiter(oldFirebirdEV);
93      if (InstallDir <> '') and FileExists(InstallDir + FIREBIRD_CLIENT) then
94      begin
95        //assume firebird.conf and firebird.msg in same dir
# Line 118 | Line 116 | begin
116      with TRegistry.Create do
117      try
118        RootKey := HKEY_LOCAL_MACHINE;
119 <      if OpenKey('SOFTWARE\Firebird Project\Firebird Server\Instances',false) then
119 >      if OpenKeyReadOnly('SOFTWARE\Firebird Project\Firebird Server\Instances') then
120        begin
121          if ValueExists('DefaultInstance') then
122          begin
123 <          InstallDir := ReadString('DefaultInstance')  + 'bin' + DirectorySeparator ;
123 >          InstallDir := IncludeTrailingPathDelimiter(ReadString('DefaultInstance')) ;
124            dllPathName := InstallDir + FIREBIRD_CLIENT;
125            Add2Path(InstallDir);
126 <          FIBLibrary := DoLoadLibrary(dllPathName)
126 >          FIBLibrary := DoLoadLibrary(dllPathName);
127 >          if not IsValidHandle(FIBLibrary) then
128 >          begin
129 >            InstallDir := InstallDir  + 'bin' + DirectorySeparator ;
130 >            dllPathName := InstallDir + FIREBIRD_CLIENT;
131 >            Add2Path(InstallDir);
132 >            FIBLibrary := DoLoadLibrary(dllPathName)
133 >          end;
134          end
135        end
136      finally
# Line 135 | Line 140 | begin
140      {Now try default install dir}
141      if not IsValidHandle(FIBLibrary) then
142      begin
143 <      InstallDir := GetSpecialFolder(CSIDL_PROGRAM_FILES) +
143 >      InstallDir := IncludeTrailingPathDelimiter(GetSpecialFolder(CSIDL_PROGRAM_FILES)) +
144 >        'Firebird' +
145 >        DirectorySeparator + 'Firebird_4_0' + DirectorySeparator;
146 >      dllPathName := InstallDir  + FIREBIRD_CLIENT;
147 >      Add2Path(InstallDir);
148 >      FIBLibrary := DoLoadLibrary(dllPathName)
149 >    end;
150 >
151 >    if not IsValidHandle(FIBLibrary) then
152 >    begin
153 >      InstallDir := IncludeTrailingPathDelimiter(GetSpecialFolder(CSIDL_PROGRAM_FILES)) +
154          'Firebird' +
155          DirectorySeparator + 'Firebird_3_0' + DirectorySeparator;
156        dllPathName := InstallDir  + FIREBIRD_CLIENT;
# Line 145 | Line 160 | begin
160  
161      if not IsValidHandle(FIBLibrary) then
162      begin
163 <      InstallDir := GetSpecialFolder(CSIDL_PROGRAM_FILES) +
163 >      InstallDir := IncludeTrailingPathDelimiter(GetSpecialFolder(CSIDL_PROGRAM_FILES)) +
164          'Firebird' +
165          DirectorySeparator + 'Firebird_2_5' +
166          DirectorySeparator + 'bin' + DirectorySeparator;
# Line 156 | Line 171 | begin
171  
172      if not IsValidHandle(FIBLibrary) then
173      begin
174 <      InstallDir := GetSpecialFolder(CSIDL_PROGRAM_FILES) +
174 >      InstallDir := IncludeTrailingPathDelimiter(GetSpecialFolder(CSIDL_PROGRAM_FILES)) +
175          'Firebird' +
176          DirectorySeparator + 'Firebird_2_1' +
177          DirectorySeparator + 'bin' + DirectorySeparator;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines