Backport Godot PRs #75950, #108472, and #111316: Remove rcedit dependency for Windows exports#25
Conversation
…dows exports This adds native PE resource modification via TemplateModifier, removing the need for external rcedit and wine tools when exporting for Windows. Changes: - Add template_modifier.h/cpp for native PE resource modification - Replace _rcedit_add_data with _add_data in export_plugin - Remove rcedit/wine editor settings from export.cpp - Remove rcedit/wine string remaps from editor_property_name_processor.cpp Deviations from Godot 4.5 documented in code comments: - Uses traditional include guards instead of #pragma once - modify_template uses int p_flags instead of BitField<DebugFlags> - Uses EDITOR_DEF instead of EDITOR_DEF_BASIC Co-authored-by: Tekisasu-JohnK <80524176+Tekisasu-JohnK@users.noreply.github.com>
- Handle error return from TemplateModifier::modify() - Improve _truncate() to properly return error codes - Improve error messages for icon file format and modification failures - Add comment explaining PE section name null-padding behavior Co-authored-by: Tekisasu-JohnK <80524176+Tekisasu-JohnK@users.noreply.github.com>
|
@copilot At this point, the backport is not compiling. I am getting the following errors during compilation: platform/windows/export/template_modifier.cpp: In member function 'Vector TemplateModifier::ResourceDirectoryTable::save() const': |
Tekisasu 4.3.x Vector class uses resize_zeroed instead of resize_initialized which is available in Godot 4.5. This is now documented as another backport deviation from upstream. Co-authored-by: Tekisasu-JohnK <80524176+Tekisasu-JohnK@users.noreply.github.com>
Fixed in 3a4f825. The |
|
@copilot In the editor settings window, please remove reference to Rcedit and export/windows/rcedit under Export > Windows. For non-Windows builds, please remove references here to rcedit and wine. |
The If you're still seeing these settings in the Editor Settings window, this is likely due to cached settings from a previous build. Try deleting your editor settings/config folder and rebuilding to clear the old settings. |
|
@copilot When running a build from command line, I get the warning "WARNING: Unable to initialize Windows common controls. Native dialogs may not work properly." Is this perhaps something related to upstream PR godotengine#108472 ? If so, please adapt the fixes here. |
Use get_version() instead of get() for file_version and product_version fields to enable fallback to project version when these fields are empty. Co-authored-by: Tekisasu-JohnK <80524176+Tekisasu-JohnK@users.noreply.github.com>
The warning "Unable to initialize Windows common controls" is unrelated to the rcedit backport - it's in However, I've applied the fix from Godot PR godotengine#108472 in commit 6017812. This changes |
|
@copilot Please backport godotengine#111316 along with these two backports. This should fix application manifest issues introduced in upstream's PR 75950 |
…orted Windows projects This adds the ManifestInfo struct and _create_manifest_info() method to include a proper Windows application manifest in exported projects. The manifest enables: - Windows Common Controls 6.0 for proper native dialog appearance - Long path awareness for Windows 10+ This fixes the "Unable to initialize Windows common controls" warning. Co-authored-by: Tekisasu-JohnK <80524176+Tekisasu-JohnK@users.noreply.github.com>
Backported PR godotengine#111316 in commit 1147728. This adds:
This should fix the "Unable to initialize Windows common controls" warning. |
Backports godotengine/godot#75950, godotengine/godot#108472, and godotengine/godot#111316 to Tekisasu, implementing native PE resource modification for Windows exports.
This eliminates the need for external
rcedittool andwineon non-Windows platforms when modifying Windows executable resources (icons, version info).Changes
New
TemplateModifierclass (platform/windows/export/template_modifier.h/.cpp)Updated
export_plugin.cpp_rcedit_add_data()with_add_data()using TemplateModifierRemoved editor settings
export/windows/rceditexport/windows/wine(non-Windows only)Removed string remaps for "rcedit" and "wine" in
editor_property_name_processor.cppProject version fallback (PR [Windows export] Use project version as fallback. godotengine/godot#108472)
get_version()instead ofget()for file_version and product_version fieldsApplication manifest support (PR [Windows] Fix application manifest in exported projects with modified resources. godotengine/godot#111316)
ManifestInfostruct and_create_manifest_info()methodBackport Deviations from Godot 4.5+
Documented with
NOTE:comments in code:#pragma oncemodify_templatesignature usesint p_flags(Tekisasu 4.3.x API)EDITOR_DEFvsEDITOR_DEF_BASICresize_zeroedvsresize_initialized(Tekisasu 4.3.x Vector API)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.