summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick <myownlittlworld@hotmail.com>2009-05-25 18:14:01 -0500
committernick <myownlittlworld@hotmail.com>2009-05-25 18:14:01 -0500
commit6ec9844921a2a465e02c26e0a09344aaff70fe93 (patch)
tree48da0a09acf14eb8ba96675030ca61fc951b4261
parentbbacc8174082cfda8e8a4096105c82de308e172e (diff)
downloadgemrb-gameinstallers-6ec9844921a2a465e02c26e0a09344aaff70fe93.tar.bz2
gemrb-gameinstallers-6ec9844921a2a465e02c26e0a09344aaff70fe93.zip
Created the BG2 4CD US Minimal Installer.
-rw-r--r--.gitignore2
-rwxr-xr-xauto-installer.sh37
-rwxr-xr-xbg2/install-4cd-minimal-us.sh50
-rw-r--r--includes/cd-includes.sh8
-rw-r--r--includes/generic-includes.sh25
5 files changed, 101 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7475063
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.pidaproject
+*~
diff --git a/auto-installer.sh b/auto-installer.sh
index 4c1fe99..1101e7a 100755
--- a/auto-installer.sh
+++ b/auto-installer.sh
@@ -39,28 +39,46 @@ while [ -z "$MINSCRIPT" ]; do
$BG1_5CD_INTL_MD5 )
FULLGAMENAME="Baldurs Gate 1: 5CD International version"
SHORTGAMENAME="baldursgate1"
- MINSCRIPT=bg1/install-5cd-minimal.sh
- EXTRASCRIPT=bg1/install-5cd-extra.sh
+ MINSCRIPT="bg1/install-5cd-minimal.sh"
+ EXTRASCRIPT="bg1/install-5cd-extra.sh"
PATCHES="bg1/install-patch-intl.sh bg1/install-patch-baldurdash-fix.sh bg1/install-patch-baldurdash-text.sh"
WINDOWSFILES="baldur.exe bgmain.exe config.exe keymap.ini luaauto.cfg update.url"
CDNO=5
;;
$BG1_TOTSC_3CD_US_MD5 )
- FULLGAMENAME="Baldurs Gate & Tales of the Sword Coast: 3CD US version"
+ FULLGAMENAME="Baldurs Gate 1 & Tales of the Sword Coast: 3CD US version"
SHORTGAMENAME="baldursgate1totsc"
- MINSCRIPT=bg1/install-3cd-minimal.sh
- EXTRASCRIPT=bg1/install-3cd-extra.sh
+ MINSCRIPT="bg1/install-3cd-minimal.sh"
+ EXTRASCRIPT="bg1/install-3cd-extra.sh"
PATCHES="bg1/install-patch-baldurdash-fix.sh bg1/install-patch-totsc-baldurdash-text.sh"
WINDOWSFILES="baldur.exe bgmain.exe config.exe keymap.ini luaauto.cfg update.url"
CDNO=3
;;
$BG1_TOTSC_1CD_UK_MD5 )
- FULLGAMENAME="Baldurs Gate Tales of the Sword Coast: 1CD UK version"
+ FULLGAMENAME="Baldurs Gate 1 & Tales of the Sword Coast: 1CD UK version"
SHORTGAMENAME="baldursgate1totsc"
- MINSCRIPT=bg1/install-1cd-totsc-uk.sh
+ MINSCRIPT="bg1/install-1cd-totsc-uk.sh"
PATCHES="bg1/install-patch-totsc-uk.sh bg1/install-patch-baldurdash-fix.sh bg1/install-patch-totsc-baldurdash-text.sh"
WINDOWSFILES="bgmain2.exe baldur.exe config.exe mconvert.exe"
;;
+ $BG2_4CD_US_MD5 )
+ FULLGAMENAME="Baldurs Gate 2 - Shadows of Amn: 4CD US version"
+ SHORTGAMENAME="baldursgate2soa"
+ MINSCRIPT="bg2/install-4cd-minimal-us.sh"
+ # TODO: uncomment when complete EXTRASCRIPT="bg2/install-4cd-extra-us.sh"
+ PATCHES="" # TODO: fill in patches
+ # bg2/install-patch-soa-us.sh bg2/install-patch-baldurdash-fix.sh bg2/install-patch-soa-baldurdash-text.sh"
+ WINDOWSFILES="bgdxtest.exe bggltest.exe glsetup.exe bgconfig.exe bgmain.exe charview.exe"
+ ;;
+ # $BG2_TOB_1CD_US_MD5 )
+ # FULLGAMENAME="Baldurs Gate 2 - Throne of Bhaal: 1CD US version"
+ # SHORTGAMENAME="baldursgate2tob"
+ # MINSCRIPT="bg2/install-1cd-tob-us.sh"
+ # PATCHES="" # TODO: fill in patches
+ # # bg2/install-patch-totsc-uk.sh bg1/install-patch-baldurdash-fix.sh bg1/install-patch-totsc-baldurdash-text.sh"
+ # # TODO: correct the list of windows files.
+ # WINDOWSFILES="" # "bgmain2.exe baldur.exe config.exe mconvert.exe"
+ # ;;
$PST_2CD_MD5 )
FULLGAMENAME="Planescape Torment: 2CD version"
SHORTGAMENAME="planescapetorment"
@@ -93,13 +111,12 @@ done
[ -d "$TARGETDIR" ] && export alwaysdiesafely=1
echo "$FULLGAMENAME detected, installing"
-
-"$scriptdir/$MINSCRIPT" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly
+"${scriptdir}/${MINSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly
if [ -n "$EXTRASCRIPT" ]; then
if query "Do you want to do a full install, so the CDs will not be needed again?" y; then
FULLINSTALL=1
- "$scriptdir/$EXTRASCRIPT" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly
+ "${scriptdir}/${EXTRASCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly
else
FULLINSTALL=0
fi
diff --git a/bg2/install-4cd-minimal-us.sh b/bg2/install-4cd-minimal-us.sh
new file mode 100755
index 0000000..3f61614
--- /dev/null
+++ b/bg2/install-4cd-minimal-us.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# Baldur's Gate 2 (4CD US version) Minimal Install
+# Copyright (C) 2009 Nick Daly
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+scriptdir="$(dirname $0)"/..
+source "$scriptdir/includes/generic-includes.sh"
+source "$scriptdir/includes/cd-includes.sh"
+
+parseargs "$@"
+
+checkforbin unshield
+
+getcd 1 $BG2_4CD_US_MD5 data1.cab
+
+mkdir -p "$TARGETDIR" || die
+mkdir -p "${TARGETDIR}/portraits" || die
+
+cp $CDMOUNT/baldur.ico "$TARGETDIR" || die
+
+# FIXME: strip hd0_ from all folder names
+unshield -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
+
+rm -r "${TARGETDIR}/_"* # remove all the the fake directories.
+
+for i in "${TARGETDIR}/hd0_"* ; do j=`echo $i | sed 's#hd0_##g' - ` ; mv "$i" "$j" ; done
+
+move_and_remove "${TARGETDIR}/cab" "${TARGETDIR}"
+move_and_remove "${TARGETDIR}/compiler" "${TARGETDIR}/script compiler"
+move_and_remove "${TARGETDIR}/register" "${TARGETDIR}/eReg"
+move_and_remove "${TARGETDIR}/sound" "${TARGETDIR}/sounds"
+
+rm -r "${TARGETDIR}/cache100" "${TARGETDIR}/cache/cache150" "${TARGETDIR}/mplayer" "${TARGETDIR}/Update.url"
+
+setperms "$TARGETDIR"
diff --git a/includes/cd-includes.sh b/includes/cd-includes.sh
index e7c2526..dfb0e68 100644
--- a/includes/cd-includes.sh
+++ b/includes/cd-includes.sh
@@ -17,19 +17,21 @@
[ -z "$CDMOUNT" ] && export CDMOUNT="/media/cdrom"
+# the MD5sum of the data1.cab of the first CD in each set.
export BG1_5CD_INTL_MD5="138528155dfeb695bd63f90eacee7dc0"
export BG1_TOTSC_3CD_US_MD5="1a6828b97a27967e8c4acc25e1ef48d2"
export BG1_TOTSC_1CD_UK_MD5="e27d259ddc0171ff945dbba136e60309"
export BG2_4CD_US_MD5="8acf4a6348de916bfaf077469a427b65"
+export BG2_TOB_1CD_US_MD5="b1f247a952c13cb8e0b6efc108aaeeaa"
export PST_2CD_MD5="640b61443cc86c434f1b6826e63c0e33"
export PST_4CD_MD5="5e8c2075163aca124de4a467fb33063d"
-export IWD_2CD_US_MD5=""
-export IWD_HOW_1CD_US_MD5=""
+export IWD_2CD_US_MD5="b79582f4f80270d48e6b26f529ba31dd"
+export IWD_HOW_1CD_US_MD5="d2c42de47026f6384053965319ff511b"
-export IWD2_2CD_US_MD5=""
+export IWD2_2CD_US_MD5="77307366ba3e8a246f6f238cbb3b7874"
# a record of every IE collection I can find.
export IWD_ULTIMATE_COLLECTION_MD5=""
diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh
index 51cffcb..1e0e89d 100644
--- a/includes/generic-includes.sh
+++ b/includes/generic-includes.sh
@@ -56,13 +56,13 @@ function diequietly
function setuptmp
{
- rm -rf $TMPDIR
- mkdir -p $TMPDIR || die
+ rm -rf "$TMPDIR"
+ mkdir -p "$TMPDIR" || die
}
function cleanuptmp
{
- rm -rf $TMPDIR
+ rm -rf "$TMPDIR"
}
function checkforbin
@@ -71,7 +71,7 @@ function checkforbin
retstatus=0
while [ "$1" != "" ]; do
- binname=$1
+ binname="$1"
which "$binname" &> /dev/null
if [ $? -ne 0 ]; then
@@ -110,13 +110,13 @@ function usage
{
echo "Usage:" $0 "[-i installdir] [-p patchdir] [-c cdmount] [-l language]"
echo -e " -i installdir is the directory to install to."
- echo -e " default:" $TARGETDIR
+ echo -e " default: ${TARGETDIR} (changes per game)"
echo -e " -c cdmount is the mount location of the cd drive used."
- echo -e " default:" $CDMOUNT
+ echo -e " default: ${CDMOUNT}"
echo -e " -p patchdir is an optional directory containing patch files."
- echo -e " default:" $PATCHDIR
+ echo -e " default: ${PATCHDIR}"
echo -e " -l language can be one of English, Spanish, French, German, Italian or Language Independant"
- echo -e " default:" $LANGUAGE
+ echo -e " default: ${LANGUAGE}"
# TODO: Add option to show and select all known BG1 versions
}
@@ -150,3 +150,12 @@ function copylower
cp -f "$(echo $1|tr A-Z a-z)" "$2"
fi
}
+
+function move_and_remove
+{
+ # usage: move_and_remove source destination
+ # copies the files in the source directory to the destination.
+ mkdir -p "$2" || die
+ cp -R "$1/"* "$2" || die
+ rm -r "$1"
+}