Changing the way the .ini files are updated

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Changing the way the .ini files are updated

Post 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?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Changing the way the .ini files are updated

Post 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
User avatar
jinsight
Senior Member
Senior Member
Posts: 299
Joined: 2003-02-25, 19:47 UTC
Location: Wooster, Ohio, USA

Re: Changing the way the .ini files are updated

Post by *jinsight »

Support++++ for the suggestion of petermad. This would make comparing and updating ini files much easier and less error prone.
License #1945
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
Galizza
Member
Member
Posts: 167
Joined: 2018-09-07, 05:21 UTC

Re: Changing the way the .ini files are updated

Post 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.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Changing the way the .ini files are updated

Post by *ghisler(Author) »

Unfortunately the function WritePrivateProfileSection doesn't allow to choose the location where a section will be added.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Changing the way the .ini files are updated

Post by *petermad »

2ghisler(Author)
I was afraid so. How about an extra blank line before rewritten sections - is that possible?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Changing the way the .ini files are updated

Post by *ghisler(Author) »

I was afraid so. How about an extra blank line before rewritten sections - is that possible?
No, unfortunately not.
Author of Total Commander
https://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6496
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Changing the way the .ini files are updated

Post 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.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Changing the way the .ini files are updated

Post 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???
#146217 personal license
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Changing the way the .ini files are updated

Post 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.
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Changing the way the .ini files are updated

Post 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.
Post Reply