diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-12-04 15:55:29 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-12-04 15:55:29 -0500 |
commit | c80d07fddfffe4fd3f8fa69bf6cab6374eec992d (patch) | |
tree | 1322c583652748a9a3f4ba2cca0e5d7921453143 /build | |
parent | 711e17a4f99af29177fb250b24868b6e655dacb7 (diff) | |
download | SMAPI-c80d07fddfffe4fd3f8fa69bf6cab6374eec992d.tar.gz SMAPI-c80d07fddfffe4fd3f8fa69bf6cab6374eec992d.tar.bz2 SMAPI-c80d07fddfffe4fd3f8fa69bf6cab6374eec992d.zip |
migrate SMAPI to self-contained install
This removes the need to have .NET 5 installed to run SMAPI. Note that there's no need to actually bundle the .NET files, since they're already bundled into the game folder.
Diffstat (limited to 'build')
-rwxr-xr-x | build/prepare-install-package.sh | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/build/prepare-install-package.sh b/build/prepare-install-package.sh index 2d03ba82..07dae217 100755 --- a/build/prepare-install-package.sh +++ b/build/prepare-install-package.sh @@ -26,6 +26,7 @@ cd "`dirname "$0"`/.." echo "Clearing old builds..." echo "-----------------------" for path in */**/bin */**/obj; do + echo "$path" rm -rf $path done rm -rf "bin" @@ -38,10 +39,9 @@ for folder in ${folders[@]}; do runtime=${runtimes[$folder]} msbuildPlatformName=${msBuildPlatformNames[$folder]} - # SMAPI echo "Compiling SMAPI for $folder..." echo "------------------" - dotnet publish src/SMAPI --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" + dotnet publish src/SMAPI --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" --self-contained true echo "" echo "" @@ -79,7 +79,7 @@ done # copy base installer files for name in "install on Linux.sh" "install on macOS.command" "install on Windows.bat" "README.txt"; do - cp "$installAssets/$name" "$packagePath/$name" + cp "$installAssets/$name" "$packagePath" done # copy per-platform files @@ -114,7 +114,7 @@ for folder in ${folders[@]}; do name="$name.exe" fi - cp "$smapiBin/$name" "$bundlePath/$name" + cp "$smapiBin/$name" "$bundlePath" done # bundle i18n @@ -122,24 +122,24 @@ for folder in ${folders[@]}; do # bundle smapi-internal for name in "0Harmony.dll" "0Harmony.xml" "Mono.Cecil.dll" "Mono.Cecil.Mdb.dll" "Mono.Cecil.Pdb.dll" "MonoMod.Common.dll" "Newtonsoft.Json.dll" "TMXTile.dll" "SMAPI.Toolkit.dll" "SMAPI.Toolkit.pdb" "SMAPI.Toolkit.xml" "SMAPI.Toolkit.CoreInterfaces.dll" "SMAPI.Toolkit.CoreInterfaces.pdb" "SMAPI.Toolkit.CoreInterfaces.xml"; do - cp "$smapiBin/$name" "$bundlePath/smapi-internal/$name" + cp "$smapiBin/$name" "$bundlePath/smapi-internal" done cp "$smapiBin/SMAPI.config.json" "$bundlePath/smapi-internal/config.json" cp "$smapiBin/SMAPI.metadata.json" "$bundlePath/smapi-internal/metadata.json" if [ $folder == "linux" ] || [ $folder == "macOS" ]; then - cp "$installAssets/unix-launcher.sh" "$bundlePath/unix-launcher.sh" - cp "$smapiBin/System.Runtime.Caching.dll" "$bundlePath/smapi-internal/System.Runtime.Caching.dll" + cp "$installAssets/unix-launcher.sh" "$bundlePath" + cp "$smapiBin/System.Runtime.Caching.dll" "$bundlePath/smapi-internal" else cp "$installAssets/windows-exe-config.xml" "$bundlePath/StardewModdingAPI.exe.config" fi # copy .NET dependencies - cp "$smapiBin/System.Configuration.ConfigurationManager.dll" "$bundlePath/smapi-internal/System.Configuration.ConfigurationManager.dll" - cp "$smapiBin/System.Runtime.Caching.dll" "$bundlePath/smapi-internal/System.Runtime.Caching.dll" - cp "$smapiBin/System.Security.Permissions.dll" "$bundlePath/smapi-internal/System.Security.Permissions.dll" + cp "$smapiBin/System.Configuration.ConfigurationManager.dll" "$bundlePath/smapi-internal" + cp "$smapiBin/System.Runtime.Caching.dll" "$bundlePath/smapi-internal" + cp "$smapiBin/System.Security.Permissions.dll" "$bundlePath/smapi-internal" if [ $folder == "windows" ]; then - cp "$smapiBin/System.Management.dll" "$bundlePath/smapi-internal/System.Management.dll" + cp "$smapiBin/System.Management.dll" "$bundlePath/smapi-internal" fi # copy bundled mods @@ -149,9 +149,9 @@ for folder in ${folders[@]}; do mkdir "$targetPath" --parents - cp "$fromPath/$modName.dll" "$targetPath/$modName.dll" - cp "$fromPath/$modName.pdb" "$targetPath/$modName.pdb" - cp "$fromPath/manifest.json" "$targetPath/manifest.json" + cp "$fromPath/$modName.dll" "$targetPath" + cp "$fromPath/$modName.pdb" "$targetPath" + cp "$fromPath/manifest.json" "$targetPath" if [ -d "$fromPath/i18n" ]; then cp -r "$fromPath/i18n" "$targetPath" fi |