Deeper automation of the Win32 installer

This commit is contained in:
Michael Martin
2020-06-18 21:34:24 -07:00
parent 17c64af0d3
commit 36050dc2fa
3 changed files with 84 additions and 35 deletions
+13
View File
@@ -0,0 +1,13 @@
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library
designed to make it easy to write multi-media software, such as games and
emulators.
The Simple DirectMedia Layer library source code is available from:
http://www.libsdl.org/
This library is distributed under the terms of the GNU LGPL license:
http://www.gnu.org/copyleft/lesser.html
@@ -0,0 +1,70 @@
#!/usr/bin/sh
for i in uqm-installer.nsi packages.nsh orzshofixti.bmp ultron.bmp \
uqm-3do.cfg uqm-pc.cfg; do
if ! [ -f $i ]; then
echo "$i not found. Make sure you are running from sc2/build/win32_install."
exit 1
fi
done
if ! [ -f packages.nsh ]; then
echo "packages.nsh not found. Follow the instructions in INSTALL.pkgs"
echo "to regenerate it."
exit 1
fi
if ! [ -f ../../uqm.exe ]; then
echo "uqm.exe not found. Go build it first."
exit 1
fi
build_keyjam()
{
make clean && \
make && \
strip keyjam.exe && \
cp keyjam.exe ../../sc2/build/win32_install
return $?
}
echo "Building the key-jammer application..."
cd ../../../tools/keys || exit 1
build_keyjam
result=$?
cd ../../sc2/build/win32_install
if [ $result -ne 0 ] ; then
echo "Could not build keyjam.exe. Aborting installer creation."
exit 1
fi
cp ../../uqm.exe . || exit
strip ./uqm.exe || exit
echo "Identifying DLL dependencies..."
DLLS=$(ntldd -R uqm.exe | awk '/\\bin\\/{print $3;}')
DLLS2=$(ntldd -R keyjam.exe | awk '/\\bin\\/{print $3;}')
DLLS="$DLLS $DLLS2"
DLLS=$(for dll in $DLLS; do echo $dll; done | sort -u)
(echo "# Autogenerated by build-win32-installer.sh";
echo "#"
echo " File \"uqm.exe\""
echo " File \"keyjam.exe\""
for dll in $DLLS; do
echo " File \"$dll\""
done) >> dlls.nsi
(echo "# Autogenerated by build-win32-installer.sh";
echo "#"
echo " Delete \"\$INSTDIR\\uqm.exe\""
echo " Delete \"\$INSTDIR\\keyjam.exe\""
for dll in $DLLS; do
echo " Delete \"\$INSTDIR\\$(basename $dll)\""
done) >> undlls.nsi
echo "Preparing documentation..."
for i in AUTHORS COPYING README README-SDL WhatsNew; do
cp "../../$i" "$i.txt" && unix2dos "$i.txt"
done
cp ../../doc/users/manual.txt Manual.txt && unix2dos "Manual.txt"
echo "Creating installer..."
makensis "-XSetCompressor /SOLID lzma" uqm-installer.nsi || exit 1
echo "Installer has been created successfully."
+1 -35
View File
@@ -9,14 +9,8 @@
#
# The awk, md5sum, and wc utilities must be installed, but MSYS2
# should generally already have those in your path.
#
# The ntldd utility must also be installed and generally will NOT be
# installed by default. "pacboy sync ntldd" in a MinGW environment should
# install the correct version.
NSH_FILE="packages.nsh"
INST_FILE="dlls.nsi"
UNINST_FILE="un$INST_FILE"
PKG_VERSION="0.8.0"
CONTENT_PKG="uqm-$PKG_VERSION-content.uqm"
@@ -26,8 +20,6 @@ REMIX1_PKG="uqm-remix-disc1.uqm"
REMIX2_PKG="uqm-remix-disc2.uqm"
REMIX3_PKG="uqm-remix-disc3.uqm"
REMIX4_PKG="uqm-remix-disc4.uqm"
UQM_EXE="uqm.exe"
KEYJAM_EXE="keyjam.exe"
check_pkg() {
if [ ! -f "$1" ]; then
@@ -67,30 +59,4 @@ process_pkg $REMIX2_PKG PKG_REMIX2
process_pkg $REMIX3_PKG PKG_REMIX3
process_pkg $REMIX4_PKG PKG_REMIX4
echo All packages processed. ${NSH_FILE} generated.
echo "# Autogenerated by procpkgs.sh" > $INST_FILE
echo "#" >> $INST_FILE
echo "# Autogenerated by procpkgs.sh" > $UNINST_FILE
echo "#" >> $UNINST_FILE
echo " File \"$UQM_EXE\"" >> $INST_FILE
echo " File \"$KEYJAM_EXE\"" >> $INST_FILE
echo " Delete \"\$INSTDIR\\$UQM_EXE\"" >> $UNINST_FILE
echo " Delete \"\$INSTDIR\\$KEYJAM_EXE\"" >> $UNINST_FILE
echo "Processing $UQM_EXE..."
DLLS=$(ntldd -R "$UQM_EXE" | awk '/\\bin\\/{print $3;}')
echo "Processing $KEYJAM_EXE..."
DLLS2=$(ntldd -R "$KEYJAM_EXE" | awk '/\\bin\\/{print $3;}')
DLLS="$DLLS $DLLS2"
rm -f "$INST_FILE.tmp" "$UNINST_FILE.tmp"
touch "$INST_FILE.tmp" "$UNINST_FILE.tmp"
for dll in $DLLS; do
echo " File \"$dll\"" >> $INST_FILE.tmp
echo " Delete \"\$INSTDIR\\$(basename $dll)\"" >> $UNINST_FILE.tmp
done
sort -u < "$INST_FILE.tmp" >> $INST_FILE
sort -u < "$UNINST_FILE.tmp" >> $UNINST_FILE
rm -f "$INST_FILE.tmp" "$UNINST_FILE.tmp"
echo "Executable processed. $INST_FILE and $UNINST_FILE generated."
echo "All packages processed. ${NSH_FILE} generated."