# How to stop local custom INI files being deleted after play

**URL:** <https://forums.unrealengine.com/t/how-to-stop-local-custom-ini-files-being-deleted-after-play/1967813>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [August 9, 2024, 2:30am UTC](https://forums.unrealengine.com/t/how-to-stop-local-custom-ini-files-being-deleted-after-play/1967813 "2024-08-09T02:30:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fafhrd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fafhrd](https://forums.unrealengine.com/u/Fafhrd)\
**Post date:** [August 9, 2024, 2:30am UTC](https://forums.unrealengine.com/t/how-to-stop-local-custom-ini-files-being-deleted-after-play/1967813/1 "2024-08-09T02:30:50Z")

</div>

I have a custom class that uses a custom config file type.

My UCLASS is set up as UCLASS(BlueprintType, Config=“ClassConfig”), and I’m calling LoadConfig() in the constructor, and if WITH\_EDITOR saving the default config when a property changes.

So far so good. The values of the properties that are marked as config get loaded from DefaultClassConfig.ini, or Saved\Config\WindowsEditor\ClassConfig.ini

But if I’ve overridden the Defaults with a local ClassConfig.ini and then play in editor, or standalone, or package a build and override and play, the overridden ini gets loaded correctly, but as soon as I close the editor, or shut down the game, the local ini gets deleted.

What am I missing to stop this from happening? I kind of need to keep the override inis around in a packaged build.

---

<div class="post-metadata">

**Author:** ![Fafhrd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fafhrd](https://forums.unrealengine.com/u/Fafhrd)\
**Post date:** [August 9, 2024, 7:42pm UTC](https://forums.unrealengine.com/t/how-to-stop-local-custom-ini-files-being-deleted-after-play/1967813/2 "2024-08-09T19:42:01Z")

</div>

Okay, I figured this out.

In order to keep an overridden custom ini file from being deleted after it’s loaded, you either have to have ‘User’ as part of the config name (i.e. instead of UCLASS(BlueprintType, Config=“ClassConfig”) it should be UCLASS(BlueprintType, Config=“UserClassConfig”)), or you have to put

`[SectionsToSave]`  
`bCanSaveAllSections=true`

in the Base or Default config.

Would’ve been super cool if this information were in the Config file documentation.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 8, 2024, 7:42pm UTC](https://forums.unrealengine.com/t/how-to-stop-local-custom-ini-files-being-deleted-after-play/1967813/3 "2024-09-08T19:42:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
