summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick <myownlittlworld@hotmail.com>2009-05-25 18:26:27 -0500
committernick <myownlittlworld@hotmail.com>2009-05-25 18:26:27 -0500
commit0d14bb784aa524de00c88e9a25bb812c5339cc43 (patch)
tree4e4d23f1a015fe0d6c6a02626f20fb7b9555de28
parent6ec9844921a2a465e02c26e0a09344aaff70fe93 (diff)
downloadgemrb-gameinstallers-0d14bb784aa524de00c88e9a25bb812c5339cc43.tar.bz2
gemrb-gameinstallers-0d14bb784aa524de00c88e9a25bb812c5339cc43.zip
Safely escaped all potentially unsafe variables.
And probably a couple already safe ones too.
-rwxr-xr-xbg1/install-1cd-totsc-uk.sh25
-rwxr-xr-xbg1/install-3cd-extra.sh20
-rwxr-xr-xbg1/install-3cd-minimal.sh33
-rwxr-xr-xbg1/install-5cd-extra.sh10
-rwxr-xr-xbg1/install-5cd-minimal.sh27
-rwxr-xr-xbg1/install-patch-baldurdash-fix.sh10
-rwxr-xr-xbg1/install-patch-baldurdash-text.sh8
-rwxr-xr-xbg1/install-patch-intl.sh10
-rwxr-xr-xbg1/install-patch-totsc-balderdash-text.sh8
-rwxr-xr-xbg1/install-patch-totsc-intl.sh10
-rwxr-xr-xbg1/install-patch-totsc-uk.sh10
-rwxr-xr-xbg1/install-patch-totsc-us.sh10
-rwxr-xr-xbg1/install-patch-us.sh10
-rwxr-xr-xbg2/install-4cd-minimal-us.sh8
-rwxr-xr-xpst/install-2cd-extra.sh18
-rwxr-xr-xpst/install-2cd-minimal.sh20
-rwxr-xr-xpst/install-4cd-extra.sh10
-rwxr-xr-xpst/install-4cd-minimal.sh14
-rwxr-xr-xpst/install-patch-official.sh10
19 files changed, 128 insertions, 143 deletions
diff --git a/bg1/install-1cd-totsc-uk.sh b/bg1/install-1cd-totsc-uk.sh
index 9f2f582..3584c07 100755
--- a/bg1/install-1cd-totsc-uk.sh
+++ b/bg1/install-1cd-totsc-uk.sh
@@ -17,8 +17,8 @@
# Tales of the Sword Coast (1CD UK version)
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -28,24 +28,21 @@ getcd 1 $BG1_TOTSC_1CD_UK_MD5 data1.cab
mkdir -p "$TARGETDIR" || die
-unshield -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
+unshield -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
-cp $CDMOUNT/dialog.tlk "$TARGETDIR" || die
+cp "${CDMOUNT}/dialog.tlk" "$TARGETDIR" || die
-mkdir -p "$TARGETDIR"/save || die
+mkdir -p "${TARGETDIR/save}" || die
-cp -R "$TARGETDIR"/minimumdata/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/minimumdata
+move_and_remove "${TARGETDIR}/minimumdata" "$TARGETDIR"
+move_and_remove "${TARGETDIR}/english" "$TARGETDIR"
-cp -R "$TARGETDIR"/english/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/english
+cp -R "${CDMOUNT}/override/"* "${TARGETDIR}/override/" || die
-cp -R "$CDMOUNT"/override/* "$TARGETDIR"/override/ || die
-
-mkdir -p "$TARGETDIR"/movies
+mkdir -p "${TARGETDIR}/movies"
copylower "$CDMOUNT/cd6/" "$TARGETDIR"
-mkdir -p "$TARGETDIR"/mpsave
-cp -R $CDMOUNT/[Ss]ave/* "$TARGETDIR"/mpsave || die
+mkdir -p "${TARGETDIR}/mpsave"
+cp -R "${CDMOUNT}/"[Ss]ave/* "${TARGETDIR}/mpsave" || die
setperms "$TARGETDIR"
diff --git a/bg1/install-3cd-extra.sh b/bg1/install-3cd-extra.sh
index fe31c32..7af0cbb 100755
--- a/bg1/install-3cd-extra.sh
+++ b/bg1/install-3cd-extra.sh
@@ -17,23 +17,23 @@
# Extra Baldur's Gate (3CD version) content (so CDs aren't needed)
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
-copylower "$CDMOUNT/cd1/" "$TARGETDIR"
+copylower "${CDMOUNT}/cd1/" "$TARGETDIR"
CD2_MD5="c04758a6af171bf9a35d8e3d4dcd807c"
CD3_MD5="ba4224f50f890e10561d22f602d6a991"
getcd 2 $CD2_MD5 CD2/Movies/MovieCD2.bif
-copylower "$CDMOUNT/cd2/" "$TARGETDIR"
-copylower "$CDMOUNT/cd5/" "$TARGETDIR"
-cp $CDMOUNT/Manual/Baldur.pdf "$TARGETDIR"/manual || die
+copylower "${CDMOUNT}/cd2/" "$TARGETDIR"
+copylower "${CDMOUNT}/cd5/" "$TARGETDIR"
+cp "${CDMOUNT}/Manual/Baldur.pdf" "${TARGETDIR}/manual" || die
-getcd 3 $CD3_MD5 CD3/Movies/MovieCD3.bif
-copylower "$CDMOUNT/cd3/" "$TARGETDIR"
-copylower "$CDMOUNT/cd4/" "$TARGETDIR"
-copylower "$CDMOUNT/cd6/" "$TARGETDIR"
+getcd 3 "$CD3_MD5" "CD3/Movies/MovieCD3.bif"
+copylower "${CDMOUNT}/cd3/" "$TARGETDIR"
+copylower "${CDMOUNT}/cd4/" "$TARGETDIR"
+copylower "${CDMOUNT}/cd6/" "$TARGETDIR"
setperms "$TARGETDIR"
diff --git a/bg1/install-3cd-minimal.sh b/bg1/install-3cd-minimal.sh
index 57d9173..f6446cf 100755
--- a/bg1/install-3cd-minimal.sh
+++ b/bg1/install-3cd-minimal.sh
@@ -17,8 +17,8 @@
# Baldur's Gate & Tales of the Sword Coast (3CD version) minimal
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -28,28 +28,23 @@ getcd 1 $BG1_TOTSC_3CD_US_MD5 data1.cab
mkdir -p "$TARGETDIR" || die
-cp $CDMOUNT/dialog.tlk "$TARGETDIR" || die
+cp "${CDMOUNT}/dialog.tlk" "$TARGETDIR" || die
-unshield -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
+unshield -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
-cp -R "$TARGETDIR"/minimumdata/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/minimumdata
+move_and_remove "${TARGETDIR}/minimumdata" "${TARGETDIR}"
+move_and_remove "${TARGETDIR}/english_sounds/sounds" "${TARGETDIR}/sounds"
+move_and_remove "${TARGETDIR}/english" "${TARGETDIR}"
-cp -R "$TARGETDIR"/english_sounds/sounds/* "$TARGETDIR"/sounds/ || die
-rm -r "$TARGETDIR"/english_sounds
+mkdir -p "${TARGETDIR}/movies"
+mkdir -p "${TARGETDIR}/manual"
-cp -R "$TARGETDIR"/english/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/english
+mkdir -p "${TARGETDIR}/save"
+cp -R "${CDMOUNT}/"[Ss]ave/* "${TARGETDIR}/save" || die
-mkdir -p "$TARGETDIR"/movies
-mkdir -p "$TARGETDIR"/manual
+cp "${CDMOUNT}/Manual/BGManual.pdf" "${TARGETDIR}/manual/" || die
+cp "${CDMOUNT}/Manual/TotscManual.pdf" "${TARGETDIR}/manual/" || die
-mkdir -p "$TARGETDIR"/save
-cp -R $CDMOUNT/[Ss]ave/* "$TARGETDIR"/save || die
-
-cp $CDMOUNT/Manual/BGManual.pdf "$TARGETDIR"/manual/ || die
-cp $CDMOUNT/Manual/TotscManual.pdf "$TARGETDIR"/manual/ || die
-
-cp $CDMOUNT/baldur.ico "$TARGETDIR" || die
+cp "${CDMOUNT}/baldur.ico" "$TARGETDIR" || die
setperms "$TARGETDIR"
diff --git a/bg1/install-5cd-extra.sh b/bg1/install-5cd-extra.sh
index 9e6847d..df5dbef 100755
--- a/bg1/install-5cd-extra.sh
+++ b/bg1/install-5cd-extra.sh
@@ -17,8 +17,8 @@
# Extra Baldur's Gate (5CD International version) content (so CDs aren't needed)
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -31,10 +31,10 @@ for CDNUMBER in 1 2 3 4 5; do
5 ) moviesum="f19415703d3ccad01325b9338380ac7c" ;;
esac
- if [ $CDNUMBER -gt 1 ]; then
- getcd $CDNUMBER $moviesum CD$CDNUMBER/Movies/MovieCD$CDNUMBER.bif
+ if [ "$CDNUMBER" -gt 1 ]; then
+ getcd "$CDNUMBER" "$moviesum" "CD${CDNUMBER}/Movies/MovieCD${CDNUMBER}.bif"
fi
- copylower "$CDMOUNT/cd$CDNUMBER/" "$TARGETDIR"
+ copylower "${CDMOUNT}/cd${CDNUMBER}/" "$TARGETDIR"
setperms "$TARGETDIR"
done
diff --git a/bg1/install-5cd-minimal.sh b/bg1/install-5cd-minimal.sh
index 2e6ff59..cd5cfa7 100755
--- a/bg1/install-5cd-minimal.sh
+++ b/bg1/install-5cd-minimal.sh
@@ -17,8 +17,8 @@
# Baldur's Gate (5CD International version) minimal
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -28,24 +28,17 @@ getcd 1 $BG1_5CD_INTL_MD5 data1.cab
mkdir -p "$TARGETDIR" || die
-cp $CDMOUNT/dialog.tlk "$TARGETDIR" || die
+cp "${CDMOUNT}/dialog.tlk" "$TARGETDIR" || die
-unshield -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
+unshield -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
-cp -R "$TARGETDIR"/minimumdata/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/minimumdata
+move_and_remove "${TARGETDIR}/minimumdata" "$TARGETDIR"
+move_and_remove "${TARGETDIR}/recommended_music/music" "${TARGETDIR}/music/"
+move_and_remove "${TARGETDIR}/english_sounds/sounds" "${TARGETDIR}/sounds/"
+move_and_remove "${TARGETDIR}/english" "$TARGETDIR"
-cp -R "$TARGETDIR"/recommended_music/music/* "$TARGETDIR"/music/ || die
-rm -r "$TARGETDIR"/recommended_music
+mkdir -p "${TARGETDIR}/movies"
-cp -R "$TARGETDIR"/english_sounds/sounds/* "$TARGETDIR"/sounds/ || die
-rm -r "$TARGETDIR"/english_sounds
-
-cp -R "$TARGETDIR"/english/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/english
-
-mkdir -p "$TARGETDIR"/movies
-
-cp $CDMOUNT/baldur.ico "$TARGETDIR" || die
+cp "${CDMOUNT}/baldur.ico" "$TARGETDIR" || die
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-baldurdash-fix.sh b/bg1/install-patch-baldurdash-fix.sh
index be9b3be..a4c2122 100755
--- a/bg1/install-patch-baldurdash-fix.sh
+++ b/bg1/install-patch-baldurdash-fix.sh
@@ -17,8 +17,8 @@
# BG1/TOTSC Baldurdash fix pack
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -30,9 +30,9 @@ getpatch http://www.baldurdash.org/LargeDownloads/BG1FixPack11.exe
# unzip complains unnecessarily about skipping non-zip
# part so don't print errors or die on failure
-unzip -L $TMPDIR/BG1FixPack11.exe -d $TMPDIR 2>/dev/null
-rm $TMPDIR/BG1FixPack11.exe $TMPDIR/bg1fixpack11readme.txt
-cp $TMPDIR/* "$TARGETDIR/override/" || diesoftly
+unzip -L "${TMPDIR}/BG1FixPack11.exe" -d "$TMPDIR" 2>/dev/null
+rm "${TMPDIR}/BG1FixPack11.exe" "${TMPDIR}/bg1fixpack11readme.txt"
+cp "${TMPDIR}/"* "${TARGETDIR}/override/" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-baldurdash-text.sh b/bg1/install-patch-baldurdash-text.sh
index 9dbf9a9..7eeee3b 100755
--- a/bg1/install-patch-baldurdash-text.sh
+++ b/bg1/install-patch-baldurdash-text.sh
@@ -17,8 +17,8 @@
# BG1 Baldurdash text pack
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -35,8 +35,8 @@ getpatch http://www.baldurdash.org/LargeDownloads/BG1NoTOSCGameTextUpdate10.exe
# unzip complains unnecessarily about skipping non-zip
# part so don't print errors or die on failure
-unzip -L $TMPDIR/BG1NoTOSCGameTextUpdate10.exe -d $TMPDIR 2>/dev/null
-cp $TMPDIR/dialog.tlk "$TARGETDIR/" || diesoftly
+unzip -L "${TMPDIR}/BG1NoTOSCGameTextUpdate10.exe" -d "$TMPDIR" 2>/dev/null
+cp "${TMPDIR}/dialog.tlk" "${TARGETDIR}/" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-intl.sh b/bg1/install-patch-intl.sh
index 2acb59e..0e12853 100755
--- a/bg1/install-patch-intl.sh
+++ b/bg1/install-patch-intl.sh
@@ -17,8 +17,8 @@
# BG1 official international patch
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -28,11 +28,11 @@ setuptmp
getpatch http://downloads.bioware.com/baldursgate1/bgintl114315.exe
-unzip $TMPDIR/bgintl114315.exe -d $TMPDIR || diesoftly
-unshield -g "$LANGUAGE" -L x $TMPDIR/data1.cab -d $TMPDIR || diesoftly
+unzip "${TMPDIR}/bgintl114315.exe" -d "${TMPDIR}" || diesoftly
+unshield -g "$LANGUAGE" -L x "${TMPDIR}/data1.cab" -d "$TMPDIR" || diesoftly
LANGUAGE="$(echo $LANGUAGE|tr A-Z a-z|tr ' ' _)" # alter formatting
-cp -R $TMPDIR/"$LANGUAGE"/* "$TARGETDIR" || diesoftly
+cp -R "${TMPDIR}/${LANGUAGE}/"* "$TARGETDIR" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-totsc-balderdash-text.sh b/bg1/install-patch-totsc-balderdash-text.sh
index 36e4304..0d16147 100755
--- a/bg1/install-patch-totsc-balderdash-text.sh
+++ b/bg1/install-patch-totsc-balderdash-text.sh
@@ -17,8 +17,8 @@
# BG1 TOTSC Baldurdash text pack
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -35,8 +35,8 @@ getpatch http://www.baldurdash.org/LargeDownloads/BG1TOSCGameTextUpdate11.exe
# unzip complains unnecessarily about skipping non-zip
# part so don't print errors or die on failure
-unzip -L $TMPDIR/BG1TOSCGameTextUpdate11.exe -d $TMPDIR 2>/dev/null
-cp $TMPDIR/dialog.tlk "$TARGETDIR/" || diesoftly
+unzip -L "${TMPDIR}/BG1TOSCGameTextUpdate11.exe" -d "$TMPDIR" 2>/dev/null
+cp "${TMPDIR}/dialog.tlk" "${TARGETDIR}/" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-totsc-intl.sh b/bg1/install-patch-totsc-intl.sh
index 19c2b15..b50c0ac 100755
--- a/bg1/install-patch-totsc-intl.sh
+++ b/bg1/install-patch-totsc-intl.sh
@@ -17,8 +17,8 @@
# BG1 TOTSC official International patch
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -28,10 +28,10 @@ setuptmp
getpatch http://downloads.bioware.com/baldursgate1/BGTalesIntl5512.exe
-cabextract -L $TMPDIR/BGTalesIntl5512.exe -d $TMPDIR || diesoftly
-unshield -L x $TMPDIR/data1.cab -d $TMPDIR || diesoftly
+cabextract -L "${TMPDIR}/BGTalesIntl5512.exe" -d "$TMPDIR" || diesoftly
+unshield -L x "${TMPDIR}/data1.cab" -d "$TMPDIR" || diesoftly
-cp -R $TMPDIR/minimumdata/* "$TARGETDIR" || diesoftly
+cp -R "${TMPDIR}/minimumdata/"* "$TARGETDIR" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-totsc-uk.sh b/bg1/install-patch-totsc-uk.sh
index 09ea70c..87c93d7 100755
--- a/bg1/install-patch-totsc-uk.sh
+++ b/bg1/install-patch-totsc-uk.sh
@@ -17,8 +17,8 @@
# BG1 TOTSC official UK patch
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -28,10 +28,10 @@ setuptmp
getpatch http://downloads.bioware.com/baldursgate1/BGTalesUK5512.exe
-cabextract -L $TMPDIR/BGTalesUK5512.exe -d $TMPDIR || diesoftly
-unshield -L x $TMPDIR/data1.cab -d $TMPDIR || diesoftly
+cabextract -L "${TMPDIR}/BGTalesUK5512.exe" -d "$TMPDIR" || diesoftly
+unshield -L x "${TMPDIR}/data1.cab" -d "$TMPDIR" || diesoftly
-cp -R $TMPDIR/minimumdata/* "$TARGETDIR" || diesoftly
+cp -R "${TMPDIR}/minimumdata/"* "$TARGETDIR" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-totsc-us.sh b/bg1/install-patch-totsc-us.sh
index 5939ac4..90b4d9e 100755
--- a/bg1/install-patch-totsc-us.sh
+++ b/bg1/install-patch-totsc-us.sh
@@ -17,8 +17,8 @@
# BG1 TOTSC official US/Canada patch
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -28,10 +28,10 @@ setuptmp
getpatch http://downloads.bioware.com/baldursgate1/BGTalesUS5512.exe
-cabextract -L $TMPDIR/BGTalesUS5512.exe -d $TMPDIR || diesoftly
-unshield -L x $TMPDIR/data1.cab -d $TMPDIR || diesoftly
+cabextract -L "${TMPDIR}/BGTalesUS5512.exe" -d "$TMPDIR" || diesoftly
+unshield -L x "${TMPDIR}/data1.cab" -d "$TMPDIR" || diesoftly
-cp -R $TMPDIR/minimumdata/* "$TARGETDIR" || diesoftly
+cp -R "${TMPDIR}/minimumdata/"* "$TARGETDIR" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg1/install-patch-us.sh b/bg1/install-patch-us.sh
index c3fe4b0..30387c2 100755
--- a/bg1/install-patch-us.sh
+++ b/bg1/install-patch-us.sh
@@ -17,8 +17,8 @@
# BG1 official US/Canada patch
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -28,10 +28,10 @@ setuptmp
getpatch http://downloads.bioware.com/baldursgate1/bg114315.exe
-cabextract -L $TMPDIR/bg114315.exe -d $TMPDIR || diesoftly
-unshield -L x $TMPDIR/data1.cab -d $TMPDIR || diesoftly
+cabextract -L "${TMPDIR}/bg114315.exe" -d "$TMPDIR" || diesoftly
+unshield -L x "${TMPDIR}/data1.cab" -d "$TMPDIR" || diesoftly
-cp -R $TMPDIR/english/* "$TARGETDIR" || diesoftly
+cp -R "${TMPDIR}/english/"* "$TARGETDIR" || diesoftly
cleanuptmp
setperms "$TARGETDIR"
diff --git a/bg2/install-4cd-minimal-us.sh b/bg2/install-4cd-minimal-us.sh
index 3f61614..e4dc0cb 100755
--- a/bg2/install-4cd-minimal-us.sh
+++ b/bg2/install-4cd-minimal-us.sh
@@ -19,8 +19,8 @@
# 02110-1301 USA.
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -31,10 +31,10 @@ getcd 1 $BG2_4CD_US_MD5 data1.cab
mkdir -p "$TARGETDIR" || die
mkdir -p "${TARGETDIR}/portraits" || die
-cp $CDMOUNT/baldur.ico "$TARGETDIR" || die
+cp "${CDMOUNT}/baldur.ico" "$TARGETDIR" || die
# FIXME: strip hd0_ from all folder names
-unshield -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
+unshield -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
rm -r "${TARGETDIR}/_"* # remove all the the fake directories.
diff --git a/pst/install-2cd-extra.sh b/pst/install-2cd-extra.sh
index f37e173..82e9002 100755
--- a/pst/install-2cd-extra.sh
+++ b/pst/install-2cd-extra.sh
@@ -17,8 +17,8 @@
# Extra Planescape: Torment (2CD version) content (so CDs aren't needed)
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -26,16 +26,16 @@ checkforbin unshield
CD2="610d9f6354be741b09fc25b5e9645328"
-getcd 1 $PST_2CD_MD5 data1.cab
+getcd 1 "$PST_2CD_MD5" data1.cab
-unshield -g OtherData -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
-unshield -g OtherData -L x $CDMOUNT/data2.cab -d "$TARGETDIR" || die
+unshield -g OtherData -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
+unshield -g OtherData -L x "${CDMOUNT}/data2.cab" -d "$TARGETDIR" || die
-mv "$TARGETDIR"/otherdata/* "$TARGETDIR" || die
-rmdir "$TARGETDIR"/otherdata || die
+mv "${TARGETDIR}/otherdata/"* "$TARGETDIR" || die
+rmdir "${TARGETDIR}/otherdata" || die
-getcd 2 $CD2 cd2/movies4.bif
+getcd 2 "$CD2" "cd2/movies4.bif"
-copylower "$CDMOUNT/cd2/" "$TARGETDIR" || die
+copylower "${CDMOUNT}/cd2/" "$TARGETDIR" || die
setperms "$TARGETDIR"
diff --git a/pst/install-2cd-minimal.sh b/pst/install-2cd-minimal.sh
index 61ff812..7541216 100755
--- a/pst/install-2cd-minimal.sh
+++ b/pst/install-2cd-minimal.sh
@@ -17,8 +17,8 @@
# Planescape: Torment (2CD version) minimal
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -28,16 +28,16 @@ getcd 1 $PST_2CD_MD5 data1.cab
mkdir -p "$TARGETDIR" || die
-unshield -g MinimumData -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
-unshield -g MinimumData -L x $CDMOUNT/data2.cab -d "$TARGETDIR" || die
+unshield -g MinimumData -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
+unshield -g MinimumData -L x "${CDMOUNT}/data2.cab" -d "$TARGETDIR" || die
-cp $CDMOUNT/Manual/Torment.pdf "$TARGETDIR"/manual.pdf || die
-cp $CDMOUNT/Torment.ico "$TARGETDIR"/torment.ico || die
-cp $CDMOUNT/Torment.ex_ "$TARGETDIR"/torment.exe || die
+cp "${CDMOUNT}/Manual/Torment.pdf" "${TARGETDIR}/manual.pdf" || die
+cp "${CDMOUNT}/Torment.ico" "${TARGETDIR}/torment.ico" || die
+cp "${CDMOUNT}/Torment.ex_" "${TARGETDIR}/torment.exe" || die
-mv "$TARGETDIR"/minimumdata/* "$TARGETDIR" || die
-rmdir "$TARGETDIR"/minimumdata || die
+mv "${TARGETDIR}/minimumdata/"* "$TARGETDIR" || die
+rmdir "${TARGETDIR}/minimumdata" || die
-mkdir -p "$TARGETDIR/save" || die
+mkdir -p "${TARGETDIR}/save" || die
setperms "$TARGETDIR"
diff --git a/pst/install-4cd-extra.sh b/pst/install-4cd-extra.sh
index f66c79e..1344d65 100755
--- a/pst/install-4cd-extra.sh
+++ b/pst/install-4cd-extra.sh
@@ -17,8 +17,8 @@
# Extra Planescape: Torment (4CD version) content (so CDs aren't needed)
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -29,12 +29,12 @@ CD3="6ffd2c51a41603c7dca6196d9bef2e26"
CD4="b70322aaa7b1d61a168a766eba399085"
getcd 2 $CD2 cd2/movies2.bif
-copylower "$CDMOUNT/cd2/" "$TARGETDIR" || die
+copylower "${CDMOUNT}/cd2/" "$TARGETDIR" || die
getcd 3 $CD3 cd3/AR0500.bif
-copylower "$CDMOUNT/cd3/" "$TARGETDIR" || die
+copylower "${CDMOUNT}/cd3/" "$TARGETDIR" || die
getcd 4 $CD4 cd4/movies4.bif
-copylower "$CDMOUNT/cd4/" "$TARGETDIR" || die
+copylower "${CDMOUNT}/cd4/" "$TARGETDIR" || die
setperms "$TARGETDIR"
diff --git a/pst/install-4cd-minimal.sh b/pst/install-4cd-minimal.sh
index 09cd175..8ee12dd 100755
--- a/pst/install-4cd-minimal.sh
+++ b/pst/install-4cd-minimal.sh
@@ -17,8 +17,8 @@
# Installs Planescape: Torment (4CD version) minimal
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/cd-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/cd-includes.sh"
parseargs "$@"
@@ -28,13 +28,13 @@ getcd 1 $PST_4CD_MD5 data1.cab
mkdir -p "$TARGETDIR" || die
-unshield -L x $CDMOUNT/data1.cab -d "$TARGETDIR" || die
+unshield -L x "${CDMOUNT}/data1.cab" -d "$TARGETDIR" || die
-cp -R "$TARGETDIR"/program_executable_files/* "$TARGETDIR" || die
-rm -r "$TARGETDIR"/program_executable_files
+cp -R "${TARGETDIR}/program_executable_files/"* "$TARGETDIR" || die
+rm -r "${TARGETDIR}/program_executable_files"
-cp $CDMOUNT/torment.ico "$TARGETDIR" || die
+cp "${CDMOUNT}/torment.ico" "$TARGETDIR" || die
-mkdir -p "$TARGETDIR/save" || die
+mkdir -p "${TARGETDIR}/save" || die
setperms "$TARGETDIR"
diff --git a/pst/install-patch-official.sh b/pst/install-patch-official.sh
index 5a9b200..05cd670 100755
--- a/pst/install-patch-official.sh
+++ b/pst/install-patch-official.sh
@@ -17,8 +17,8 @@
# Planescape: Torment official patch
scriptdir="$(dirname $0)"/..
-source "$scriptdir/includes/generic-includes.sh"
-source "$scriptdir/includes/patch-includes.sh"
+source "${scriptdir}/includes/generic-includes.sh"
+source "${scriptdir}/includes/patch-includes.sh"
parseargs "$@"
@@ -28,10 +28,10 @@ setuptmp
getpatch http://www.sorcerers.net/Games2/Torment/Trmt11.exe
-cabextract -L $TMPDIR/Trmt11.exe -d $TMPDIR || diesoftly
-unshield -L x $TMPDIR/data1.cab -d $TMPDIR || diesoftly
+cabextract -L "${TMPDIR}/Trmt11.exe" -d "$TMPDIR" || diesoftly
+unshield -L x "${TMPDIR}/data1.cab" -d "$TMPDIR" || diesoftly
-cp -R $TMPDIR/program_executable_files/* "$TARGETDIR" || diesoftly
+cp -R "${TMPDIR}/program_executable_files/"* "$TARGETDIR" || diesoftly
cleanuptmp
setperms "$TARGETDIR"