Skip to content

Commit

Permalink
Add missing assembly information to Windows binaries
Browse files Browse the repository at this point in the history
From OpenRA PR 20805.
  • Loading branch information
penev92 authored and PunkPun committed Nov 3, 2023
1 parent d3ee8e6 commit 092eaed
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packaging/windows/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,23 @@ function build_platform()
echo "Mod version ${MOD_VERSION} will remain unchanged.";
fi

TAG_TYPE="${TAG%%-*}"
TAG_VERSION="${TAG#*-}"
BACKWARDS_TAG="${TAG_VERSION}-${TAG_TYPE}"

# Create multi-resolution icon
convert "${ARTWORK_DIR}/icon_16x16.png" "${ARTWORK_DIR}/icon_24x24.png" "${ARTWORK_DIR}/icon_32x32.png" "${ARTWORK_DIR}/icon_48x48.png" "${ARTWORK_DIR}/icon_256x256.png" "${BUILTDIR}/${MOD_ID}.ico"

echo "Compiling Windows launcher (${PLATFORM})"
install_windows_launcher "${TEMPLATE_ROOT}/${ENGINE_DIRECTORY}" "${BUILTDIR}" "win-${PLATFORM}" "${MOD_ID}" "${PACKAGING_WINDOWS_LAUNCHER_NAME}" "${PACKAGING_DISPLAY_NAME}" "${PACKAGING_FAQ_URL}"

install_windows_launcher "${TEMPLATE_ROOT}/${ENGINE_DIRECTORY}" "${BUILTDIR}" "win-${PLATFORM}" "${MOD_ID}" "${PACKAGING_WINDOWS_LAUNCHER_NAME}" "${PACKAGING_DISPLAY_NAME}" "${PACKAGING_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}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-product-version "${BACKWARDS_TAG}"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "ProductName" "OpenRA"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "CompanyName" "The OpenRA team"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "FileDescription" "${PACKAGING_WINDOWS_LAUNCHER_NAME} mod for OpenRA"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "LegalCopyright" "Copyright (c) The OpenRA Developers and Contributors"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-icon "${BUILTDIR}/${MOD_ID}.ico"

echo "Building Windows setup.exe (${PLATFORM})"
Expand Down

0 comments on commit 092eaed

Please sign in to comment.