+1 vote

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

in Engine by (13 points)

2 Answers

0 votes

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.

by (28,886 points)
+1 vote

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

https://docs.godotengine.org/en/3.0/classes/class_configfile.html#class-configfile-load

Here's an example:

var export_config = ConfigFile.new()
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")
export_config.save(export_config_path)
by (20 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.