From 36420114e0f34da38cf46840863262dea70d5e46 Mon Sep 17 00:00:00 2001 From: penev92 Date: Fri, 14 Apr 2023 18:42:01 +0300 Subject: [PATCH] Fixed packaging for Windows missing assembly info Apparently building/publishing/packaging for Windows on Linux using .NET 6 sets some of the assembly / Portable Executable information for the generated DLL, but nothing for the generated EXE (which isn't the case when building on Windows). --- packaging/windows/buildpackage.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh index 15596a09cb..004fa19ebe 100755 --- a/packaging/windows/buildpackage.sh +++ b/packaging/windows/buildpackage.sh @@ -47,9 +47,20 @@ function makelauncher() MOD_ID="${3}" PLATFORM="${4}" + TAG_TYPE="${TAG%%-*}" + TAG_VERSION="${TAG#*-}" + BACKWARDS_TAG="${TAG_VERSION}-${TAG_TYPE}" + convert "${ARTWORK_DIR}/${MOD_ID}_16x16.png" "${ARTWORK_DIR}/${MOD_ID}_24x24.png" "${ARTWORK_DIR}/${MOD_ID}_32x32.png" "${ARTWORK_DIR}/${MOD_ID}_48x48.png" "${ARTWORK_DIR}/${MOD_ID}_256x256.png" "${BUILTDIR}/${MOD_ID}.ico" install_windows_launcher "${SRCDIR}" "${BUILTDIR}" "win-${PLATFORM}" "${MOD_ID}" "${LAUNCHER_NAME}" "${DISPLAY_NAME}" "${FAQ_URL}" "${TAG}" + # Use rcedit to patch the generated EXE with missing assembly/PortableExecutable information because .NET 6 ignores that when building on Linux. + # Using a backwards version tag because rcedit is unable to set versions starting with a letter. + wine64 rcedit-x64.exe "${BUILTDIR}/${LAUNCHER_NAME}.exe" --set-product-version "${BACKWARDS_TAG}" + wine64 rcedit-x64.exe "${BUILTDIR}/${LAUNCHER_NAME}.exe" --set-version-string "ProductName" "OpenRA" + wine64 rcedit-x64.exe "${BUILTDIR}/${LAUNCHER_NAME}.exe" --set-version-string "CompanyName" "The OpenRA team" + wine64 rcedit-x64.exe "${BUILTDIR}/${LAUNCHER_NAME}.exe" --set-version-string "FileDescription" "${LAUNCHER_NAME} mod for OpenRA" + wine64 rcedit-x64.exe "${BUILTDIR}/${LAUNCHER_NAME}.exe" --set-version-string "LegalCopyright" "Copyright (c) The OpenRA Developers and Contributors" wine64 rcedit-x64.exe "${BUILTDIR}/${LAUNCHER_NAME}.exe" --set-icon "${BUILTDIR}/${MOD_ID}.ico" }