Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Non-sandboxed filesystem

Work with files in all accessible places in GameMaker games. · By YellowAfterlife

Finding the directory to the exe

A topic by RandomFangamer created Aug 22, 2020 Views: 362 Replies: 2
Viewing posts 1 to 2

I've been struggling to figure out how to get the directory to the exe. Using the code show_message(program_directory) after exporting the game returns "C\Users\User\AppData\Local\Temp\IXP000.TMP\", which appears to be a temporary directory created when the game is opened and deleted once the game ends.

I am trying to create save and configuration files within a "Data" folder, which would be copied to the sandbox when they need to be loaded and copied from the sandbox when they are saved. I will also load music from the game's folder with the same method.

Developer

You'd want filename_dir(parameter_string(0)) for a more reliable exe directory; if you are exporting a single-runtime executable from GMS1, there's no way to get the real exe directory since the executable that runs is being extracted into a temp directory.

Exporting the game as a zip file and making the change you suggested fixed my problem. Thank you!