Category
Installing and upgrading Delphi is a pretty big task. With support for eight platforms, a dozen different databases, multiple web services and servers, a rich run-time library, and an ever increasing array of programming tools and IDE productivity aids, I'm in awe that for the most part, the process is fairly smooth. I'm sure there are those still on Windows 8.1 or older or have machines with limited memory and slow hard drives that bemoan the time it takes or incompatibilities they encounter. But the modern programmer should have decent hardware to support the needs of today's multi-faceted software environments and if your machine meets or exceeds the recommended specifications--and especially if you're installing to a clean virtual machine--you should have few problems.
There is one area, though, that is quite a bottleneck: the GetIt Package Manager.
The GetIt Package Manager was introduced somewhere around the Delph XE8 era and is similar to apt-get in Linux or NuGet for .NET. It's a growing collection of tools, sample projects, libraries, components, styles, and trial products from both Embarcadero and third-party vendors for both Delphi and C++ Builder. The tool is available right from within Delphi and provides a searchable list that can be sorted by vendor or filtered by category, then by simply clicking the convenient Install
button, can be made immediately available to you. I've used this to install a few libraries, many styles, and several templates and sample projects.
The list of packages is specific to the version of Delphi, of course, so installing a completely new version of Delphi cannot bring all your packages selected from a previous version of Delphi--similar to your installed components. But you would hope that an in-place, dot-release upgrade of Delphi (e.g. Delphi 10.4.1 to 10.4.2) would keep those packages like it does components. Unfortunately, any upgrade requires the uninstallation of all the GetIt packages--and it does not reinstall them for you when it's finished.
After a wading through dozens of package reinstalls during Delphi 10.3 Rio's minor upgrades, I discovered a command-line utility, GetItCmd.exe
, for installing GetIt packages; it's installed in the bin folder of your Delphi installation. So when the first upgrade for Delphi 10.4 came out and I realized I was going to have to suffer through an afternoon of reinstalling these packages again, I decided it was time to automate this process.
At first, I simply wrote a bunch of batch files, tediously copying the names of the packages from a text file containing a dumped list of all the packages. If the list doesn't change very often, you can live with it but but if there are new packages, it requires manually sifting through that list again, making changes to your batch files. Having a visual display would be much nicer.
So, I wrote a simple VCL app and using the DosCommand component to capture the output from the command-line utility, listed all the packages in a check-list box, then after checking off packages to install, called the command-line tool for each one to install them. It worked pretty well, getting over 75 packages installed in less than half an hour with minimal interaction required from me (after temporarily turning of User Access Control).
I was elated! This was going to save me LOTS of time! Perhaps others would like this as well. I created a git repository on GitHub and soon got some positive feedback. But my excitement at finally creating something useful to give back to the community was curtailed as some tried using it with older versions of Delphi. Of course, not everyone is on the newest version of Delphi and I hadn't specified it was for Delphi 10.4 only. In fact, I had not even yet looked at the syntax for the older versions of the GetItCmd.exe. (Yes, I had been bitten by the "ASSUME" principle once again.)
I pulled up a virtual machine, installed some older versions of Delphi, and compared the syntax of their versions of GetItCmd and was surprised to see several differences:
GetItCmd syntax for Delphi 10.2 Tokyo and 10.3 Rio
GetItCmd syntax for Delphi 10.4 Sydney
After a late-night programming session, I realized there were other issues. Depending on how many versions of Delphi you have installed and in what order they are in, the PATH setting could affect what version of GetItCmd is actually being called and what version of Delphi it thinks it's associated with. I thought about setting the Environment
property of the DosCommand
component and other strategies but finally just had to settle on a compromise. The release as of this date, attempts to support GetItCmd for Delphi versions 10.2 Tokyo and 10.3 Rio with it's different command-line arguments but I have not thoroughly tested it. It does work well for Delphi 10.4.
There is an API for GetIt. My hopes for the future of this project is that the use of GetItCmd will be replaced with the API and provide much more functionality including sorting, searching, and hopefully, the ability to upgrade your packages from one major version of Delphi to the next--that would be pretty cool!
Until then, this is an open-source project, so feel free to clone it and tweak it to work for your version of Delphi. Or just modify the included batch files.
GitHub Repository: AutoGetIt
Add new comment