0049-89-49053501 support@wptools.de

How to install multiple versions of Delphi on the same machine

As a component developer I have to install all recent Versions of Delphi on the same machine. This is required to run a script which creates the object files required by the customers. There are still numerous customers who use Delphi 5 – no wonder, it was stable and creates compact applications and why change a running system?

In general it is not a problem to install different Delphi (or RAD Studio) versions side by side. But I recommend not to install them under “Program Files” but into a custom folder, such as “C:\Embarcadero\”. Also installing components into “Program Files” is not such a good idea, since this folder is write protected since Windows 7.

But, anyway, after installing several IDEs (not just Delphi) you will run eventually into an unexpected problem. This is the global search path, the environment variable “PATH”. That search path is used to locate modules (such as DLLs or BPLs) which are not found in the home directory of an application. Unfortunately the maximum length for the contents of PATH is limited to 255(!) characters only. You can imagine how soon these few bytes are filled after some applications added “their” path to it. I also noticed that some components add the path to their runtime BPLs here. If you install those components under “C:\Program Files\Company Name\Special Component Name\BPL” this will use a lot of bytes in the PATH. (BTW.: WPTools does not do this)

So what is the solution? You can manually edit PATH by selection “System” in the Windows control center and there open “Extended System properties” and within the dialog “System variables” (German: “Umgebungsvariablen”).

    Do this at your own risk!

Copy the value of “PATH” to an editor which does not add carriage returns. You can use WPTools, TextDynamic or NotePad++, but not the regular Notepad. Please make a backup copy of this path to a TXT file. Now you can check which parts of the text are used very often, naturally this will be “C:\Program Files\” – but you will also find also other texts. You can replace each instance of a certain phrase with a system variable, i.e. replace “C:\Embarcadero” with “%EMB%” within the editor. You need to remember the name of the variable and the string it should represent. Since, after you have copied back the edited PATH text into its place as a system variable, you need to create new system variables to fill in the missing pieces, i.e. EMB=C:\Embarcadero.

Using this technique I installed Delphi 5 to Delphi XE8, Eclipse, different Visual Studios and various tools. So far I have no problems and I am not aware of any significant bad sideffects of the workaround mentioned above. If you experience one, please drop me a line (support@wptools.de) and I will add a note here. One effect I noticed though, is that some installers or applications will try to add “their” path again, since they are not able to evaluate the substitution with a different system variable.

If, for some reason, the technique does not work for you, please copy back the copy of the original PATH which you have saved to a file as backup.