Length of search path

As I have installed quite a lot of the TMS products, my search path reaches max length and the last entries are ignored. So I wanted to use env variables - eg $(TMS) - to shorten the paths of the TMS source files), but I recall, that this caused problems when reinstalling/updating TMS products, having finally duplicated all paths.

Is this still a problem?
How can I shorten the used paths?

Thank you!
Regards Bernd

Hi,
There are 2 search paths to worry about, I am not sure which one you refer to.

The first one is the Windows Path. This is the most critical one, since it has a very low limit (not an exact limit, because the string is compressed, but about 2048 characters), and yes, you are likely to very soon start having the last entries in the path ignored.

But tms installers shouldn't be a problem here. The old ones have, for a long time, used the delphi default bpl folder (which is added to the path when you install delphi), and the installers won't add any new ones.
The new installers (smartsetup) do add a single entry to the Windows Path, but all tms products put the bpls in that single folder, so even if you install all tms products, it won't add much to the Windows path.

The second one is the Library path in Delphi. Our installers add an entry for each product, so the library path can get large. But it normally doesn't matter, because the Library path doesn't have a hard limit when compiling from Delphi itself, and it has a 32k limit when compiling using msbuild, so you aren't likely to have issues with the library path.

In any case, using $(TMS) instead of the full path doesn't help at all: Those variables will be expanded when you call from the command line, and you will still have the full length to deal with. The 32k limit when compiling from tms build (the case you can most likely get errors) will be the same is you use $(TMS) or the expanded path. The windows path is the same too, so there is no real advantage to use variables like $(TMS). In fact, I used to use them in my old FlexCel installers, but they made the paths more obfuscated (you couldn't just copy and paste them in explorer, you had to substitute all variables first), and there was no real advantage in using them. So for the new installers we left them out. We could easily put them back as an option, but as said, there is no real reason to do so, they don't help.

So in summary:

  1. For the Windows Path there shouldn't be a big problem, as all tms products only use one single entry on the path.
  2. For the library path there could be a problem if you are compiling from the command line and using all the tms products, but using env variables won't help.

For problem 2 we plan to create some "dcu megafolders" where all tms products put their dcus in the same folders, so only one entry will be added to the library path too. But that isn't ready yet.

Thanks, Adrian, for your answer.

I meant the Library Path in Delphi and I stumbled about this, when installing some 3rd party libs which needed compiling from the command line. I worked around this by temporarily modifying the library path.