Skip to content

Commit

Permalink
Add workaround for untrusted exes on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Aug 25, 2018
1 parent dc86a69 commit 4d24032
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packaging/windows/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4d24032

Please sign in to comment.