Initial commit: OpenRA game engine
Fork from OpenRA/OpenRA with one-click launch script (start-ra.cmd) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
284
packaging/windows/OpenRA.nsi
Normal file
284
packaging/windows/OpenRA.nsi
Normal file
@@ -0,0 +1,284 @@
|
||||
; Copyright (c) The OpenRA Developers and Contributors
|
||||
; This file is part of OpenRA.
|
||||
;
|
||||
; OpenRA is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; OpenRA is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with OpenRA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
!include "MUI2.nsh"
|
||||
!include "FileFunc.nsh"
|
||||
!include "WordFunc.nsh"
|
||||
|
||||
Name "OpenRA"
|
||||
OutFile "${OUTFILE}"
|
||||
|
||||
ManifestDPIAware true
|
||||
|
||||
Unicode True
|
||||
|
||||
Function .onInit
|
||||
!ifndef USE_PROGRAMFILES32
|
||||
SetRegView 64
|
||||
!endif
|
||||
ReadRegStr $INSTDIR HKLM "Software\OpenRA${SUFFIX}" "InstallDir"
|
||||
StrCmp $INSTDIR "" unset done
|
||||
unset:
|
||||
!ifndef USE_PROGRAMFILES32
|
||||
StrCpy $INSTDIR "$PROGRAMFILES64\OpenRA${SUFFIX}"
|
||||
!else
|
||||
StrCpy $INSTDIR "$PROGRAMFILES32\OpenRA${SUFFIX}"
|
||||
!endif
|
||||
done:
|
||||
FunctionEnd
|
||||
|
||||
SetCompressor lzma
|
||||
RequestExecutionLevel admin
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "${SRCDIR}\COPYING"
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenRA${SUFFIX}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "OpenRA"
|
||||
|
||||
Var StartMenuFolder
|
||||
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
||||
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
!define RA_DISCORDID 699222659766026240
|
||||
!define CNC_DISCORDID 699223250181292033
|
||||
!define D2K_DISCORDID 712711732770111550
|
||||
|
||||
;***************************
|
||||
;Section Definitions
|
||||
;***************************
|
||||
Section "-Reg" Reg
|
||||
|
||||
; Installation directory
|
||||
WriteRegStr HKLM "Software\OpenRA${SUFFIX}" "InstallDir" $INSTDIR
|
||||
|
||||
; Join server URL Scheme
|
||||
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}" "" "URL:Join OpenRA server"
|
||||
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}" "URL Protocol" ""
|
||||
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}\DefaultIcon" "" "$INSTDIR\ra.ico,0"
|
||||
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}\Shell\Open\Command" "" "$INSTDIR\RedAlert.exe Launch.URI=%1"
|
||||
|
||||
WriteRegStr HKLM "Software\Classes\discord-${RA_DISCORDID}" "" "URL:Run game ${RA_DISCORDID} protocol"
|
||||
WriteRegStr HKLM "Software\Classes\discord-${RA_DISCORDID}" "URL Protocol" ""
|
||||
WriteRegStr HKLM "Software\Classes\discord-${RA_DISCORDID}\DefaultIcon" "" "$INSTDIR\ra.ico,0"
|
||||
WriteRegStr HKLM "Software\Classes\discord-${RA_DISCORDID}\Shell\Open\Command" "" "$INSTDIR\RedAlert.exe"
|
||||
|
||||
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}" "" "URL:Join OpenRA server"
|
||||
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}" "URL Protocol" ""
|
||||
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}\DefaultIcon" "" "$INSTDIR\cnc.ico,0"
|
||||
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}\Shell\Open\Command" "" "$INSTDIR\TiberianDawn.exe Launch.URI=%1"
|
||||
|
||||
WriteRegStr HKLM "Software\Classes\discord-${CNC_DISCORDID}" "" "URL:Run game ${CNC_DISCORDID} protocol"
|
||||
WriteRegStr HKLM "Software\Classes\discord-${CNC_DISCORDID}" "URL Protocol" ""
|
||||
WriteRegStr HKLM "Software\Classes\discord-${CNC_DISCORDID}\DefaultIcon" "" "$INSTDIR\cnc.ico,0"
|
||||
WriteRegStr HKLM "Software\Classes\discord-${CNC_DISCORDID}\Shell\Open\Command" "" "$INSTDIR\TiberianDawn.exe"
|
||||
|
||||
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}" "" "URL:Join OpenRA server"
|
||||
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}" "URL Protocol" ""
|
||||
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}\DefaultIcon" "" "$INSTDIR\d2k.ico,0"
|
||||
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}\Shell\Open\Command" "" "$INSTDIR\Dune2000.exe Launch.URI=%1"
|
||||
|
||||
WriteRegStr HKLM "Software\Classes\discord-${D2K_DISCORDID}" "" "URL:Run game ${D2K_DISCORDID} protocol"
|
||||
WriteRegStr HKLM "Software\Classes\discord-${D2K_DISCORDID}" "URL Protocol" ""
|
||||
WriteRegStr HKLM "Software\Classes\discord-${D2K_DISCORDID}\DefaultIcon" "" "$INSTDIR\d2k.ico,0"
|
||||
WriteRegStr HKLM "Software\Classes\discord-${D2K_DISCORDID}\Shell\Open\Command" "" "$INSTDIR\Dune2000.exe"
|
||||
|
||||
; Remove obsolete file associations
|
||||
DeleteRegKey HKLM "Software\Classes\.orarep"
|
||||
DeleteRegKey HKLM "Software\Classes\OpenRA_replay"
|
||||
DeleteRegKey HKLM "Software\Classes\.oramod"
|
||||
DeleteRegKey HKLM "Software\Classes\OpenRA_mod"
|
||||
DeleteRegKey HKLM "Software\Classes\openra"
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section "Game" GAME
|
||||
SectionIn RO
|
||||
|
||||
RMDir /r "$INSTDIR\mods"
|
||||
SetOutPath "$INSTDIR\mods"
|
||||
File /r "${SRCDIR}\mods\common"
|
||||
File /r "${SRCDIR}\mods\common-content"
|
||||
File /r "${SRCDIR}\mods\cnc"
|
||||
File /r "${SRCDIR}\mods\cnc-content"
|
||||
File /r "${SRCDIR}\mods\d2k"
|
||||
File /r "${SRCDIR}\mods\d2k-content"
|
||||
File /r "${SRCDIR}\mods\ra"
|
||||
File /r "${SRCDIR}\mods\ra-content"
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
File "${SRCDIR}\*.exe"
|
||||
File "${SRCDIR}\*.dll.config"
|
||||
File "${SRCDIR}\*.dll"
|
||||
File "${SRCDIR}\*.ico"
|
||||
File "${SRCDIR}\*.deps.json"
|
||||
File "${SRCDIR}\*.runtimeconfig.json"
|
||||
File "${SRCDIR}\global mix database.dat"
|
||||
File "${SRCDIR}\IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP"
|
||||
File "${SRCDIR}\VERSION"
|
||||
File "${SRCDIR}\AUTHORS"
|
||||
File "${SRCDIR}\COPYING"
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Red Alert${SUFFIX}.lnk" $OUTDIR\RedAlert.exe "" \
|
||||
"$OUTDIR\RedAlert.exe" "" "" "" ""
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Tiberian Dawn${SUFFIX}.lnk" $OUTDIR\TiberianDawn.exe "" \
|
||||
"$OUTDIR\TiberianDawn.exe" "" "" "" ""
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Dune 2000${SUFFIX}.lnk" $OUTDIR\Dune2000.exe "" \
|
||||
"$OUTDIR\Dune2000.exe" "" "" "" ""
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
|
||||
SetOutPath "$INSTDIR\glsl"
|
||||
File "${SRCDIR}\glsl\*.frag"
|
||||
File "${SRCDIR}\glsl\*.vert"
|
||||
|
||||
; Estimated install size for the control panel properties
|
||||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||
IntFmt $0 "0x%08X" $0
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "EstimatedSize" "$0"
|
||||
|
||||
SetShellVarContext all
|
||||
CreateDirectory "$APPDATA\OpenRA\ModMetadata"
|
||||
SetOutPath "$INSTDIR"
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" ra --register-mod "$INSTDIR\RedAlert.exe" system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" ra --clear-invalid-mod-registrations system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" cnc --register-mod "$INSTDIR\TiberianDawn.exe" system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" cnc --clear-invalid-mod-registrations system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" d2k --register-mod "$INSTDIR\Dune2000.exe" system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" d2k --clear-invalid-mod-registrations system'
|
||||
SetShellVarContext current
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section "Desktop Shortcut" DESKTOPSHORTCUT
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateShortCut "$DESKTOP\OpenRA - Red Alert${SUFFIX}.lnk" $INSTDIR\RedAlert.exe "" \
|
||||
"$INSTDIR\RedAlert.exe" "" "" "" ""
|
||||
CreateShortCut "$DESKTOP\OpenRA - Tiberian Dawn${SUFFIX}.lnk" $INSTDIR\TiberianDawn.exe "" \
|
||||
"$INSTDIR\TiberianDawn.exe" "" "" "" ""
|
||||
CreateShortCut "$DESKTOP\OpenRA - Dune 2000${SUFFIX}.lnk" $INSTDIR\Dune2000.exe "" \
|
||||
"$INSTDIR\Dune2000.exe" "" "" "" ""
|
||||
SectionEnd
|
||||
|
||||
;***************************
|
||||
;Uninstaller Sections
|
||||
;***************************
|
||||
Section "-Uninstaller"
|
||||
WriteUninstaller $INSTDIR\uninstaller.exe
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "DisplayName" "OpenRA${SUFFIX}"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "UninstallString" "$INSTDIR\uninstaller.exe"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "QuietUninstallString" "$\"$INSTDIR\uninstaller.exe$\" /S"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "InstallLocation" "$INSTDIR"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "DisplayIcon" "$INSTDIR\ra.ico"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "Publisher" "OpenRA developers"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "URLInfoAbout" "https://openra.net"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "DisplayVersion" "${TAG}"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "NoModify" "1"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "NoRepair" "1"
|
||||
SectionEnd
|
||||
|
||||
!macro Clean UN
|
||||
Function ${UN}Clean
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" ra --unregister-mod system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" cnc --unregister-mod system'
|
||||
nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" d2k --unregister-mod system'
|
||||
|
||||
RMDir /r $INSTDIR\mods
|
||||
RMDir /r $INSTDIR\maps
|
||||
RMDir /r $INSTDIR\glsl
|
||||
Delete $INSTDIR\*.exe
|
||||
Delete $INSTDIR\*.dll
|
||||
Delete $INSTDIR\*.ico
|
||||
Delete $INSTDIR\*.dll.config
|
||||
Delete $INSTDIR\*.deps.json
|
||||
Delete $INSTDIR\*.runtimeconfig.json
|
||||
Delete $INSTDIR\VERSION
|
||||
Delete $INSTDIR\AUTHORS
|
||||
Delete $INSTDIR\COPYING
|
||||
Delete "$INSTDIR\global mix database.dat"
|
||||
Delete $INSTDIR\IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
|
||||
|
||||
RMDir /r $INSTDIR\Support
|
||||
|
||||
!ifndef USE_PROGRAMFILES32
|
||||
SetRegView 64
|
||||
!endif
|
||||
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}"
|
||||
DeleteRegKey HKLM "Software\Classes\openra-ra-${TAG}"
|
||||
DeleteRegKey HKLM "Software\Classes\openra-cnc-${TAG}"
|
||||
DeleteRegKey HKLM "Software\Classes\openra-d2k-${TAG}"
|
||||
|
||||
DeleteRegKey HKLM "Software\Classes\discord-${RA_DISCORDID}"
|
||||
DeleteRegKey HKLM "Software\Classes\discord-${CNC_DISCORDID}"
|
||||
DeleteRegKey HKLM "Software\Classes\discord-${D2K_DISCORDID}"
|
||||
|
||||
Delete $INSTDIR\uninstaller.exe
|
||||
RMDir $INSTDIR
|
||||
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
||||
|
||||
; Clean up start menu: Delete all our icons, and the OpenRA folder
|
||||
; *only* if we were the only installed version
|
||||
Delete "$SMPROGRAMS\$StartMenuFolder\Red Alert${SUFFIX}.lnk"
|
||||
Delete "$SMPROGRAMS\$StartMenuFolder\Tiberian Dawn${SUFFIX}.lnk"
|
||||
Delete "$SMPROGRAMS\$StartMenuFolder\Dune 2000${SUFFIX}.lnk"
|
||||
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
||||
|
||||
Delete "$DESKTOP\OpenRA - Red Alert${SUFFIX}.lnk"
|
||||
Delete "$DESKTOP\OpenRA - Tiberian Dawn${SUFFIX}.lnk"
|
||||
Delete "$DESKTOP\OpenRA - Dune 2000${SUFFIX}.lnk"
|
||||
DeleteRegKey HKLM "Software\OpenRA${SUFFIX}"
|
||||
FunctionEnd
|
||||
!macroend
|
||||
|
||||
!insertmacro Clean ""
|
||||
!insertmacro Clean "un."
|
||||
|
||||
Section "Uninstall"
|
||||
Call un.Clean
|
||||
SectionEnd
|
||||
|
||||
;***************************
|
||||
;Section Descriptions
|
||||
;***************************
|
||||
LangString DESC_GAME ${LANG_ENGLISH} "OpenRA engine, official mods and dependencies"
|
||||
LangString DESC_DESKTOPSHORTCUT ${LANG_ENGLISH} "Place shortcut on the Desktop."
|
||||
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${GAME} $(DESC_GAME)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${DESKTOPSHORTCUT} $(DESC_DESKTOPSHORTCUT)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
;***************************
|
||||
;Callbacks
|
||||
;***************************
|
||||
|
||||
Function .onInstFailed
|
||||
Call Clean
|
||||
FunctionEnd
|
||||
96
packaging/windows/buildpackage.sh
Normal file
96
packaging/windows/buildpackage.sh
Normal file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
# OpenRA packaging script for Windows
|
||||
|
||||
set -o errexit -o pipefail || exit $?
|
||||
|
||||
command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "Windows packaging requires curl or wget."; exit 1; }
|
||||
command -v makensis >/dev/null 2>&1 || { echo >&2 "Windows packaging requires makensis."; exit 1; }
|
||||
command -v convert >/dev/null 2>&1 || { echo >&2 "Windows packaging requires ImageMagick."; exit 1; }
|
||||
command -v python3 >/dev/null 2>&1 || { echo >&2 "Windows packaging requires python 3."; exit 1; }
|
||||
command -v wine64 >/dev/null 2>&1 || { echo >&2 "Windows packaging requires wine64."; exit 1; }
|
||||
|
||||
if [ $# -ne "2" ]; then
|
||||
echo "Usage: $(basename "$0") tag outputdir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the working dir to the location of this script
|
||||
HERE=$(dirname "$0")
|
||||
cd "${HERE}"
|
||||
. ../functions.sh
|
||||
|
||||
TAG="$1"
|
||||
OUTPUTDIR="$2"
|
||||
SRCDIR="$(pwd)/../.."
|
||||
BUILTDIR="$(pwd)/build"
|
||||
ARTWORK_DIR="$(pwd)/../artwork/"
|
||||
|
||||
FAQ_URL="https://wiki.openra.net/FAQ"
|
||||
|
||||
SUFFIX=" (dev)"
|
||||
if [[ ${TAG} == release* ]]; then
|
||||
SUFFIX=""
|
||||
elif [[ ${TAG} == playtest* ]]; then
|
||||
SUFFIX=" (playtest)"
|
||||
fi
|
||||
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -s -L -O https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
|
||||
else
|
||||
wget -cq https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
|
||||
fi
|
||||
|
||||
function makelauncher()
|
||||
{
|
||||
LAUNCHER_NAME="${1}"
|
||||
DISPLAY_NAME="${2}"
|
||||
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 8 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"
|
||||
}
|
||||
|
||||
function build_platform()
|
||||
{
|
||||
PLATFORM="${1}"
|
||||
|
||||
echo "Building core files (${PLATFORM})"
|
||||
|
||||
install_assemblies "${SRCDIR}" "${BUILTDIR}" "win-${PLATFORM}" "False" "True" "True"
|
||||
install_data "${SRCDIR}" "${BUILTDIR}" "cnc" "d2k" "ra"
|
||||
set_engine_version "${TAG}" "${BUILTDIR}"
|
||||
set_mod_version "${TAG}" "${BUILTDIR}/mods/cnc/mod.yaml" "${BUILTDIR}/mods/d2k/mod.yaml" "${BUILTDIR}/mods/ra/mod.yaml" "${BUILTDIR}/mods/cnc-content/mod.yaml" "${BUILTDIR}/mods/d2k-content/mod.yaml" "${BUILTDIR}/mods/ra-content/mod.yaml"
|
||||
|
||||
echo "Compiling Windows launchers (${PLATFORM})"
|
||||
makelauncher "RedAlert" "Red Alert" "ra" "${PLATFORM}"
|
||||
makelauncher "TiberianDawn" "Tiberian Dawn" "cnc" "${PLATFORM}"
|
||||
makelauncher "Dune2000" "Dune 2000" "d2k" "${PLATFORM}"
|
||||
|
||||
echo "Building Windows setup.exe (${PLATFORM})"
|
||||
makensis -V2 -DSRCDIR="${BUILTDIR}" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" -DOUTFILE="${OUTPUTDIR}/OpenRA-${TAG}-${PLATFORM}.exe" OpenRA.nsi
|
||||
|
||||
echo "Packaging zip archive ($PLATFORM)"
|
||||
pushd "${BUILTDIR}" > /dev/null
|
||||
zip "OpenRA-${TAG}-${PLATFORM}-winportable.zip" -r -9 ./* --quiet
|
||||
mv "OpenRA-${TAG}-${PLATFORM}-winportable.zip" "${OUTPUTDIR}"
|
||||
popd > /dev/null
|
||||
|
||||
rm -rf "${BUILTDIR}"
|
||||
}
|
||||
|
||||
build_platform "x64"
|
||||
rm rcedit-x64.exe
|
||||
29
packaging/windows/fixlauncher.py
Normal file
29
packaging/windows/fixlauncher.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Copyright (c) The OpenRA Developers and Contributors
|
||||
# This file is part of OpenRA, which is free software. It is made
|
||||
# available to you under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation, either version 3 of
|
||||
# the License, or (at your option) any later version. For more
|
||||
# information, see COPYING.
|
||||
|
||||
import struct
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
print('Patching ' + sys.argv[1] + ':')
|
||||
with open(sys.argv[1], 'r+b') as assembly:
|
||||
assembly.seek(0x3c)
|
||||
peOffset = struct.unpack('H', assembly.read(2))[0]
|
||||
|
||||
assembly.seek(peOffset)
|
||||
peSignature = struct.unpack('I', assembly.read(4))[0]
|
||||
if peSignature != 0x4550:
|
||||
print(" ERROR: Invalid PE signature")
|
||||
|
||||
print(' - Setting /LARGEADDRESSAWARE')
|
||||
assembly.seek(peOffset + 4 + 18)
|
||||
flags = struct.unpack('B', assembly.read(1))[0] | 0x20
|
||||
assembly.seek(peOffset + 4 + 18)
|
||||
assembly.write(struct.pack('B', flags))
|
||||
print(' - Setting /subsystem:windows')
|
||||
assembly.seek(peOffset + 0x5C)
|
||||
assembly.write(struct.pack("H", 0x02))
|
||||
Reference in New Issue
Block a user