From 84a273cfaed391a8008396e595cc1fa347aa2a5c Mon Sep 17 00:00:00 2001 From: Nick Daly Date: Sat, 6 Jun 2009 22:19:17 -0500 Subject: Installer doesn't crash when installing BG2-SOA. Still not sure how if it works though. --- auto-installer.sh | 83 ++++++++++++++++++++------------------- bg2/install-soa-4cd-us-minimal.sh | 2 +- includes/cd-list.sh | 8 ++-- includes/generic-includes.sh | 13 +++--- 4 files changed, 56 insertions(+), 50 deletions(-) diff --git a/auto-installer.sh b/auto-installer.sh index beffa06..475fc09 100755 --- a/auto-installer.sh +++ b/auto-installer.sh @@ -44,52 +44,55 @@ get_game [ -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 - else - FULLINSTALL=0 - fi -fi +# 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 +# else +# FULLINSTALL=0 +# fi +# fi -if [ -n "$EXPANSIONSCRIPT" && "$FULLINSTALL" -eq 0 ]; then - if query "Do you want to install the files needed by the expansion $EXPANSIONNAME?" y; then - EXPANSIONINSTALL=1 - "${scriptdir}/${EXPANSIONSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly - else - EXPANSIONINSTALL=0 - fi -fi +# if [ "$FULLINSTALL" -eq 0 ]; then +# if [ -n "$EXPANSIONSCRIPT" ]; then +# if query "Do you want to install the files needed by the $EXPANSIONNAME expansion?" y; then +# EXPANSIONINSTALL=1 +# "${scriptdir}/${EXPANSIONSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" "1>/dev/null" # || diequietly +# else +# EXPANSIONINSTALL=0 +# fi +# fi +# fi +# if [ -n "$PATCHES" ]; then +# for patch in "$PATCHES"; do +# patch="$scriptdir/$patch" +# # grab 17th line from scripts (description line; after license) +# patchtitle=$(sed -n 17p "$patch"|cut -d ' ' -f 2-) +# if query "Do you want to install $patchtitle" y; then +# "$patch" \ +# -i "$TARGETDIR" \ +# -p "$PATCHDIR" \ +# -l "$LANGUAGE" \ +# -c "$CDMOUNT" \ +# 1>/dev/null +# fi +# done +# fi -if [ -n "$PATCHES" ]; then - for patch in "$PATCHES"; do - patch="$scriptdir/$patch" - # grab 17th line from scripts (description line; after license) - patchtitle=$(sed -n 17p "$patch"|cut -d ' ' -f 2-) - if query "Do you want to install $patchtitle" y; then - "$patch" \ - -i "$TARGETDIR" \ - -p "$PATCHDIR" \ - -l "$LANGUAGE" \ - -c "$CDMOUNT" \ - 1>/dev/null - fi - done -fi - -if [ -n "$WINDOWSFILES" ]; then - if query "Do you want to remove unneeded windows files?" n; then - for badfile in "$WINDOWSFILES"; do - rm -rf "${TARGETDIR}/${badfile}" - done - fi -fi +# if [ -n "$WINDOWSFILES" ]; then +# if query "Do you want to remove unneeded windows files?" n; then +# for badfile in "$WINDOWSFILES"; do +# rm -rf "${TARGETDIR}/${badfile}" +# done +# fi +# fi echo echo "$FULLGAMENAME installed successfully" +export +echo "cdno" $CDNO recommendcfg $CDNO diff --git a/bg2/install-soa-4cd-us-minimal.sh b/bg2/install-soa-4cd-us-minimal.sh index 21a2361..b4796b2 100755 --- a/bg2/install-soa-4cd-us-minimal.sh +++ b/bg2/install-soa-4cd-us-minimal.sh @@ -41,7 +41,7 @@ for i in "${TARGETDIR}/hd0_"* ; do j=`echo $i | sed 's#hd0_##g' - ` ; mv "$i" "$ 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}/register" "${TARGETDIR}/ereg" move_and_remove "${TARGETDIR}/sound" "${TARGETDIR}/sounds" for directory in "compiled" "decompiled" "errors"; do mkdir -p "${TARGETDIR}/script compiler/${directory}" || die; done diff --git a/includes/cd-list.sh b/includes/cd-list.sh index ce1d8e5..83584bd 100644 --- a/includes/cd-list.sh +++ b/includes/cd-list.sh @@ -52,9 +52,11 @@ function get_game MINSCRIPT="bg2/install-soa-4cd-us-minimal.sh" EXTRASCRIPT="bg2/install-soa-4cd-us-extra.sh" EXPANSIONSCRIPT="bg2/install-soa-4cd-us-tobMinimal.sh" + EXPANSIONNAME="Throne of Bhaal" 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" + CDNO=4 ;; $BG2_TOB_1CD_US_MD5 ) FULLGAMENAME="Baldurs Gate 2 - Throne of Bhaal: 1CD US version" @@ -102,13 +104,13 @@ function get_game CDNO=2 ;; * ) - echo "Unrecognised CD - please select game from menu" + echo "Unrecognised CD - please select game from menu or change the disc in ${CDMOUNT}" choosegame ;; esac done - export FULLGAMENAME SHORTGAMENAME MINSCRIPT EXTRASCRIPT EXPANSIONSCRIPT PATCHES WINDOWSFILES CDNO + export FULLGAMENAME SHORTGAMENAME MINSCRIPT EXTRASCRIPT EXPANSIONSCRIPT EXPANSIONNAME PATCHES WINDOWSFILES CDNO } function choosegame @@ -126,9 +128,7 @@ function choosegame echo "7 | Planescape: Torment (4CD version)" echo "8 | Icewind Dale (2CD UK version)" echo "9 | Icewind Dale 2 (2CD International version)" - echo echo "Z | My game isn't listed." - echo echo "Q | Quit" read -n 1 choice diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index 1ed5472..3e3ef36 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -143,7 +143,7 @@ function copylower # usage: copylower source destination if [ -d "$1" ]; then for filename in $(find "$1" -type f); do - lowerpath="$(echo $filename|gawk -F "$1" '{print $2}'|tr A-Z a-z)" + lowerpath="$(echo $filename|gawk -F '$1' '{print $2}'|tr A-Z a-z)" cp -f "$filename" "$2/$lowerpath" || die done elif [ -f "$1" ]; then @@ -158,7 +158,7 @@ function setlower if [ "$1" ] then cd "$1" - for each_file in "`find ./ -iname "*"`" + for each_file in `find ./ -iname "*"` do lower="`echo "$each_file" | tr "[:upper:]" "[:lower:]"`" @@ -174,9 +174,12 @@ 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" + if [ "$1" != "$2" ] + then + mkdir -p "$2" || die + cp -R "$1/"* "$2" || die + rm -r "$1" + fi } function teardown -- cgit v1.2.3