about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xdistribute.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/distribute.sh b/distribute.sh
index c67faa9..8e41751 100755
--- a/distribute.sh
+++ b/distribute.sh
@@ -36,9 +36,16 @@ cd "$CONFIG_INSTALL_PREFIX"
 # Tarball the finish result!
 if [ "$WINDOWS" = "true" ];
 then
-	zip -r Pong_"$(uname)-$(uname -r)-$(uname -m)".zip -- *
+	if [ -f "/c/Program Files/7-Zip/7z.exe" ];
+	then # Try to use 7z's self extracting feature if possible.
+		ARCHIVE_NAME="Pong_$(uname -s)-$(uname -r)"
+		SEVENZIP="/c/Program Files/7-Zip/7z.exe"
+		"$SEVENZIP" a -sfx7z.sfx "$ARCHIVE_NAME".exe -- *
+	else # If not, just create a standard zip file.
+		zip -9 -r "$ARCHIVE_NAME".zip -- *
+	fi
 	exit 0
 else
 	rm libs/libGL* # Remove OpenGL as it conflicts with graphics drivers.
-	bsdtar -caf ../Pong_"$(uname -s)-$(uname -r)-$(uname -m)".txz -- *
+	bsdtar --options xz:compression-force=9 -caf ../Pong_"$(uname -s)-$(uname -r)-$(uname -m)".txz -- *
 fi