Ini files only work on my computer. How to create ini files in a directory on another computer?

I am creating a game that requires the use of ini files.

The game works perfectly on my computer.

When I create and executable, the executable even uses the ini files when I am programming/testing the game on the engine.

Directory where the ini files are located:

D:\Users\BonecoSinforoso\AppData\Local\Brasmotor_1


The problem occurs when a person from another computer tries to play. The game does not create any ini files.

Even placing the ini files in the zipped file that I put the game on, it gives an error. Because the ini files don't go to a directory that the game can read.

I would like to know how to make my executable create or move the ini files to a directory where the files can be read.

EDIT 1

How do I create the ini files:

ini_open("config.ini");
ini_close();


The ini files get created. Probably you are not looking in the right place for it. The ini file get created in %AppData%/Local/"YourGameNameHere" folder, that's where you'll find all the files you save.

BY JM DG.

Error obtained by a user:

A little earlier, I made a change to the line of this script. I will wait for this user to test again to see if the error has been resolved.

• Is it always BonecoSinforoso or is it the user's actual username? Is it always D:\Users\BonecoSinforoso\AppData\Local or is it the user's actual local appdata directory? (which you can get by calling SHGetKnownFolderPath with FOLDERID_LocalAppData) Dec 16, 2020 at 15:03
• @user253751 user's actual username. Dec 19, 2020 at 22:17

ini_open("config.ini"); -> ini_open(working_directory+"config.ini");