views:

393

answers:

1

How I can install multiple versions of a library in Delphi or C++Builder? For example, I might want to be able to develop the next version of our app using the current versions of JCL and JVCL while still being able to compile the release version of our app using whatever version of JCL and JVCL were tested for that release.

Using more than one version of a library is easy with libraries like Boost, since those are just header files and library / DLL files that I can put wherever I want, and so I can simply point my project files at the appropriate library directories. However, since libraries like JCL and JVCL try to install themselves into the IDE, I'm not sure how to configure different projects to use different versions without it turning into an unmanageable hack.

(I'm still not entirely familiar with how Delphi manages components and projects - most of my experience is in C++ - so this may be part of my problem.)

+5  A: 

We had the same problem, supporting older versions compiled with different versions of the components. Our solution was/is to use the IDE's " -r " command line option. With this switch it is possible to use different library paths and packages (at the same time). The only problem that we encountered with this approach was that some of us regularly tried to open an older project version in the wrong IDE instance.

[Old version 1.0] bds.exe -rVersion1.0
[trunk version  ] bds.exe

How to setup those:

  1. Start your IDE as you are used to it.
  2. Install everything you need for "Version 1.0"
  3. Close the IDE
  4. Install all (old) packages (JCL/JVCL/...)
  5. Start regedit.exe
  6. Export the registry key HKCU\Software\CodeGear\BDS\5.0 to a *.reg file
  7. Start nodepad.exe and do a search&replace in the *.reg file for "CodeGear\BDS\5.0" and replace it with "CodeGear\Version1.0\5.0"
  8. Import the *.reg file (by double clicking it in the Windows Explorer)
  9. Create a copy of your RAD Studio 2007 startmenu link and change the command line to include the "-rVersion1.0" key.

Now you have two IDE configurations that are equal. You can now change the IDE that doesn't use the " -r " command option to your trunk version's packages. When you install all the packages, you must not use the default BPL and DCP directories unless the different package versions use different file names (like the JCL and JVCL do).

CodeGear\BDS\5.0 = Delphi 2007
CodeGear\BDS\6.0 = Delphi 2009
Borland\BDS\4.0 = Delphi 2006
Borland\Delphi\7.0 = Delphi 7
Andreas Hausladen
You might also want to copy C:\Users\%UserName%\AppData\Roaming\Borland\BDS\5.0 to C:\Users\%UserName%\AppData\Roaming\Borland\Version1.0\5.0 to copy all the IDE settings, like layouts, favorites, etc. (this path is for Delphi 2007, 2009 is C:\Users\%UserName%\AppData\Roaming\CodeGear\BDS\6.0, and I believe 2006 is C:\Users\%UserName%\AppData\Local\Borland\BDS\4.0)
jasonpenny
Jeremy North also has an interesting tool called Delphi Configuration Manager that might help with this problem (http://www.jed-software.com/dcm.htm) - David Taylor
David Taylor