diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-12-05 18:55:10 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-12-05 18:55:10 -0500 |
commit | f4ca7dd228390f030735195357e81e5170bcd474 (patch) | |
tree | 417cb3971dd08fac5cbf23518406d7658dbb7ed3 /build/windows/finalize-install-package.sh | |
parent | c05fdf65cfc8864d5f436e3a42e6e2df144c1db8 (diff) | |
download | SMAPI-f4ca7dd228390f030735195357e81e5170bcd474.tar.gz SMAPI-f4ca7dd228390f030735195357e81e5170bcd474.tar.bz2 SMAPI-f4ca7dd228390f030735195357e81e5170bcd474.zip |
add Windows build process to fix application icon until .NET bug is fixed
Diffstat (limited to 'build/windows/finalize-install-package.sh')
-rwxr-xr-x | build/windows/finalize-install-package.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/build/windows/finalize-install-package.sh b/build/windows/finalize-install-package.sh new file mode 100755 index 00000000..0996e3ed --- /dev/null +++ b/build/windows/finalize-install-package.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +########## +## Read config +########## +# get SMAPI version +version="$1" +if [ $# -eq 0 ]; then + echo "SMAPI release version (like '4.0.0'):" + read version +fi + +# get Windows bin path +windowsBinPath="$2" +if [ $# -le 1 ]; then + echo "Windows compiled bin path:" + read windowsBinPath +fi + +# installer internal folders +buildFolders=("linux" "macOS" "windows") + + +########## +## Finalize release package +########## +for folderName in "SMAPI $version installer" "SMAPI $version installer for developers"; do + # move files to Linux filesystem + echo "Preparing $folderName.zip..." + echo "-------------------------------------------------" + echo "copying '$windowsBinPath/$folderName' to Linux filesystem..." + cp -r "$windowsBinPath/$folderName" . + + # fix permissions + echo "fixing permissions..." + find "$folderName" -type d -exec chmod 755 {} \; + find "$folderName" -type f -exec chmod 644 {} \; + find "$folderName" -name "*.sh" -exec chmod 755 {} \; + find "$folderName" -name "*.command" -exec chmod 755 {} \; + find "$folderName" -name "SMAPI.Installer" -exec chmod 755 {} \; + find "$folderName" -name "StardewModdingAPI" -exec chmod 755 {} \; + + # convert bundle folder into final 'install.dat' files + for build in ${buildFolders[@]}; do + echo "packaging $folderName/internal/$build/install.dat..." + pushd "$folderName/internal/$build/bundle" > /dev/null + zip "install.dat" * --recurse-paths --quiet + mv install.dat ../ + popd > /dev/null + + rm -rf "$folderName/internal/$build/bundle" + done + + # zip installer + echo "packaging installer..." + zip -9 "$folderName.zip" "$folderName" --recurse-paths --quiet + + # move zip back to Windows bin path + echo "moving release zip to $windowsBinPath/$folderName.zip..." + mv "$folderName.zip" "$windowsBinPath" + rm -rf "$folderName" + + echo "" + echo "" +done + +echo "Done!" |