delphi - Return the library path of a specific platform using OTA -
i want library path specific platform (win32, win64, osx). but, when ask library path for, ota return me osx library path.
the code is:
environmentoptions := (borlandideservices iotaservices).getenvironmentoptions; paths.text := environmentoptions.values['librarypath'];
i noticed strange thing. when ask key values 3 librarypath.
when do:
environmentoptions.getoptionnames
i get:
... lot of values 'classcompletionbooleanaddinterface', tkenumeration 'librarypath', tklstring --> 1 'packagedploutput', tklstring ... lot of values 'librarypath', tklstring --> 2 'packagedploutput', tklstring ... lot of values 'hppoutputdirectory', tklstring 'librarypath', tklstring --> 3 'packagedploutput', tklstring ... lot of values
i think each key must represent 1 of possible targets have (win32, win64, osx). can call value of key it's name, return me first key founds, in case it's os x.
i'll not accept answer correct, it's option. didn't found possibility direct in ota looked on registry:
procedure getlibrarypath(paths: tstrings; platformname: string); var svcs: iotaservices; options: iotaenvironmentoptions; text: string; list: tstrings; valuecompiler: string; regread: tregistry; begin svcs := borlandideservices iotaservices; if not assigned(svcs) exit; options := svcs.getenvironmentoptions; if not assigned(options) exit; valuecompiler := svcs.getbaseregistrykey; regread := tregistry.create; list := tstringlist.create; try if platformname = '' text := options.getoptionvalue('librarypath') else begin regread.rootkey := hkey_current_user; regread.openkey(valuecompiler + '\library\' + platformname, false); text := regread.getdataasstring('search path'); end; list.text := stringreplace(text, ';', #13#10, [rfreplaceall]); paths.addstrings(list); if platformname = '' text := options.getoptionvalue('browsingpath') else begin regread.rootkey := hkey_current_user; regread.openkey(valuecompiler + '\library\' + platformname, false); text := regread.getdataasstring('browsing path'); end; list.text := stringreplace(text, ';', #13#10, [rfreplaceall]); paths.addstrings(list); regread.free; list.free; end; end;
Comments
Post a Comment