Master.typeX
Member
Hello.
I would like to create the ini file created by "ini_open" in the same location as the game's exe file.
I would like to create the ini file created by "ini_open" in the same location as the game's exe file.
I see, I understand. Thank you for answering my question!Is it for settings? If it were, you could create a file manually and leave it in the "Included Files" folder, which will be exported in the same folder as the game.
You can try using the built in game_save_id variable and try to save using it (I know it shouldn't be used as a path, but it never hurts to try). But you will have to disable the sandbox in the game settings.
That option is very misleading. GMS2 is hard sandboxed and refuses to save to the program's directory and several other potentially protected directories even if the sandbox is disabled.But you will have to disable the sandbox in the game settings.
Yes, I recommend using some Samuel Venable extensions.That option is very misleading. GMS2 is hard sandboxed and refuses to save to the program's directory and several other potentially protected directories even if the sandbox is disabled.
GameMaker - [SOLVED] Unable to write file to program_directory with sandbox disabled
Log in at https://help.yoyogames.com/hc/en-us then click your name in the top right and choose "My Activities" and you'll see a list of all your support tickets. Open the one related to this issue and you will be able to add a message / extra info to it and it will be reopened if it has been...forum.yoyogames.com
I'm not sure if its GMS2 that isn't saving to those directories or if Windows is blocking it. I know if I try to directly copy a file to the program files folder I have to elevate to admin level to do it. This is similar to how you have to run notepad as an admin if you want to use it to modify the hosts file that is in the windows directory a few folders deep.That option is very misleading. GMS2 is hard sandboxed and refuses to save to the program's directory and several other potentially protected directories even if the sandbox is disabled.
It doesn't change with admin privileges. In that very post I quoted, you'll note YYG themselves said that GMS will never write to program_directory. It's an intended feature. Haven't tested writing to UAC-protected directories with admin privileges, so bundled those together just to be safe.I'm not sure if its GMS2 that isn't saving to those directories or if Windows is blocking it. I know if I try to directly copy a file to the program files folder I have to elevate to admin level to do it. This is similar to how you have to run notepad as an admin if you want to use it to modify the hosts file that is in the windows directory a few folders deep.
I DO know however that GMS2 will save to the datafiles folder inside the project folder. I'm using that to run a thing that saves input configuration system files in that folder so they then get added to builds. That won't work if the sandbox is turned on, so I know the setting functions at the least in a general sense.
They should probably document that then. Or maybe they have and I just don't know about it. It doesn't surprise me though, in general you are not supposed to be writing to the program directory, you are supposed to be using the users folders, app folders, etc...It doesn't change with admin privileges. In that very post I quoted, you'll note YYG themselves said that GMS will never write to program_directory. It's an intended feature. Haven't tested writing to UAC-protected directories with admin privileges, so bundled those together just to be safe.
Yes, writing to datafiles works. GMS likely whitelists that folder since write access to files there is mandatory as that's where all your Included Files resources go. If you're using Included Files, those show up there as well, making it a suboptimal but still viable workaround.