How to keep different inis synchronized?

Discussion, questions and support.
Post Reply
Message
Author
Dirk
Posts: 187
Joined: 02.06.2010, 13:38

How to keep different inis synchronized?

#1 Post by Dirk » 04.06.2010, 11:17

To use more than one / different ini-files (http://www.freecommander.com/fc_guide_g ... ons_en.htm) for FC for different purposes is a very good idea, but how could one keep them synchronized the easiest way:

So, when I add to FC - using "ini 1" - tabs I want to use in all the inis I created or I add some filters / color schemes and so on, how can I copy / synchronize them to / with my other inis automatically (instead of copying the different regions, e.g. the tab region of "ini 1", the filter region of "ini 1" and so on manually one by one to the other inis)?
FC newest stable version, portable
Win 7 64bit

matera
Posts: 175
Joined: 31.10.2007, 02:12
Location: a cold place
Contact:

Re: How to keep different inis synchronized?

#2 Post by matera » 06.06.2010, 18:26

A file comparing program like WinMerge or AptDiff might help.
Windows Vista 64-bit
Pentium E5200 Dual Core 2.5GHz

Dirk
Posts: 187
Joined: 02.06.2010, 13:38

Re: How to keep different inis synchronized?

#3 Post by Dirk » 06.06.2010, 21:42

Thank you matera,

For the links, also.

Yes, good idea. I use WinMerge. But I assume when the sections (e.g. for tabs, links, colors etc.) have different positions (so ini 1 the tabs section is at the top ini 2 has it at the bottom) within the ini files, it won't work properly. But may be you could give these sections the same order and keep the order in both inis (if FC won't change it).

Thanks again, nice greetings, Dirk
FC newest stable version, portable
Win 7 64bit

W4tch3r
Posts: 10
Joined: 04.10.2007, 05:47

Re: How to keep different inis synchronized?

#4 Post by W4tch3r » 08.06.2010, 03:22

I had this problem and looked into this also. In the end I found it easier to copy to newest ini (ini1 say) over the top of the "other" ini (ini2 say) file and then recreate the differences between my ini file configs. This was easier to automate as the differences between my ini file don't change (whereas the changes to the primary ini file as you are talking about are so arbitrary - could be favorites, layouts, history, window position - that you would spend all day with the Winmerge trying to sort out the differences). I have a batch file which I have added to my custom menus. It copies the newly modified ini files from one name to the other, then uses a command line Search And Replace program (rxfind) to remake my ini differences and lastly restarts FC. Just one click to sync the ini files now that its setup.

Here is the batch file below. The middle section is specific to my needs (my ini files differ in which toolbars are enabled). You would have to work out the differences between your ini files and get those changes working in a automated fashion using rxfind (and thats the tricky part).

W4tch3r ‹•¿•›


------------------------------------------------------------
copy /Y "freeCommander ini1.ini" "freeCommander ini2.ini"

rxfind "freeCommander ini2.ini" /B:2 /Q /P:"(\[Tools20(49|50|52|53|56|60|51|61|62|63|64|65)_TBarSettings\]\r\nShowToolbar)=1" /r:"$1=3"
rxfind "freeCommander ini2.ini" /B:2 /Q /P:"(\[Tools20(49|50|52|53|56|60|51|61|62|63|64|65)_TBarSettings\]\r\nShowToolbar)=0" /r:"$1=1"
rxfind "freeCommander ini2.ini" /B:2 /Q /P:"(\[Tools20(49|50|52|53|56|60|51|61|62|63|64|65)_TBarSettings\]\r\nShowToolbar)=3" /r:"$1=0"

"_Apps\_Wscc\Data\Sysinternals Suite\pskill.exe" "FreeCommander.exe"
"FreeCommander.exe"
------------------------------------------------------------
W4tch3r ‹•¿•›

Dirk
Posts: 187
Joined: 02.06.2010, 13:38

Re: How to keep different inis synchronized?

#5 Post by Dirk » 09.06.2010, 12:23

Many thanks W4tch3r,

Especially for the batch file.
and In the end I found it easier to copy to newest ini (ini1 say) over the top of the "other" ini (ini2 say) file and then recreate the differences between my ini file configs.
Am I right: the content of the one ini copy above the content of the other ini? I am not sure: how to recreate the differences then? How do you do this? Manually?

Yes, it seems too complicated for me to use your batch file and the replacing program, that may be could do more demage than benefit (they way I would be able to handle it).

Thanks again.
FC newest stable version, portable
Win 7 64bit

W4tch3r
Posts: 10
Joined: 04.10.2007, 05:47

Re: How to keep different inis synchronized?

#6 Post by W4tch3r » 10.06.2010, 03:00

Hi Dirk,

Sorry I'm not quite sure what you are asking but I'll rephrase my last post and see if it helps. Lets say you want to sync ini1 and ini2. For example, you currently run FC using ini1, then you make some changes and you want to know how to propagate those changes to ini2. The first way suggested was to use a diff program like Winmerge to try and sync the changes. Personally I have found this to method to be difficult because lots of things change in the ini file (like window position and tab history etc). I found it easier to manually compare ini1 and ini2 (before making any changes to ini1), write down the differences (which I'll call "ini2 changes") and then later when I want to sync ini1 and ini2, I copy ini1 over ini2 and then apply my ini2 settings to the newly overwritten ini2 file. In order to get the "ini2 changes" you need to manually use winmerge to compare the files, and then use rxfind to figure out the regular expressions required to implement the changes. In my particular case, I compared my 2 ini files and figured out the regular expressions required to toggle the "ShowToolbar" status for 12 toolbars (toggle 6 off, toggle 6 on).
W4tch3r ‹•¿•›

Dirk
Posts: 187
Joined: 02.06.2010, 13:38

Re: How to keep different inis synchronized?

#7 Post by Dirk » 10.06.2010, 16:08

Ah okay, I see, many thanks W4tch3r,

And sorry for my bad understanding.

Yes, there is a bit of efforts necessary to synchronize this way. But I assume, if you do not synchronize the inis that often, it is a good way.

I had hoped that there is an option in WinMerge or a similar program, which enables just to look whether a part of text / section is available in both files independently of their position within the ini (so e.g. when the same text, the same lines are in ini1 at the bottom and in ini2 at the top, WinMerge would mark them as equal), but I didn't found any.

Many thanks for explaining, nice greetings, Dirk
FC newest stable version, portable
Win 7 64bit

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 29 guests