[4.25.2] Custom ini in packaged project? (shipping)

I want to include a custom ini config file to store position data for UI elements. This is working fine while using the editor, but I need it to work in the final product too.
Currently(as a placeholder while I was setting everything up in C++ and the editor) I have been using a hard set FString for the file path:

“…/…/…/…/…/…/…/Contents/MyDocs/Unreal Projects/MyGameProject/”

Contents > MyDocs > Unreal Projects being the directory where I am working on the project. Obviously this does not work in the packaged project.

I have two issues:

  1. Im not familiar with how to get the install directory of the game once it is packaged.
  2. Im not sure how the packaged game will react to attempting to write/ read to a custom config file that doesn’t exist, or how to have the install create the custom config file in the first place.

Any help would be greatly appreciated.

Unreal loads INI files for you, assuming they’re installed correctly.
Have you read this section of the docs?
https://docs.unrealengine.com/en-US/…les/index.html

@**jwatte **
Yes I have. That mostly pertains to default ini configs. Which I am not using. I was trying to write to custom file in a custom directory, which I have since figured out.

  1. I found FPath calls for various path locations. In this case: FPaths::ProjectConfigDir(), works for my needs.
  2. GConfig->Find( GamePath+FileName, true ); This function will search for an Ini file, and if the second bool argument set to true create it if it does not exist.