summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-04 10:49:37 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-04 10:49:37 +0100
commit191c8ed12f624ec97b650b2726fed4e8c4bcf04c (patch)
tree55dee9ec04009399a0e5f8695c0b467bbd7909d4 /editor
parentaf957bf58e0116e5109a41b7cb4eac0fe4f70c75 (diff)
parent9a33c97c2a1e46f79426fa091c271d273a458bb8 (diff)
Merge pull request #67434 from bruvzg/win_wrapper
Add console wrapper app to handle console i/o redirection on Windows.
Diffstat (limited to 'editor')
-rw-r--r--editor/export/editor_export_platform_pc.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp
index c5b61e9b03..9de2f94900 100644
--- a/editor/export/editor_export_platform_pc.cpp
+++ b/editor/export/editor_export_platform_pc.cpp
@@ -146,9 +146,16 @@ Error EditorExportPlatformPC::prepare_template(const Ref<EditorExportPreset> &p_
return ERR_FILE_NOT_FOUND;
}
+ String wrapper_template_path = template_path.get_basename() + "_console.exe";
+ int con_wrapper_mode = p_preset->get("debug/export_console_script");
+ bool copy_wrapper = (con_wrapper_mode == 1 && p_debug) || (con_wrapper_mode == 2);
+
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
da->make_dir_recursive(p_path.get_base_dir());
Error err = da->copy(template_path, p_path, get_chmod_flags());
+ if (err == OK && copy_wrapper && FileAccess::exists(wrapper_template_path)) {
+ err = da->copy(wrapper_template_path, p_path.get_basename() + ".console.exe", get_chmod_flags());
+ }
if (err != OK) {
add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Template"), TTR("Failed to copy export template."));
}