As some of you might already know, Delphi (at least since XE2) comes with a built-in TZipFile class for reading and writing zip files. It is a rather basic class with only limited functionality, but this might just be enough for quite a couple of day-to-day tasks.
During a recent migration of a project from Delphi 7 to Delphi 10.1 Berlin I was facing the decision to either fix the current zip implementation (based on external DLLs) or switch to the stock implementation using TZipFile. The second option would also have the advantage of getting rid of distributing the DLLs. So I headed for that one.
Well, as always when you think you have found the right solution and start coding – reality steps in. Some of the zip files we had to read were password protected. Unfortunately TZipFile doesn’t support password encryption out of the box. Continue reading
I have uploaded some updates for my IDE plugins, mostly only to support Delphi 10.2 Tokyo.
SelectiveDebugging only got Tokyo support while support for XE is dropped.
PackageMagician got Tokyo support and some enhancements:
- Packages can be given with relative paths to the project
- The path of any loaded package is added to the PATH environment variable
DprojNormalizer also got Tokyo support. In addition some more entries are normalized. A command line utility completes this version allowing batch normalizing of dproj files.
I am not sure if normalizing is still necessary as Tokyo fixes bug RSP-11308: Inconsistent sort order in dproj files causes havoc with version control systems.
Update: There seem to be some intermittent problems with PackageMagician when unloading a package. Although it seems that Delphi actually unloads that package it refuses to load another package with the same name. This might be related to the package cache, but I haven’t found a solution for that yet.
A couple of years ago I wrote a two-part article about a dataset enumerator: A Magical Gathering – Part 1 and Part 2. Well, things evolved a bit since then and I wondered how one would implement something similar given the current features of Delphi. Actually I am following here a suggestion from commenter Alan Clark. Continue reading
I just uploaded Version 1.0.1 of my DprojNormalizer plugin. No internal changes – only versions for XE7 and XE8 are included here. If you don’t need those you can simply skip this version.
I guess it is since Delphi 10 Seattle that dproj files are changed on disk even if no change was done to the project settings inside the IDE. This is a real PITA with version control systems.
Actually there are no changes to the content – it is just reordered somewhat randomly. The only consistency is that the order changes with every save operation. The reason seems to be the use of dictionaries for some entries inside the IDE.
As this bothered me a lot recently I wrote an IDE plugin that orders the dproj file in a consistent way. It is called DprojNormalizer and can be downloaded here:
DprojNormalizer has no settings or options. It does its job while it is installed and active. If you don’t want that you have to disable or uninstall it.
If you find cases where the dproj file unexpectedly changes, please give me a note and I will see if it can be handled as well.