summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauto-installer.sh82
-rw-r--r--includes/generic-includes.sh6
2 files changed, 45 insertions, 43 deletions
diff --git a/auto-installer.sh b/auto-installer.sh
index 475fc09..f87e0ee 100755
--- a/auto-installer.sh
+++ b/auto-installer.sh
@@ -44,51 +44,51 @@ 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 [ "$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 [ "$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"
diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh
index 3e3ef36..b58177b 100644
--- a/includes/generic-includes.sh
+++ b/includes/generic-includes.sh
@@ -141,14 +141,16 @@ function parseargs
function copylower
{
# usage: copylower source destination
+ mkdir -p "$2"
+
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)"
- cp -f "$filename" "$2/$lowerpath" || die
+ cp -f "$filename" "${2}/${lowerpath}" || die
done
elif [ -f "$1" ]; then
lowername="$(basename $1|tr A-Z a-z)"
- cp -f "$1" "$2"/$lowername
+ cp -f "$1" "${2}/${lowername}"
fi
}