Add workaround for untrusted exes on Windows.

This commit is contained in:
Paul Chote 2018-08-25 10:43:19 +01:00
parent dc86a69bd4
commit 4d24032278

View File

@ -91,6 +91,10 @@ cp -Lr "${TEMPLATE_ROOT}/mods/"* "${BUILTDIR}/mods"
cp "mod.ico" "${BUILTDIR}/${MOD_ID}.ico"
cp "${SRC_DIR}/OpenRA.Game.exe.config" "${BUILTDIR}"
# 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 "${SRC_DIR}/OpenRA.Game.exe.config" "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe.config"
echo "Compiling Windows launcher"
sed "s|DISPLAY_NAME|${PACKAGING_DISPLAY_NAME}|" "${SRC_DIR}/packaging/windows/WindowsLauncher.cs.in" | sed "s|MOD_ID|${MOD_ID}|" | sed "s|FAQ_URL|${PACKAGING_FAQ_URL}|" > "${BUILTDIR}/WindowsLauncher.cs"
mcs -sdk:4.5 "${BUILTDIR}/WindowsLauncher.cs" -warn:4 -codepage:utf8 -warnaserror -out:"${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" -t:winexe ${LAUNCHER_LIBS} -win32icon:"${BUILTDIR}/${MOD_ID}.ico"