Assuming we have a configuration file as follows:
[username1] . . Path=X:\folder1\folder2\folder3 . .
Here is "username1" the name of the logged user on the host PC. If I now insert the USB flash drive on another PC, where "username2" is the name of the logged user, then the above configuration file are changes as follows:
[username1] . . Path=X:\folder1\folder2\folder3 . . [username2] . . Path=Y:\folder4\folder5\folder6 . .
The problem now is that I usually don't know the specific name of the logged user, if I insert the USB flash drive on a new host PC. Therefore it seems to be impossible, that I can modify the above mentioned configuration file with [FileWriteN].
Has anyone an idea to solve this problem?
I think, there is no simple solution for that as it also affects the files created (User dictionaries and output paths in TomahawkPDF+ Portable). It is kind of a mess and I think you could either leave it untouched or write some rather complicated custom code (you have to store the last user name somewhere, read the current user and replace all entries in Spell.cfg, merge the Dictionaries, rename the folder etc.).
It shouldn't be too hard, after all. I'm currently checking the MSDN for the right function.
All that's needed is:
Save the last-used username in %APPNAME%PortableSettings.INI
Compare last username with current username and do a find/replace in the appropriate files.
Can you give a more specific description of what application you're trying to do this with?
I detect this problem in conjunction with my portable app "Tomahawk PDF+ Portable". There will be created a file named "Spell.cfg", which have this characteristic.
Oh, I think, I misread your post, sorry.
Now I can only guess that you are trying to nail down a user selected dictionary location so forget the part of my previous post regarding the user dictionaries and folders...
SOmetimes it is better to give specific information than some general construct.