Page 1 of 1

Changing the way the .ini files are updated

Posted: 2023-07-22, 11:19 UTC
by petermad
I know that updating the .ini files is handled by Windows but maybe some of the following is feasible to implement.

Doing a fair amount of testing it is crucial to be able to compare the .ini files with the backup I have of them.

But when TC is saving ini sections with enumerated items like [Associations], [ViewModes], [ViewModeSwitch], [user] and [DirMenu], the whole section is deleted and rewritten in the bottom of the .ini file. This makes it tedious to compare the .ini file with its backup, after a few of these section movings. furthermore when the updated section is written in the bottom of the file it is done without a blank line between the updated section and the section before it.

Would it be possible to insert the updated section in the same position as it was in before updating?

Would it be possible at least to have a blank line inserted before the updated section - that would make it much easier to find the section in the Compare by Content dialog, in order to resync the comparison?

Re: Changing the way the .ini files are updated

Posted: 2023-07-22, 12:14 UTC
by JOUBE
That's right, that's sometimes (especially in the test phase) a problem. The easiest way is to redirect the corresponding/interesting sections individually into individual files into a common subdirectory. That can then be copied quickly and easily into other subdirectories (Ini_sections, Ini_sections_old, ini_sections_20230722, ini_sections_20230721) and easily compared. This does not apply to the [configuration] section.

Just my two cents

Joube

Re: Changing the way the .ini files are updated

Posted: 2023-07-22, 17:22 UTC
by jinsight
Support++++ for the suggestion of petermad. This would make comparing and updating ini files much easier and less error prone.

Re: Changing the way the .ini files are updated

Posted: 2023-07-22, 23:02 UTC
by Galizza
petermad wrote: 2023-07-22, 11:19 UTC
Would it be possible to insert the updated section in the same position as it was in before updating?

It's a very interesting feature, if possible should be implemented.

Re: Changing the way the .ini files are updated

Posted: 2023-07-23, 08:52 UTC
by ghisler(Author)
Unfortunately the function WritePrivateProfileSection doesn't allow to choose the location where a section will be added.

Re: Changing the way the .ini files are updated

Posted: 2023-07-23, 09:45 UTC
by petermad
2ghisler(Author)
I was afraid so. How about an extra blank line before rewritten sections - is that possible?

Re: Changing the way the .ini files are updated

Posted: 2023-07-23, 10:45 UTC
by ghisler(Author)
I was afraid so. How about an extra blank line before rewritten sections - is that possible?
No, unfortunately not.

Re: Changing the way the .ini files are updated

Posted: 2023-07-23, 16:06 UTC
by Horst.Epp
To make a comparison, a take a section from 2 versions of the wincmd.ini and sort it.
That's the only useful way I found, to see what lines were added, changed or deleted.

Re: Changing the way the .ini files are updated

Posted: 2023-07-24, 07:34 UTC
by AntonyD
2ghisler(Author)
Your answer is based on the direct use of a function from the Windows SDK/API kit. But has no one ever written or posted a third-party library for working with such files, INDEPENDENT of these functions???

Re: Changing the way the .ini files are updated

Posted: 2023-07-24, 08:26 UTC
by JOUBE
AntonyD wrote: 2023-07-24, 07:34 UTC But has no one ever written or posted a third-party library for working with such files, INDEPENDENT of these functions???
Yes, me for example (as well as dozens of others), but I expect Tc in particular to use the original windows routines!Because that is exactly what the decades-long success of the Tc is based on.

Re: Changing the way the .ini files are updated

Posted: 2023-07-24, 08:51 UTC
by white
Using a tool that can properly sort or compare ini-files seems a better solution to me. Regretfully, there are not much of those around so it seems.