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

**URL:** <https://forums.unrealengine.com/t/4-25-2-custom-ini-in-packaged-project-shipping/147984>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 24, 2020, 12:30am UTC](https://forums.unrealengine.com/t/4-25-2-custom-ini-in-packaged-project-shipping/147984 "2020-07-24T00:30:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erdrik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erdrik](https://forums.unrealengine.com/u/Erdrik)\
**Post date:** [July 24, 2020, 12:30am UTC](https://forums.unrealengine.com/t/4-25-2-custom-ini-in-packaged-project-shipping/147984/1 "2020-07-24T00:30:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [July 24, 2020, 12:36am UTC](https://forums.unrealengine.com/t/4-25-2-custom-ini-in-packaged-project-shipping/147984/2 "2020-07-24T00:36:33Z")

</div>

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](https://docs.unrealengine.com/en-US/Programming/Basics/ConfigurationFiles/index.html)

---

<div class="post-metadata">

**Author:** ![Erdrik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erdrik](https://forums.unrealengine.com/u/Erdrik)\
**Post date:** [July 24, 2020, 7:33pm UTC](https://forums.unrealengine.com/t/4-25-2-custom-ini-in-packaged-project-shipping/147984/3 "2020-07-24T19:33:27Z")

</div>

@\*\*[jwatte](https://forums.unrealengine.com/member/2525-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.
