]> Dogcows Code - chaz/yoink/blobdiff - win32/makepackage.sh
new convenient script methods
[chaz/yoink] / win32 / makepackage.sh
index 6cb1afa66c6b8eaeddc58a804b13c831a2411d1f..0cb48857b6e0e3964319ea335dcf96cb5ba580e8 100755 (executable)
@@ -2,7 +2,7 @@
 
 #
 # Yoink
-# Run this script to create a portable win32 package.
+# Run this script to create a win32 package.
 #
 
 function showhelp()
@@ -62,15 +62,14 @@ function die()
 }
 
 ROOT="$PWD"
-BUILD="$PWD/tmp-$$"
-NAME="yoink-$VERSION"
-ARCHIVE="$BUILD/$NAME"
-INSTALLER_SCRIPT="$ROOT/win32/yoink.nsi"
+BUILD="$ROOT/tmp-$$"
+DIRECTORY="yoink-$VERSION"
+ARCHIVE="$BUILD/$DIRECTORY"
 
 MAN2HTML="$ROOT/doc/man2html.sh"
 UNIX2DOS="$ROOT/win32/unix2dos.sh"
 
-DLLS="libogg-0 libpng14-14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1"
+DLLS="libogg-0 libpng14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1"
 
 
 if test ! -f "src/version.c"
@@ -121,21 +120,26 @@ cd "$ROOT"
 
 if test "x$MAKENSIS" = x
 then
-# build the portable archive
+# build portable archive
+       echo "No valid makensis executable passed;"
+       echo "making portable package instead..."
+       NAME="$DIRECTORY.zip"
        cd "$BUILD"
-       zip -r $NAME.zip $NAME || die "zipping portable archive"
+       zip -r "$NAME" "$DIRECTORY" || die "zipping portable archive"
        cd "$ROOT"
-       mv "$BUILD/$NAME.zip" .
-       echo "Done! Package saved to $NAME.zip."
+       mv "$BUILD/$NAME" .
+       echo "Done! Package saved to $NAME."
 else
 # build an installer
-       cd "$BULID"
-       "$MAKENSIS" "$INSTALLER_SCRIPT" \
-               -DINSTALLFILES="$NAME" -DVERSION="$VERSION" \
+       NAME="yoinksetup-$VERSION.exe"
+       cd "$BUILD"
+       cp "$ROOT/win32/yoink.nsi" .
+       "$MAKENSIS" -DROOTPATH="$ROOT" -DINSTALLFILES="$ARCHIVE" \
+               -DVERSION="$VERSION" -DOUTFILE="$NAME" yoink.nsi \
                || die "running '$MAKENSIS'"
        cd "$ROOT"
-       mv "$BUILD/$NAME.exe" .
-       echo "Done! Installer saved to $NAME.exe."
+       mv "$BUILD/$NAME" .
+       echo "Done! Installer saved to $NAME."
 fi
 
 
This page took 0.021489 seconds and 4 git commands to generate.