# Custom Ini file path after package

**URL:** <https://forums.unrealengine.com/t/custom-ini-file-path-after-package/728552>\
**Category:** Programming & Scripting\
**Tags:** ini, unreal-engine, config, packaged-game, CPP\
**Created:** [December 15, 2022, 12:21am UTC](https://forums.unrealengine.com/t/custom-ini-file-path-after-package/728552 "2022-12-15T00:21:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![colorofblack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@colorofblack](https://forums.unrealengine.com/u/colorofblack)\
**Post date:** [December 15, 2022, 12:21am UTC](https://forums.unrealengine.com/t/custom-ini-file-path-after-package/728552/1 "2022-12-15T00:21:46Z")

</div>

Hi everyone!  
After a lot of fiddling I implemented a Custom.Ini for my project.  
I created a class inheriting from GameInstance that implements the needed variables.  
This works fine in Editor after placing the custom.ini in my saved/config/WindowsEditor/ folder.  
But after packaging the only place I can get the ini file to work is in %Apddata/Local/Projectname/saved/config/Windows which isn’t really optimal as the user has to place the file there manually or at least access it there to change things.

I found this answer to a rather similar question [How to store variables to a custom .ini file? - #10 by RVillani](https://forums.unrealengine.com/t/how-to-store-variables-to-a-custom-ini-file/330274/10)  
but can’t seem to figure out where to actually set the filepath for the config file.  
I tried passing it in the

```auto
UCLASS(Config=CustomConfig, Blueprintable, BlueprintType)

```

replacing the CustomConfig but that only shows compiling errors.  
Any hints on how to set the filepath so it uses something like:

```auto
FPaths::ProjectConfigDir() / TEXT("CustomConfig.ini")

```

would be great.  
[[4.25.2] Custom ini in packaged project? (shipping) - #3 by Erdrik](https://forums.unrealengine.com/t/4-25-2-custom-ini-in-packaged-project-shipping/147984/3) This post also does a similiar thing but doesn’t really point out how to set it actually.

Thanks a lot!  
Cheers  
Daniel

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [December 27, 2022, 4:11pm UTC](https://forums.unrealengine.com/t/custom-ini-file-path-after-package/728552/2 "2022-12-27T16:11:56Z")

</div>

Sorry for the lack of completion on that answer. I even had to look it up myself now to understand where those are used haha

The custom address can be passed when you read/write the values manually using the global `GConfig`. Like in this example from the Engine:

```auto
void UCineCameraSettings::CopyOldConfigSettings()
{	
	const FString SettingsConfigSection(TEXT("/Script/CinematicCamera.CineCameraSettings"));

	FString OldDefaultLensPresetName;
	if (GConfig->GetString(*CineCameraConfigSection, TEXT("DefaultLensPresetName"), OldDefaultLensPresetName, GEngineIni))
	{
		GConfig->SetString(*SettingsConfigSection, TEXT("DefaultLensPresetName"), *OldDefaultLensPresetName, GEngineIni);
	}
	// ...

```

You’d replace `GEngineIni` with your own path.
