From 10a18290773f3152f018ef9ecc3f7ae4544d7367 Mon Sep 17 00:00:00 2001 From: Daniel Heath Date: Sat, 30 Nov 2019 20:25:16 +1100 Subject: [PATCH] Prevent linux install failing with cryptic error This avoids the error described at https://stackoverflow.com/questions/49242075/mono-bug-magic-number-is-wrong-542 System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542 --- src/SMAPI.Installer/unix-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SMAPI.Installer/unix-install.sh b/src/SMAPI.Installer/unix-install.sh index e3a5d8cc..6d0c86ce 100644 --- a/src/SMAPI.Installer/unix-install.sh +++ b/src/SMAPI.Installer/unix-install.sh @@ -12,6 +12,9 @@ elif type type >/dev/null 2>&1; then COMMAND="type" fi +# if $TERM is not set to xterm, mono will bail out when attempting to write to the console. +export TERM=xterm + # validate Mono & run installer if $COMMAND mono >/dev/null 2>&1; then mono internal/unix-install.exe