How to get the Project Version in a blueprint?

If I go to Edit → Project Settings → Project - Description, I get a page where I can fill in settings like the “About”, the “Publisher” etc. In the “About” tab I can choose things like the Project Thumbnail, the Description, Project Version etc. I want to display the project version in the “about” page in my game dynamically.

On top of the page there is a notification:

These settings are saved in DefaultGame.ini, which is currently checked out.

I checked the file, and most of the settings are indeed saved here, but the “Project Version” is missing.

How do I get this Project Version, so I can use it in a blueprint?

Edit: I just found this question, which is comparable: How get Project Settings values? - Programming & Scripting - Epic Developer Community Forums
However, I still don’t know where to get the Project Version, because the Project Setting seems not to be saved in DefaultGame.ini

Hello suitendaal,

The Project Settings (in your case the Genreal Project Settings; the Project ID, Project Name, Project Version, etc.) indeed get saved into the DefaultGame.ini inside your Projects Config folder, under the ‘[/Script/EngineSettings.GeneralProjectSettings]’ section inside the file.
But the Project Version is an exception, it only get’s saved into the INI file, if it differs to the Default ‘1.0.0.0’ from the Engine’s DefaultGame.ini (found inside the Engine’s config folder).
Which by itself is the default behavior, Unreal only saves differences from the ‘parent’ file. You can find the configuration file hierarchy here: Configuration Files | Unreal Engine Documentation .
If you want the Project Version to be saved into this config file, you basically have to change it to something else than ‘1.0.0.0’. If you want to retrieve that data, you can use the code given in the answer you linked in your question, but I’ll give it here again:

This goes inside the .h file

UFUNCTION(BlueprintCallable, meta = (DisplayName = "GetAppVersion"), Category = "Game Config")
static FString GetAppVersion();

One could replace the BlueprintCallable with the BlueprintPure tag making it a pure blueprint function. Which would make more sense as we’re not modifying anything. You can look at this article: Functions | Unreal Engine Documentation , for further details on pure vs impure functions.

And this goes into the .cpp file:

FString UVecherkaBPFunctionLibrary::GetAppVersion()
{
	FString AppVersion;
	GConfig->GetString(
		TEXT("/Script/EngineSettings.GeneralProjectSettings"),
		TEXT("ProjectVersion"),
		AppVersion,
		GGameIni
	);

	return AppVersion;
}

And don’t forget about the #include "CoreMinimal.h" otherwise the GConfig is not available to you.
Everything is placed inside a Blueprint Function Libary c++ class.

Hope that helps. Just let me know, if you have any questions.

Regards,

Vecherka.

Edit: Corrected the post and added references to it.

14 Likes
  1. Edit the project version setting (Edit > Project settings… > Project > Description > About > Project Version)
  2. Use the [VictoryPlugin][1]'s Victory Get Custom Config Var String node to access the value:

316458-screenshot-38.png

2 Likes

Thank you for this. Have added it to my custom plugin library.

Thank you!

Don’t know if it is solved…
You can find a plugin called “Kickstart Blueprint Library” in UE marketplace.

It has a BP node of “Get Project Version”, it gives you the exact project version string.

Here’s the example video

Cheers!

Hi there, just love the simplicity of the solution you proposed so I made a quick video on how to do it for the C++ noobs like me :slight_smile: