Open dragonforge-dev opened 3 months ago
Set your project_settings/application/config/version value to 1.0.2.0
But the plugin is supposed to set this setting. The export preset provider uses version from export dialog presets and assigns it to project setting.
Ah, well I guess I should have mentioned then that all my exports pull the value from the Project setting. Perhaps this just won't work for me.
AFAIK the project setting is used automatically if you don't fill your export preset. The export profile provider was added before the setting was added to the engine, nowadays it might be obsolete. Auto Version addon is for filling the version automatically, so you don't have to remember to change it for each release. If you are setting the version manually then you don't need it.
Fair enough. I just ended up solving my problem this way:
func _ready():
var project_version = ProjectSettings.get_setting("application/config/version")
var version_file_path = "res://version.txt"
var saved_version = FileAccess.open(version_file_path, FileAccess.READ).get_as_text()
if project_version == "":
project_version = "v%s" % saved_version
elif project_version != saved_version:
FileAccess.open(version_file_path, FileAccess.WRITE).store_string(project_version)
$VersionLabel.text = project_version
What is version.txt
for? Is this game code or editor code?
Not sure what is your problem.
My problem is ProjectSettings.get_setting("application/config/version") doesn't bring back anything once I export the project. I just wanted to add a version label and I only wanted to update the version in one place.
ProjectSettings.get_setting("application/config/version") doesn't bring back anything once I export the project
Well that's weird. I can't reproduce it in my project. Try disabling the plugin and exporting again. If auto version is enabled and misconfigured, it might be messing with your setting.
I disabled and removed and re-installed the plugin multiple times. No joy. I appreciate the responses. I'll play with it again in a clean project.
My version is 1.0.2.0 in project_settings/application/config/version When I run the AutoExport, it changes me version to 1. If I export it to a file, it does the same thing. I've tried
version = get_export_preset_version()
andversion = get_export_preset_android_version_code()
and both do the same thing. (Note I removed the+=
in both.)Steps to Reproduce:
auto_export_version_config_file.d
to contain the line:version = get_export_preset_version()
RESULT: The version is set to 1. EXPECTED: The version would be set to 1.0.2.0