Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions jcl/source/common/JclIDEUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ TJclBorRADToolInstallations = class(TObject)
function GetBCBInstallationFromVersion(VersionNumber: Integer): TJclBorRADToolInstallation;
function GetDelphiInstallationFromVersion(VersionNumber: Integer): TJclBorRADToolInstallation;
protected
procedure AddInstallation(CreateClass: TJclBorRADToolInstallationClass; const VersionKeyName: string);
procedure ReadInstallations;
public
constructor Create;
Expand Down Expand Up @@ -5328,20 +5329,29 @@ function TJclBorRADToolInstallations.Iterate(TraverseMethod: TTraverseMethod): B
Result := Result and TraverseMethod(Installations[I]);
end;

procedure TJclBorRADToolInstallations.AddInstallation(CreateClass: TJclBorRADToolInstallationClass; const VersionKeyName: string);
var
Installation: TJclBorRADToolInstallation;
begin
Installation := CreateClass.Create(VersionKeyName);
if Installation.Valid then
FList.Add(Installation)
else
Installation.Free;
end;

procedure TJclBorRADToolInstallations.ReadInstallations;
var
VersionNumbers: TStringList;
PreviousRegWOW64AccessMode: TJclRegWOW64Access;

function EnumVersions(const KeyName: string; const Personalities: array of string;
CreateClass: TJclBorRADToolInstallationClass): Boolean;
procedure EnumVersions(const KeyName: string; const Personalities: array of string;
CreateClass: TJclBorRADToolInstallationClass);
var
I, J: Integer;
VersionKeyName, PersonalitiesKeyName: string;
PersonalitiesList: TStrings;
Installation: TJclBorRADToolInstallation;
begin
Result := False;
if RegKeyExists(HKEY_LOCAL_MACHINE, KeyName) and
RegGetKeyNames(HKEY_LOCAL_MACHINE, KeyName, VersionNumbers) then
for I := 0 to VersionNumbers.Count - 1 do
Expand All @@ -5352,13 +5362,7 @@ procedure TJclBorRADToolInstallations.ReadInstallations;
begin
if Length(Personalities) = 0 then
begin
try
Installation := CreateClass.Create(VersionKeyName);
if Installation.Valid then
FList.Add(Installation);
finally
Result := True;
end;
AddInstallation(CreateClass, VersionKeyName);
end
else
begin
Expand All @@ -5371,15 +5375,7 @@ procedure TJclBorRADToolInstallations.ReadInstallations;
for J := Low(Personalities) to High(Personalities) do
if PersonalitiesList.IndexOf(Personalities[J]) >= 0 then
begin
try
Installation := CreateClass.Create(VersionKeyName);
if Installation.Valid then
FList.Add(Installation)
else
Installation.Free;
finally
Result := True;
end;
AddInstallation(CreateClass, VersionKeyName);
Break;
end;
finally
Expand Down