diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index 972b763e3..38e9a3339 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -268,6 +268,7 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF.exe" + set -e if [ -f "$(SolutionDir)mono_envsetup.sh" ]; then . "$(SolutionDir)mono_envsetup.sh" fi @@ -276,7 +277,13 @@ cp "$(TargetDir)config/ASF.json" "$(SolutionDir)out/config" cp "$(TargetDir)config/example.json" "$(SolutionDir)out/config" cp "$(TargetDir)config/minimal.json" "$(SolutionDir)out/config" - mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-Service.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + + if [ -n "$MONO_FACADES" ]; then + mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" "/lib:$MONO_FACADES" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-Service.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + else + mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-Service.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + fi + rm "$(SolutionDir)out/ASF-Service.exe.config" cp "$(SolutionDir)out/ASF-Service.exe" "$(SolutionDir)out/ASF.exe" diff --git a/ConfigGenerator/ConfigGenerator.csproj b/ConfigGenerator/ConfigGenerator.csproj index 3ec252567..9e9df7eba 100644 --- a/ConfigGenerator/ConfigGenerator.csproj +++ b/ConfigGenerator/ConfigGenerator.csproj @@ -176,11 +176,17 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-ConfigGenerator.exe" + set -e if [ -f "$(SolutionDir)mono_envsetup.sh" ]; then . "$(SolutionDir)mono_envsetup.sh" fi - mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + if [ -n "$MONO_FACADES" ]; then + mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" "/lib:$MONO_FACADES" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + else + mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + fi + rm "$(SolutionDir)out/ASF-ConfigGenerator.exe.config" diff --git a/GUI/GUI.csproj b/GUI/GUI.csproj index 7b094a201..59522afaf 100644 --- a/GUI/GUI.csproj +++ b/GUI/GUI.csproj @@ -377,11 +377,17 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-GUI.exe" + set -e if [ -f "$(SolutionDir)mono_envsetup.sh" ]; then . "$(SolutionDir)mono_envsetup.sh" fi - mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-GUI.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + if [ -n "$MONO_FACADES" ]; then + mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" "/lib:$MONO_FACADES" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-GUI.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + else + mono "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-GUI.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" + fi + rm "$(SolutionDir)out/ASF-GUI.exe.config" diff --git a/mono_envsetup.sh b/mono_envsetup.sh index 95ae6593b..a8d6c0946 100644 --- a/mono_envsetup.sh +++ b/mono_envsetup.sh @@ -71,4 +71,11 @@ else echo "INFO: Skipping setting of MONO_ENV_OPTIONS as it's already declared with value: $MONO_ENV_OPTIONS" fi +MONO_FACADES="" +if [ -d "/usr/lib/mono/4.5/Facades" ]; then + export MONO_FACADES="/usr/lib/mono/4.5/Facades" +else + echo "WARN: Could not find Mono facades!" +fi + echo "INFO: Mono environment setup finished!"