summaryrefslogtreecommitdiff
path: root/build/windows/finalize-install-package.sh
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-05 19:10:39 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-05 19:10:39 -0500
commit8a2618d812e4e2f36161907af5af5c484eb37abf (patch)
treec164325cf57fb43e4375e94dc584fbc3ab3ceeb5 /build/windows/finalize-install-package.sh
parent42e878e77d58569be81e34ca206a78e0ebe0604d (diff)
parent5b5dd47c22a1332a4c432d6a1cd414b5c83388d7 (diff)
downloadSMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.tar.gz
SMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.tar.bz2
SMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.zip
Merge branch 'develop' into stable
Diffstat (limited to 'build/windows/finalize-install-package.sh')
-rwxr-xr-xbuild/windows/finalize-install-package.sh67
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!"