Merge pull request #1244 from ispyisail/fix/windows-longpath-manifest

Add longPathAware to the Windows manifest
This commit is contained in:
Laurent Trinques
2026-10-02 13:22:32 +02:00
committed by GitHub
3 changed files with 51 additions and 0 deletions
+12
View File
@@ -159,6 +159,18 @@ if(WIN32)
${QET_DIR}/qelectrotech.qrc
${QET_DIR}/ico/icon-themes.qrc
)
# Our own manifest (it declares longPathAware). MSVC merges a .manifest
# listed as a source; MinGW needs it embedded through a resource file,
# and ld then keeps it ahead of the toolchain's default manifest.
set(QET_MANIFEST_FILE ${QET_DIR}/build-aux/windows/qelectrotech.exe.manifest)
if(MSVC)
target_sources(${PROJECT_NAME} PRIVATE ${QET_MANIFEST_FILE})
else()
configure_file(${QET_DIR}/build-aux/windows/qelectrotech-manifest.rc.in
${CMAKE_CURRENT_BINARY_DIR}/qelectrotech-manifest.rc @ONLY)
target_sources(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/qelectrotech-manifest.rc)
endif()
else()
add_executable(
${PROJECT_NAME}
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Embeds qelectrotech.exe.manifest as the program's manifest
// (resource id 1 = CREATEPROCESS_MANIFEST_RESOURCE_ID, type 24 = RT_MANIFEST).
1 24 "@QET_MANIFEST_FILE@"
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- SPDX-License-Identifier: GPL-2.0-or-later -->
<!--
Application manifest for QElectroTech.exe, embedded by CMake on Windows.
It replaces the toolchain's default manifest, so it repeats what that one
declares (supported Windows versions, run as the invoking user) and adds
longPathAware: with LongPathsEnabled set in the registry, Windows then
lets the program open files whose full path is 260 characters or more.
-->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
</assembly>