Enable itch app auto updates on Windows.

This commit is contained in:
Matthias Mailänder
2020-09-01 20:16:08 +02:00
committed by abcdefg30
parent 7c2a51df38
commit c22392eb1e
3 changed files with 33 additions and 3 deletions

17
packaging/.itch.toml Normal file
View File

@@ -0,0 +1,17 @@
[[prereqs]]
name = "net-4.7.2"
[[actions]]
os = "windows"
name = "Red Alert"
path = "RedAlert.exe"
[[actions]]
os = "windows"
name = "Dune 2000"
path = "Dune2000.exe"
[[actions]]
os = "windows"
name = "Tiberian Dawn"
path = "TiberianDawn.exe"

View File

@@ -29,10 +29,12 @@ chmod +x butler
./butler -V
./butler login
./butler push "${BUILD_OUTPUT_DIR}/OpenRA-${GIT_TAG}-x64.exe" "openra/openra:win" --userversion-file ../VERSION
cp ${BUILD_OUTPUT_DIR}/OpenRA-${GIT_TAG}-x64-winportable.zip OpenRA-${GIT_TAG}-x64-win-itch-portable.zip
zip -u OpenRA-${GIT_TAG}-x64-win-itch-portable.zip .itch.toml
./butler push "OpenRA-${GIT_TAG}-x64-win-itch-portable.zip" "openra/openra:win" --userversion-file ../VERSION
./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-${GIT_TAG}.dmg" "openra/openra:osx" --userversion-file ../VERSION
./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-Dune-2000-x86_64.AppImage" "openra/openra:linux-d2k" --userversion-file ../VERSION
./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-Red-Alert-x86_64.AppImage" "openra/openra:linux-ra" --userversion-file ../VERSION
./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-Tiberian-Dawn-x86_64.AppImage" "openra/openra:linux-td" --userversion-file ../VERSION
rm butler butler-linux-amd64.zip
rm butler butler-linux-amd64.zip 7z.so libc7zip.so

View File

@@ -42,6 +42,10 @@ function makelauncher()
csc WindowsLauncher.cs -warn:4 -warnaserror -platform:"${PLATFORM}" -out:"${BUILTDIR}/${LAUNCHER_NAME}" -t:winexe ${LAUNCHER_LIBS} -win32icon:"${BUILTDIR}/${MOD_ID}.ico"
rm WindowsLauncher.cs
# We need to set the loadFromRemoteSources flag for the launcher, but only for the "portable" zip package.
# Windows automatically un-trusts executables that are extracted from a downloaded zip file
cp "${BUILTDIR}/OpenRA.Game.exe.config" "${BUILTDIR}/${LAUNCHER_NAME}.config"
if [ "${PLATFORM}" = "x86" ]; then
# Enable the full 4GB address space for the 32 bit game executable
# The server and utility do not use enough memory to need this
@@ -76,11 +80,12 @@ function build_platform()
make install-dependencies "${TARGETPLATFORM}" gameinstalldir="" DESTDIR="${BUILTDIR}"
popd > /dev/null || exit 1
cp "${SRCDIR}/OpenRA.Game.exe.config" "${BUILTDIR}"
echo "Compiling Windows launchers (${PLATFORM})"
makelauncher "RedAlert.exe" "Red Alert" "ra" ${PLATFORM}
makelauncher "TiberianDawn.exe" "Tiberian Dawn" "cnc" ${PLATFORM}
makelauncher "Dune2000.exe" "Dune 2000" "d2k" ${PLATFORM}
cp "${SRCDIR}/OpenRA.Game.exe.config" "${BUILTDIR}"
echo "Building Windows setup.exe ($1)"
makensis -V2 -DSRCDIR="${BUILTDIR}" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" ${USE_PROGRAMFILES32} OpenRA.nsi
@@ -90,6 +95,12 @@ function build_platform()
exit 1
fi
echo "Packaging zip archive ($1)"
pushd "${BUILTDIR}" > /dev/null
zip "OpenRA-${TAG}-${1}-winportable.zip" -r -9 * --quiet
mv "OpenRA-${TAG}-${1}-winportable.zip" "${OUTPUTDIR}"
popd > /dev/null
rm -rf "${BUILTDIR}"
}