How to use config (.ini) file in packaged game

I’m trying to use a config file for my game. I have in my game instance file:

UCLASS(Config=CustomConfig)
class TEMP_API UMyGameInstance : public UGameInstance
{
	GENERATED_BODY()

protected:
	UPROPERTY(Config, BlueprintReadOnly)
		FString ConfigText;

......
	
};

And I’ve set it in [ProjectName]/Config/DefaultCustomConfig.ini. I ran it in standalone mode in the editor, and it is reading the setting from the config file correctly.

However, after packaging the game in shipping setting, the packaged game does not include the ini file. I created the file as WindowsNoEditor/[ProjectName]/Config/DefaultCustomConfig.ini and it is not loaded in the game either. Where should I put the file to make it work?

(Everything in the editor’s package setting is left as default. I’m running on 4.25, packaging for windows 64, in shipping setting.)

(I’ve tried other directories including WindowsNoEditor/Config, WindowsNoEditor/Saved/Config, WindowsNoEditor/[ProjectName]/Saved/Config)

(I have already read the official documentations on configuration files and it is unbearably vague and was not helpful at all.)

2 Likes

DefaultGame.ini

  1. ;Other Config
  2. [Staging]
  3. +WhitelistConfigFiles=[ProjectName]/Config/DefaultCustomConfig.ini
2 Likes

just in case this has been deprecated in 5.2 in favor of
+AllowConfigFiles=