Getting the Product Version

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kleber

Is there a way to get (with code) the Product Version configured inside the Export settings?

:bust_in_silhouette: Reply From: Zylann

It looks like there is no script API to get this information, I thought it was saved in ProjectSettings regardless but it isn’t.
I see it is saved in the export_presets.cfg.

If you want to access this from script you may ask for it in the issue tracker.

:bust_in_silhouette: Reply From: madcapacity

You can edit the export_presets.cfg using the ConfigFile class.

Here’s an example:

var export_config =
var export_config_path = "res://export_presets.cfg"
var config_error = export_config.load(export_config_path)
export_config.set_value("preset.0.options", "application/product_version", "dynamic product version")

By default this file, export_presets.cfg, is not available on the exported version, you have to include then manualy on the resources tab of the export config

dpensky | 2021-03-25 17:31