X Tutup
Skip to content

Backport Godot PRs #75950, #108472, and #111316: Remove rcedit dependency for Windows exports#25

Merged
Tekisasu-JohnK merged 6 commits intodevelfrom
copilot/backport-pr-75950-tekisasu
Nov 26, 2025
Merged

Backport Godot PRs #75950, #108472, and #111316: Remove rcedit dependency for Windows exports#25
Tekisasu-JohnK merged 6 commits intodevelfrom
copilot/backport-pr-75950-tekisasu

Conversation

Copy link

Copilot AI commented Nov 26, 2025

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 rcedit tool and wine on non-Windows platforms when modifying Windows executable resources (icons, version info).

Changes

  • New TemplateModifier class (platform/windows/export/template_modifier.h/.cpp)

    • Native PE file parsing and modification
    • Handles icon embedding and version info without external tools
  • Updated export_plugin.cpp

    • Replaced _rcedit_add_data() with _add_data() using TemplateModifier
    • Removed rcedit/wine path validation and subprocess execution
  • Removed editor settings

    • export/windows/rcedit
    • export/windows/wine (non-Windows only)
  • Removed string remaps for "rcedit" and "wine" in editor_property_name_processor.cpp

  • Project version fallback (PR [Windows export] Use project version as fallback. godotengine/godot#108472)

    • Uses get_version() instead of get() for file_version and product_version fields
    • Enables fallback to project version when version fields are empty in export preset
  • Application manifest support (PR [Windows] Fix application manifest in exported projects with modified resources. godotengine/godot#111316)

    • Added ManifestInfo struct and _create_manifest_info() method
    • Includes proper Windows application manifest in exported projects
    • Enables Windows Common Controls 6.0 for native dialog appearance
    • Enables long path awareness for Windows 10+

Backport Deviations from Godot 4.5+

Documented with NOTE: comments in code:

  • Traditional include guards vs #pragma once
  • modify_template signature uses int p_flags (Tekisasu 4.3.x API)
  • EDITOR_DEF vs EDITOR_DEF_BASIC
  • resize_zeroed vs resize_initialized (Tekisasu 4.3.x Vector API)
Original prompt

I would like godotengine#75950 backported to Tekisasu. Please document in code comments, especially any work where you had to deviate from upstream due to tekisasu being an fork of Godot by a few versions.


💡 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.

Copilot AI and others added 2 commits November 26, 2025 10:55
…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 AI changed the title [WIP] Backport PR 75950 from Godot to Tekisasu Backport Godot PR #75950: Remove rcedit dependency for Windows exports Nov 26, 2025
Copilot AI requested a review from Tekisasu-JohnK November 26, 2025 11:05
@Tekisasu-JohnK
Copy link

@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':
platform/windows/export/template_modifier.cpp:92:15: error: 'class Vector' has no member named 'resize_initialized'
92 | bytes.resize_initialized(12);
| ^~~~~~~~~~~~~~~~~~
platform/windows/export/template_modifier.cpp: In member function 'Error TemplateModifier::_modify_template(const Ref&, const String&, const String&) const':
platform/windows/export/template_modifier.cpp:614:19: error: 'class Vector' has no member named 'resize_initialized'
614 | resources.resize_initialized(_snap(resources.size(), BLOCK_SIZE));
| ^~~~~~~~~~~~~~~~~~
scons: *** [platform/windows/export/template_modifier.windows.editor.x86_64.o] Error 1
scons: building terminated because of errors.

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>
Copy link
Author

Copilot AI commented Nov 26, 2025

@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 ...

Fixed in 3a4f825. The resize_initialized method is available in Godot 4.5 but not in Tekisasu 4.3.x. I've replaced it with resize_zeroed which has the same behavior (resizes and zero-initializes new elements) and is available in the Tekisasu codebase. Added documentation comments noting this as another backport deviation from upstream.

@Tekisasu-JohnK
Copy link

@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.

Copy link
Author

Copilot AI commented Nov 26, 2025

@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 export/windows/rcedit and export/windows/wine editor settings were already removed in commit dfd1b20. The current export.cpp file no longer defines these settings - only signtool (Windows) and osslsigncode (non-Windows) remain for code signing.

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.

@Tekisasu-JohnK
Copy link

@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>
Copy link
Author

Copilot AI commented Nov 26, 2025

@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...

The warning "Unable to initialize Windows common controls" is unrelated to the rcedit backport - it's in display_server_windows.cpp which I haven't modified.

However, I've applied the fix from Godot PR godotengine#108472 in commit 6017812. This changes get() to get_version() for the file_version and product_version fields, enabling fallback to the project version when these fields are left empty in the export preset.

Copilot AI changed the title Backport Godot PR #75950: Remove rcedit dependency for Windows exports Backport Godot PR #75950 and #108472: Remove rcedit dependency for Windows exports Nov 26, 2025
@Tekisasu-JohnK
Copy link

@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>
Copy link
Author

Copilot AI commented Nov 26, 2025

@copilot Please backport godotengine#111316 along with these two backports. This should fix application manifest issues introduced in upstream's PR 75950

Backported PR godotengine#111316 in commit 1147728. This adds:

  • ManifestInfo struct and _create_manifest_info() method
  • MANIFEST resource type constant (0x18)
  • Updated _create_resources() to include the manifest as the 4th resource type
  • Application manifest with Windows Common Controls 6.0 dependency and long path awareness

This should fix the "Unable to initialize Windows common controls" warning.

Copilot AI changed the title Backport Godot PR #75950 and #108472: Remove rcedit dependency for Windows exports Backport Godot PRs #75950, #108472, and #111316: Remove rcedit dependency for Windows exports Nov 26, 2025
@Tekisasu-JohnK Tekisasu-JohnK marked this pull request as ready for review November 26, 2025 12:31
@Tekisasu-JohnK Tekisasu-JohnK merged commit cf2a0b9 into devel Nov 26, 2025
@Tekisasu-JohnK Tekisasu-JohnK deleted the copilot/backport-pr-75950-tekisasu branch November 26, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup