File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -151,15 +151,28 @@ Error EditorExportPlatformPC::prepare_template(const Ref<EditorExportPreset> &p_
151151 return ERR_FILE_NOT_FOUND;
152152 }
153153
154- String wrapper_template_path = template_path.get_basename () + " _console.exe" ;
154+ // Matching the extensions in platform/windows/console_wrapper_windows.cpp
155+ static const char *const wrapper_extensions[] = {
156+ " .console.exe" ,
157+ " _console.exe" ,
158+ " console.exe" ,
159+ " console.exe" ,
160+ nullptr ,
161+ };
155162 int con_wrapper_mode = p_preset->get (" debug/export_console_wrapper" );
156163 bool copy_wrapper = (con_wrapper_mode == 1 && p_debug) || (con_wrapper_mode == 2 );
157164
158165 Ref<DirAccess> da = DirAccess::create (DirAccess::ACCESS_FILESYSTEM);
159166 da->make_dir_recursive (p_path.get_base_dir ());
160167 Error err = da->copy (template_path, p_path, get_chmod_flags ());
161- if (err == OK && copy_wrapper && FileAccess::exists (wrapper_template_path)) {
162- err = da->copy (wrapper_template_path, p_path.get_basename () + " .console.exe" , get_chmod_flags ());
168+ if (err == OK && copy_wrapper) {
169+ for (int i = 0 ; wrapper_extensions[i]; ++i) {
170+ const String wrapper_path = template_path.get_basename () + wrapper_extensions[i];
171+ if (FileAccess::exists (wrapper_path)) {
172+ err = da->copy (wrapper_path, p_path.get_basename () + " .console.exe" , get_chmod_flags ());
173+ break ;
174+ }
175+ }
163176 }
164177 if (err != OK) {
165178 add_message (EXPORT_MESSAGE_ERROR, TTR (" Prepare Template" ), TTR (" Failed to copy export template." ));
You can’t perform that action at this time.
0 commit comments