I wrote this application in C ++, which should check the INI file ("preference.ini") and ultimately change it (for example, if the user no longer wants to see the input form). I created it in WinXP and it works fine on the system where I compiled it (in many places, including "Program Files").
Problem:
- In Win 7, it works fine if I put the full program folder under "C": \ "(for example," C: \ MyProgram "), but if I put it in" C: \ Program Files (x86) \ MyProgram ", it just extracts some mysterious data (values are not present in my INI file). When I change some settings and save them to a file, it (apparently) saves the changes (do not get errors, but there are no changes when I go and open the file .. .
- I had a similar problem with a system with a different WinXP system (and not with the one where I compiled it).
I used 'getcwd' to determine the path at runtime, and I made sure it was right, even in the "Program Files (x86)" section:
char currentPath[MAXPATH];
getcwd(currentPath, MAXPATH);
std::string licensePath(currentPath);
licensePath.append("\\dat\\preference.ini");'
Any ideas? Thanks in advance for your help.