5 # Run this script to create a portable win32 package.
10 echo "Create a portable win32 package or installer."
11 echo "Usage: $0 [-h] [-i makensis] [-s strip] -d assets -V version -p prefix"
13 echo " -d Specify the game assets to be included."
14 echo " -h Show this help an exit."
15 echo " -i To make an installer, specify the makensis program."
16 echo " -V Specify the version of the program to be packaged"
17 echo " -s To strip the binaries, specify the strip program."
18 echo " -p Specify the path to your toolchain installation."
21 while getopts ":V:hd:i:p:s:" opt
44 echo "Invalid option: -$OPTARG" >&2
51 if test "x$ASSETS" = x
|| test "x$VERSION" = x
|| test "x$PREFIX" = x
67 ARCHIVE
="$BUILD/$NAME"
68 INSTALLER_SCRIPT
="$ROOT/win32/yoink.nsi"
70 MAN2HTML
="$ROOT/doc/man2html.sh"
71 UNIX2DOS
="$ROOT/win32/unix2dos.sh"
73 DLLS
="libogg-0 libpng14-14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1"
76 if test ! -f "src/version.c"
78 echo "Run the script from the repository root directory."
84 "The temp directory $BUILD could not be created."
90 cp -f "$ROOT/src/yoink.exe" "$ARCHIVE" || die
"copying yoink.exe"
91 test "x$STRIP" != x
&& "$STRIP" "$ARCHIVE/yoink.exe"
95 cp -f "$PREFIX/bin/$dll.dll" "$ARCHIVE" || die
"copying $dll"
96 test "x$STRIP" != x
&& "$STRIP" "$ARCHIVE/$dll.dll"
101 cp -f --parents "data/$asset" "$ARCHIVE"
104 for doc
in AUTHORS ChangeLog COPYING README TODO
106 "$UNIX2DOS" "$doc" "$ARCHIVE/$doc.txt" || die
"unix2dos $doc"
109 "$MAN2HTML" -f -o "$ARCHIVE/Manual.html"
110 "$UNIX2DOS" "$ARCHIVE/Manual.html"
112 cp -rf "$ROOT/doc/licenses" "$ARCHIVE" || die
"copying doc/licenses"
113 cd "$ARCHIVE/licenses"
116 (mv "$license" "$license.txt" && "$UNIX2DOS" "$license.txt") \
117 || die
"moving and unix2dos $license"
122 if test "x$MAKENSIS" = x
124 # build the portable archive
126 zip -r $NAME.
zip $NAME || die
"zipping portable archive"
128 mv "$BUILD/$NAME.zip" .
129 echo "Done! Package saved to $NAME.zip."
133 "$MAKENSIS" "$INSTALLER_SCRIPT" \
134 -DINSTALLFILES="$NAME" -DVERSION="$VERSION" \
135 || die
"running '$MAKENSIS'"
137 mv "$BUILD/$NAME.exe" .
138 echo "Done! Installer saved to $NAME.exe."