Bill Meyer 337 Posted November 16, 2018 In the course of some project analysis, it has become apparent that we would benefit from exporting a list of all installed components in Delphi. I have found articles discussing how to obtain the list using the ToolsAPI, but that would mean building a package for a wizard, which is more of a side project than I was seeking. If anyone knows of an existing wizard which would provide the functionality, I would appreciate a lead. Bill Share this post Link to post
KodeZwerg 54 Posted November 16, 2018 uses ToolsApi; {....} var a, i: Integer; begin with (BorlandIDEServices as IOTAPackageServices) do begin for a := 0 to GetPackageCount - 1 do begin for i := 0 to GetComponentCount(a) - 1 do begin {get each component name with GetComponentName(a, i);} // DoSomething end; end; end; end; Something like that? Share this post Link to post
Uwe Raabe 2064 Posted November 16, 2018 You can also search the registry. The Package Cache key (like HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Package Cache) contains all installed packages with all its components. Share this post Link to post
Bill Meyer 337 Posted November 16, 2018 1 hour ago, Uwe Raabe said: You can also search the registry. The Package Cache key (like HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Package Cache) contains all installed packages with all its components. I will give that a try, Uwe, thanks. Share this post Link to post
haentschman 92 Posted November 17, 2018 Quote Something like that? ...no! Why whith "WITH"! Share this post Link to post
KodeZwerg 54 Posted November 17, 2018 1 hour ago, haentschman said: ...no! Why whith "WITH"! Okay. uses TypInfo, ToolIntf, Exptintf; ... procedure GetComponentNames(lst: TStrings); var i, k: Integer; CRef: TClass; strName: ShortString; begin lst.Clear; for i := 0 to ToolServices.GetModuleCount-1 do begin for k := 0 to ToolServices.GetComponentCount(i)-1 do begin CRef := TClass(GetClass(ToolServices.GetComponentName(i, k))); while CRef <> nil do begin strName := CRef.ClassName; if lst.IndexOf(strName) = -1 then lst.Add(strName); if str <> 'TComponent' then CRef := CRef.ClassParent else CRef := nil; end; end; end; end; Share this post Link to post
limelect 48 Posted November 17, 2018 (edited) There is a package manger expert i down loaded called 30127_source_for_an_add_in_to_easily_manage_packages_the_ide_loads.zip I transform it to an exe. Dose it help? I yes i can send you my project source. https://wiert.me/2016/06/08/known-ide-packages-in-delphi-prompted-by-a-comment-jeroen-wiert-pluimers-made/ Edited November 17, 2018 by limelect Share this post Link to post
Bill Meyer 337 Posted November 19, 2018 On 11/16/2018 at 4:16 PM, Uwe Raabe said: You can also search the registry. The Package Cache key (like HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Package Cache) contains all installed packages with all its components. As it happens, I need to run in XE7, where the key is this: HKEY_CURRENT_USER\Software\Embarcadero\BDS\15.0\ToolForm\Mapping. I also have an interest, though no absolute need, to run this in D2007, but I find no entry in the registry for such information. Has anyone committed a web page on the variations of such content in different versions? Share this post Link to post
Bill Meyer 337 Posted November 19, 2018 3 hours ago, KodeZwerg said: Does the code not work? Which code? You posted code for use in a package. I am now scanning the registry, and collecting from there with my own code, which works fine, though there are a few idiosyncrasies in the lists there. The point of my last post, though, was that although the registry scan is convenient, it is specific right now to XE7. And given the minor irregularities I have found in the entries there, it seems reasonable to anticipate irregularities in other versions, whether the same or different to these. In D2007, however, I find no evidence of installed components in the registry, so in the end, the ToolsAPI may be the only reliable approach. Share this post Link to post
Kryvich 165 Posted November 19, 2018 @Bill Meyer For Delphi 2007 you can find them here: HKEY_CURRENT_USER\Software\Borland\BDS\5.0\ToolForm\Mapping Share this post Link to post
KodeZwerg 54 Posted November 20, 2018 (edited) You can checkout https://github.com/KodeZwerg/versionselector to see how different delphi versions work with registry. All legit stuff from early up to Tokyo 10.2.3 is supported. Edited November 20, 2018 by KodeZwerg 2 Share this post Link to post