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 |
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 |
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; |
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; |
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; |