سؤال

I have the following code which tries to detect Delphi installations using JclIDEUtils. To test it I set up two Virtual machines, both run Win 7 and in both systems I installed Delphi XE3 but in VM n1 I installed Jcl also, in VM n2 I didn't. Well, in n1 my little prog works fine and finds Delphi XE3, in n2 it doesn't! I tried to remote debug the program in both VMs but the only one thing I understood is that the object which instanciates the TJclBorRADToolInstallations class simply remains empty if Jcl is not installed.

This is my code in OnShow event of my form:

procedure TForm1.FormShow(Sender: TObject);
var
  I, X: Integer;
  TN, SubTn: TTreeNode;
  IconIndex: Integer;
begin
  FDelphiInstallations := TJclBorRADToolInstallations.Create;
  for I := 0 to FDelphiInstallations.Count - 1 do
  begin
    IconIndex := ilDelphiIcons.AddIcon(GetSmallIcon(FDelphiInstallations[I].IdeExeFileName));
   TN := tvDisplay.Items.AddChild(nil, FDelphiInstallations[I].Name);
   TN.ImageIndex := ilDelphiIcons.Count - 1;
   TN.SelectedIndex := ilDelphiIcons.Count - 1;
   with tvDisplay.Items do
   begin
    SubTn := AddChild(TN, 'Description: ' + FDelphiInstallations[I].Description);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'Root directory: ' + FDelphiInstallations[I].RootDir);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'Projects directory: '+ FDelphiInstallations[i].DefaultProjectsDir);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'Common Projects directory: '+ FDelphiInstallations[i].CommonProjectsDir);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'Executable File name: '+ FDelphiInstallations[i].IdeExeFileName);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'Build number: '+ FDelphiInstallations[i].IdeExeBuildNumber);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'VersionNumberStr='+ FDelphiInstallations[i].VersionNumberStr);
    SubTn.ImageIndex := 0;
    SubTn := AddChild(TN, 'Registry key='+ FDelphiInstallations[i].ConfigDataLocation);
    SubTn.ImageIndex := 0;
    for X := 0 to FDelphiInstallations[i].IdePackages.Count - 1 do
    begin
      SubTn := AddChild(TN, 'Description: ' + FDelphiInstallations[I].IdePackages.PackageFileNames[X]);
      SubTn.ImageIndex := 0;
    end;
  end;
end;
end;

Does someone know something about this issue?

Thanks in advance for any advice.

هل كانت مفيدة؟

المحلول

Jcl failed to detect Delphi installation because I didn't run Delphi. Once I ran Delphi, JclIDEUtils detects its installation and my testing program succeed in displaying Delphi installation data.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top