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.
17 thoughts on “Dproj changed or not changed? Normalize it!”
Many thanks for this!
Is it possible to do the same for Dfm-files?
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.
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.
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.
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.
Yes I also guess that it is a harder task. But fix dproj is great!
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.
This behaviour has really bugged me too. Many thanks.
Fantastic, this has been very annoying.
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.
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?
Ok, I understand.
Well, we are using XE7 and Seattle with a plan to use Berlin or the next one when it comes out
Is this an open source project? If so, can i get the sources?
I’m sorry, but it is neither Open Source nor are the sources available.
Comments are closed.