ObiWan
5/4/2012 6:57:00 AM
> If two developers called their INI file "CONFIG.INI" or
> "SETTINGS.INI"and put it in their own private folder, say under
> APPDATA, and one mapped his INI file to the registry, would the other
> product stop working and get mostly default values?
Uhm... let's see if I understood; you're saying that you have two
different apps, say "foo.exe" and "bar.exe" installed into their own
folders but storing their stuff into INI files; both apps use
"config.ini" as the name for its INI file and such an INI file is
stored under APPDATA ... well, if you don't use APPDATA\AppName as the
path then... yes, basically the two apps will be pointing to the same
file (mapped to registry or not), and this will royally screw things
This is why you should use APPDATA\AppName to store the settings, this
way each app will store its stuff inside its own APPDATA subfolder and
having INI files (mapped or not) with the same name won't cause issues;
as a note, if you decide to go for INI file, it's a good idea storing
the application "global" settings into an INI file sitting inside the
app own folder and using a second INI file in APPDATA\AppName to store
the user specific settings; in this case, referring to the two apps
above, you may have
C:\Program Files\foo\config.ini
%APPDATA%\foo\config.ini
and
C:\Program Files\bar\config.ini
%APPDATA%\bar\config.ini
and, as you see, the two INI files (be those mapped to the registry or
not) won't "overwrite" each other
> From MSDN, it seem so, especially if they also used the same section
> names, like [Config], or [Settings] :
Nope, the API asks for the INI pathname so if the path is different the
mapping will go to a different area of the registry