|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
GameVisitor |
Hey all,
is there a way to read from gdscript the Exported Version ?
For example in Android export dialog, we set the version code and version name.
That would be helpful to display to the user.
Thx
Good question, and makes me wonder what the point of setting the version number/name is when exporting (especially for Windows)?
SteveSmith | 2023-01-05 14:39
system
2
|
|
|
 |
Reply From: |
jptester |
Try adding your own property to the project and then read it with:
ProjectSettings.get_setting("application/config/<your_property>"
system
3
|
|
|
 |
Reply From: |
dpensky |
You can do something like this:
if OS.get_name() == "Android":
var export_config: ConfigFile = ConfigFile.new()
var err = export_config.load("res://export_presets.cfg")
if err == OK:
print(export_config.get_value("preset.1.options", 'version/code'))
print(export_config.get_value("preset.1.options", 'version/name'))
else:
print('[engine_root] Error open export_presets.cfgs')
export_presets.cfg need to be added manually to list of files to be exported
maybe you will need to change this param “preset.1.options”
Epic, works like a charm and saved my day 
SilvanaBanana | 2021-06-22 08:48
1 Like