procedure delphi_versionadd(ort:
string);
var regist: TRegistry;
pub: TStringList;
pubdir, pubbrc32, pubbrcc32:
string;
pubi: integer;
begin
regist := TRegistry.Create;
try
regist.RootKey := HKEY_LOCAL_MACHINE;
pub := TStringList.Create;
regist.OpenKey(ort, false);
regist.GetKeyNames(pub);
regist.CloseKey;
if pub.count > 0
then
begin
for pubi := 0
to pub.count - 1
do
begin
regist.OpenKeyReadOnly(ort + '
\' + pub[pubi]);
if regist.ValueExists('
RootDir')
then
begin
pubdir := regist.ReadString('
RootDir');
regist.CloseKey;
if pubdir[length(pubdir)] = '
\'
then
pubdir := pubdir + '
Bin\'
else
if pubdir[length(pubdir)] = '
/'
then
pubdir := pubdir + '
Bin/'
else
pubdir := pubdir + '
\Bin\';
if FileExists(pubdir + '
brc32.exe')
then
pubbrc32 := pubdir + '
brc32.exe';
if FileExists(pubdir + '
brcc32.exe')
then
pubbrcc32 := pubdir + '
brcc32.exe';
additem(pub[pubi], pubbrc32, pubbrcc32);
end;
end;
end;
finally
regist.free;
pub.Free;
end;
end;
procedure delphi_versions;
begin
delphi_versionadd('
SOFTWARE\Borland\Delphi');
delphi_versionadd('
SOFTWARE\Borland\BDS');
delphi_versionadd('
SOFTWARE\CodeGear\BDS');
end;