uses Registry;
procedure delphi_versions;
var regist: TRegistry;
pub: TStringList;
pubdir, pubbrc32, pubbrcc32:
string;
pubi: integer;
begin
regist := TRegistry.Create;
try
regist.RootKey := HKEY_LOCAL_MACHINE;
try
pub := TStringList.Create;
pubdir := '
';
pubbrc32 := '
';
pubbrcc32 := '
';
pubi := 0;
regist.OpenKey('
SOFTWARE\Borland\Delphi', false);
regist.GetKeyNames(pub);
regist.CloseKey;
for pubi := 0
to pub.count - 1
do
begin
regist.OpenKeyReadOnly('
SOFTWARE\Borland\Delphi\' + pub[pubi]);
if regist.ValueExists('
RootDir')
then
begin
pubdir := regist.ReadString('
RootDir');
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;
finally
end;
try
pub := TStringList.Create;
pubdir := '
';
pubbrc32 := '
';
pubbrcc32 := '
';
pubi := 0;
regist.OpenKey('
SOFTWARE\CodeGear\BDS', false);
regist.GetKeyNames(pub);
regist.CloseKey;
for pubi := 0
to pub.count - 1
do
begin
regist.OpenKeyReadOnly('
SOFTWARE\CodeGear\BDS\' + pub[pubi]);
if regist.ValueExists('
RootDir')
then
begin
pubdir := regist.ReadString('
RootDir');
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;
finally
end;
try
pub := TStringList.Create;
pubdir := '
';
pubbrc32 := '
';
pubbrcc32 := '
';
pubi := 0;
regist.OpenKey('
SOFTWARE\Borland\BDS', false);
regist.GetKeyNames(pub);
regist.CloseKey;
for pubi := 0
to pub.count - 1
do
begin
regist.OpenKeyReadOnly('
SOFTWARE\Borland\BDS\' + pub[pubi]);
if regist.ValueExists('
RootDir')
then
begin
pubdir := regist.ReadString('
RootDir');
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;
finally
end;
finally
regist.free;
end;
end;