FileSystem::ExecutableFolderPath() does not output the folder an exported game is run from

The expression doesn’t return anything useful.
bug executable path
Getting the location of the compiled executable is important when publishing on Steam. As far as I can tell, right now you can’t store things like config or save files neatly in the Steam game folder, since you can’t access that file path from within GDevelop.

Example project this was exported from:
https://www.dropbox.com/scl/fi/9fisma1822wu8czm7yuh5/GDev-Bugs-on-large-projects-SG.zip?rlkey=f2sjxszspslei9m9x34vxx3hx&dl=0

I suspect it’s because a game running on Steam isn’t the same as running the game directly on Windows, Linux or MacOS, and:

In the example I provided I’m not running it from Steam through, I just run it from a normal folder and it still doesn’t work.

Also steam just runs the executable you provide, I’m pretty sure this is exactly like running the game directly on win/lin/mac. You can even try that yourself by going into a steam directory of certain games, if they have a visible executable you can just run it from there like any program and the game will launch (as long as Steam is also running at that time, to satisfy Steam DRM). At least it worked like that for any game I put on Steam.

That’s almost certainly because of the packaging solution you’re using. When running an AppImage, it’s not literally your application you’re running. When you run an AppImage, it’s mounting an embedded filesystem containing your application executables, shared libraries, assets, etc. and runs the executable from that mounted directory.

You’re not getting the value you’d like to get, but is most likely the accurate path to your executable, as mounted and ran by the AppImage.

You probably shouldn’t do that - you can just use the Steamworks SDK’s filesystem actions, which will automatically write where steam wants your saves to be located, and sync them to steam cloud.


If you still want to know the path of the appimage file that launched your game, the path should be contained in the APPIMAGE environment variable

App-image is the only export option that GDev provides for Linux right now, except from manual build I guess. I looked into the steamworks integration thing, it’s very neat overall, but the specific event won’t help if someone runs this after they downloaded it through itch or run it through the itch launcher app.

I can see that this is a very specific and also somewhat minor problem that affects very few people. But IMO if the app image can access it’s own path location then ExecutableFolderPath() could just return that instead. I can’t see what the current output, the technically correct mount path of the app image, would ever be uses for. It’s even different every time you run the image.