Gonzalo Fernandez 0 Posted March 27, 2023 (edited) Hi, I have a customized project version of my product per each customer. When a component vendor releases a new version of their component I would like to use it in just one customer, and after extensive testing I would decide if implementing it in other customer versions makes sense. Is there a way to deal with several complete component setups in a single delphi installation? If not directly, is there a way to automate (ie a .bat script) the changing of all the configuration files involved in the setup, going forward and backwards according to the project I need to deal with at the moment? Any other strategies helping to handle my needs of specific component sets per customer are welcome! TIA Edited March 27, 2023 by Gonzalo Fernandez Share this post Link to post
programmerdelphi2k 237 Posted March 27, 2023 (edited) I dont know if I understood... but the RAD allow that run a session with a new name (like MSWin login user), then you would can install your components in each "session"... Each session it's just a new key Embarcadero on registry tree... look at HCU...Embarcadero see on help how to use -R param on BDS.EXE command ...\bds.exe -r MyNewSesstionName Edited March 27, 2023 by programmerdelphi2k 1 Share this post Link to post
David Schwartz 426 Posted March 28, 2023 The problem with this is there are both files on the disk as well as entries in the Registry that need to be changed -- AND kept in sync! MAYBE you could get by just by changing Registry entries if you were really crafty. The safest thing might be to create separate user logins for each Dephi configuration and install on a per-user basis. But that will eat up a HUGE amount of disk space before long. I've seen places I've worked solve it by having virtual machines they'd RDP into that were configured differently, but only one person could be using one machine at any given time. 1 Share this post Link to post
programmerdelphi2k 237 Posted March 28, 2023 (edited) in fact, using "R" param, nothing (files) it's really duplicated or similar... just a new key will be created on Registry to new session. this create a "RAD" session with only "default" references... that way, you can install your components using: if you want create your binary (DCU, BPL, DCP, etc...) ---> do it as expected, open DPK build and install! you can define "where" (folder) you desire use creating a "DPROJ" for each IDE (same that the "same") as Delphi do it! so, each "DPK" can have itself setup! (as it was a other-IDE) you see? if you have a installer (for example, DevExpress install), then, you can use just "Component -> Install Component" and indicated where is the BPL/DCP/DCU/PAS files, not needs re-Build again! You see? Do it that way, YOU DONT need re-Duplicate files for each IDE-session! at end, you'll have "many IDE-sessions" and using the same binary files, or, at last case, (when have distincts IDEs) each components in itself folders, as default when we have many IDEs using same component suites! nothing different.... if dont needs anymore the "new session IDE", just delete it from Registry! (and any other residual files used in your "components installations" -- if you do it) Edited March 28, 2023 by programmerdelphi2k 2 Share this post Link to post
Anders Melander 1782 Posted March 28, 2023 (edited) Here you go: https://bitbucket.org/anders_melander/delphilauncher/src/main/ The following was copy/pasted from the repo readme.md so the formatting is a bit messed up: Quote Delphi Launcher Using Delphi with different versions of 3rd party packages Usage Note: Terms are explained in the section "How to create a new environment..." below. Execute the start.ps1 PowerShell script from the environment root folder of the desired run-time environment. The script will verify that the environment is up to date by comparing the environment version in the registry with the one in the enviroment.ini file on disk. If it's not up to date, the script deletes the current package files, extracts the new ones from the zip file, and updates the registry. It then copies the current Delphi registry keys to a custom registry branch and updates it with the environment package files. Finally, it launches Delphi with a command line that directs it to use the custom registry branch. How to create a new environment based on a current Delphi installation Note: > Quoted, bold texts are examples. 1) Create a folder to hold the environment. > DelphiLauncher\MyProject We call this the environment root folder. 2) Create a folder named Packages under the environment root folder. > DelphiLauncher\MyProject\Packages We call this the package folder. 3) Export the content of the HKEY_CURRENT_USER\Software\Embarcadero\BDS\<version>\Known Packages registry key to a reg file named packages.reg in the environment root folder. <version> denotes the version of Delphi. For example 20.0 for Delphi 10.3 4) Rename packages.reg to packages.txt > DelphiLauncher\MyProject\packages.txt 5) Edit packages.txt Remove the first 3 lines of the file so the file only contains the package list. 6) For all the design-time packages in the list and all the run-time packages they depend on, copy the files to sub-folders 1 of the package folder. > DelphiLauncher\MyProject\Packages\Graphics32\GR32_DD110.bpl > DelphiLauncher\MyProject\Packages\Graphics32\GR32_RD110.bpl > DelphiLauncher\MyProject\Packages\DevExpress\dcldxRibbonRS28.bpl etc 7) Zip the content of the package folder into a file named packages.zip in the environment root folder. > DelphiLauncher\MyProject\packages.zip The package folder can now be deleted. The folder and its content will be recreated by the script on demand. 😎 Add the packages.txt file to packages.zip. The packages.txt file can now be deleted. The file will be recreated by the script on demand. 9) Create a text file named environment.ini in the environment root folder. > DelphiLauncher\MyProject\environment.ini The file is an ini-file with the following content: [environment] delphi=<version> project=<name> revision=<value> where <version> is the version of Delphi used. It must match the value of <version> mentioned in step 3. > delphi=20.0 <name> is the name of the environment. > project=My project The value is displayed in the Delphi title bar. <value> is the environment revision number/id. > revision=1 The combination of <name><value> is used to detect if the environment has been updated and should be refreshed. If you change, add, or remove any package files, one or both of <name> and <value> must be changed. Typically only <value> is changed. 10) Copy the start.ps1 script from another environment into the environment root folder. > DelphiLauncher\MyProject\start.ps1 Note: Packages that are listed in packages.txt but do not exist on disk are ignored. Packages located in $(BDSBIN) are assumed to be Delphi's own and are left as-is. The paths in packages.txt are ignored. Only the file names are significant. It's a good idea to place a text file named versions.txt in the environment root folder that contains the name and version numbers of the libraries contained in the package sub-folders. This makes it easier to determine what an environment contains. > DevExpress 2022.1.3.0 > TeeChart 9.0.26.0 > madExcept 5.1.2 (madCollection 2.8.11.7) If the project will be used with several different versions of Delphi, just create an environment root folder for each version. > DelphiLauncher\MyProject\Delphi 10.3 DelphiLauncher\MyProject\Delphi 11.0 Revision control The following files define an environment and can be placed under revision control (e.g. checked into a Git repository): start.ps1 environment.ini packages.zip versions.txt (optional) All other files are transitory and can be ignored. For Git it might be a good idea to enable LFS for zip files on the repository if the file is large. YMMV. The names of the sub-folders are not important. The sub-folders are only used to better organize the files. ↩ Edited March 28, 2023 by Anders Melander 4 1 Share this post Link to post
Gonzalo Fernandez 0 Posted March 28, 2023 Amazing answers! thanks to you all. I will try Anders' scripts, as they seem specifically useful to automate the process. Share this post Link to post