From cc35dbdb3d1fe0a82557857a72d842f1217812c2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 4 Dec 2021 20:25:53 -0500 Subject: fix self-contained install on Windows --- build/prepare-install-package.sh | 9 ++++----- src/SMAPI.Installer/assets/runtimeconfig.json | 16 ++++++++++++++++ src/SMAPI.Installer/assets/runtimeconfig.unix.json | 15 --------------- src/SMAPI.Installer/assets/runtimeconfig.windows.json | 13 ------------- src/SMAPI/SMAPI.csproj | 3 +++ 5 files changed, 23 insertions(+), 33 deletions(-) create mode 100644 src/SMAPI.Installer/assets/runtimeconfig.json delete mode 100644 src/SMAPI.Installer/assets/runtimeconfig.unix.json delete mode 100644 src/SMAPI.Installer/assets/runtimeconfig.windows.json diff --git a/build/prepare-install-package.sh b/build/prepare-install-package.sh index 07dae217..39575c4c 100755 --- a/build/prepare-install-package.sh +++ b/build/prepare-install-package.sh @@ -97,11 +97,10 @@ for folder in ${folders[@]}; do rm -rf "$internalPath/assets" # runtime config for SMAPI - if [ $folder == "linux" ] || [ $folder == "macOS" ]; then - cp "$installAssets/runtimeconfig.unix.json" "$bundlePath/StardewModdingAPI.runtimeconfig.json" - else - cp "$installAssets/runtimeconfig.$folder.json" "$bundlePath/StardewModdingAPI.runtimeconfig.json" - fi + # This is identical to the one generated by the build, except that the min runtime version is + # set to 5.0.0 (instead of whatever version it was built with) and rollForward is set to latestMinor instead of + # minor. + cp "$installAssets/runtimeconfig.json" "$bundlePath/StardewModdingAPI.runtimeconfig.json" # installer DLL config if [ $folder == "windows" ]; then diff --git a/src/SMAPI.Installer/assets/runtimeconfig.json b/src/SMAPI.Installer/assets/runtimeconfig.json new file mode 100644 index 00000000..34018b8a --- /dev/null +++ b/src/SMAPI.Installer/assets/runtimeconfig.json @@ -0,0 +1,16 @@ +{ + "runtimeOptions": { + "tfm": "net5.0", + "includedFrameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "5.0.0", + "rollForward": "latestMinor" + } + ], + "configProperties": { + "System.Runtime.TieredCompilation": false, + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false + } + } +} diff --git a/src/SMAPI.Installer/assets/runtimeconfig.unix.json b/src/SMAPI.Installer/assets/runtimeconfig.unix.json deleted file mode 100644 index a1d060b5..00000000 --- a/src/SMAPI.Installer/assets/runtimeconfig.unix.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net5.0", - "includedFrameworks": [ - { - "name": "Microsoft.NETCore.App", - "version": "5.0.0", - "rollForward": "major" - } - ], - "configProperties": { - "System.Runtime.TieredCompilation": false - } - } -} diff --git a/src/SMAPI.Installer/assets/runtimeconfig.windows.json b/src/SMAPI.Installer/assets/runtimeconfig.windows.json deleted file mode 100644 index d5f24bdb..00000000 --- a/src/SMAPI.Installer/assets/runtimeconfig.windows.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net5.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "5.0.0", - "rollForward": "major" - }, - "configProperties": { - "System.Runtime.TieredCompilation": false - } - } -} diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index b99028da..f07ede87 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -13,6 +13,9 @@ true + + + false -- cgit