Dproj changed or not changed? Normalize it!

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

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.

Author: Uwe Raabe

Addicted to Pascal/Delphi since the late 70's

17 thoughts on “Dproj changed or not changed? Normalize it!”

    1. As DFM files are not XML files, the current algorithm is not suitable for that. In addition DFM files are written by the streaming system and resemble the internal object structure. I am not that keen to fiddle around with this as it might break something.
      Do you have an example where a DFM changes where it should not? And I mean within the same Delphi version.

      1. in a DFM they are 2 kinds of false updates

        1) the “Explicit” position of controls

        2) the imageList Data header… I guess that there’s a timestamp in the Bitmap header.

        1. The TImageList data is written by a Windows API routine. I’m not sure if the format is documented somewhere. There might be not much one can do about that.

        2. Andreas Hausladen’s DDevExtensions plugin already contains an option “Do not store the Explicit* properties”.

          As for the imagelist, that is indeed down to Windows.

      2. I have an example of a DFM change where it should not. Certain controls such as TComboBox stream ItemHeight flipping between 0 and 15. It too is an issue with a windows control, but certainly drives devs nuts on source control check-in. Many don’t, but I often take the time to undo those type changes with source compare tool.

  1. Would it be possible to get the sources for this? This way we can compile it for the various versions we have here at work.

    1. I’m sorry, but it contains some commercially licensed parts that I can only distribute in a compiled product.

      I already had plans do provide it for older versions in a reasonable time frame. Which versions are you interested in?

Comments are closed.