Can DefaultGame.ini be configured directly?

Hello,
I’m trying to save some time updating my project’s version through an editor utility widget .
Currently I manually set the version through the editor’s project settings window and type whatever version I want in the Description → Project Version field.

I have written a function to increment the current version number but unfortunately it only writes the new data to a temp file located in Project\Saved\Config\Windows\Game.ini.
The updates are registered to DefaultGame.ini only after restarting the editor which is undesirable.

This is how I read and write the data at the moment:

FString UMiscLib::GetProjectVersion()
{
	FString ProjectVersion;
	GConfig->GetString(
		TEXT("/Script/EngineSettings.GeneralProjectSettings"),
		TEXT("ProjectVersion"),
		ProjectVersion,
		GGameIni
	);
	return ProjectVersion;
}

void UMiscLib::SetProjectVersion(FString Version)
{
	const TCHAR* NewVersion = *Version;
	
	GConfig->SetString(
		TEXT("/Script/EngineSettings.GeneralProjectSettings"),
		TEXT("ProjectVersion"),
		NewVersion,
		GGameIni
	);

	GConfig->Flush(true, GGameIni);
	
	UE_LOG(LogConfig, Warning, TEXT("New version is %s"),*GetProjectVersion());
}

How would I go about affecting the DefaultGame.ini directly, and is that even possible through a blueprint function library?

Thanks in advance :slight_smile: