Added install scripts for CD/Steam data
This commit is contained in:
parent
c31b8aa595
commit
c1c1892525
2 changed files with 80 additions and 0 deletions
48
install_from_cd.sh
Executable file
48
install_from_cd.sh
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )"
|
||||
OUTPK3DIR="pak0_retail.pk3dir"
|
||||
|
||||
if ! [ -x "$(command -v unshield)" ]; then
|
||||
printf "Error: unshield is not installed.\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v rsync)" ]; then
|
||||
printf "Error: rsync is not installed.\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ $# -gt 0 ]; then
|
||||
printf "Path to MOUNTED CD-ROM folder, e.g. /mnt/cdrom:\n"
|
||||
read CDROM_PATH
|
||||
else
|
||||
CDROM_PATH="$1"
|
||||
fi
|
||||
|
||||
if ! [ -f "$CDROM_PATH"/data1.cab ]; then
|
||||
printf "Error: data1.cab not found in $CDROM_PATH.\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Grab the cabinet data off the CD
|
||||
mkdir -p ./tmp
|
||||
unshield -d ./tmp x "$CDROM_PATH"/data1.cab
|
||||
|
||||
# Let's shove them all into a convenient .pk3dir
|
||||
mkdir -p ./$OUTPK3DIR
|
||||
mv -v ./tmp/Half-Life_PAK_File/valve/pak0.pak ./$OUTPK3DIR/pak0.pak
|
||||
rsync -av ./tmp/Half-Life_Program_Files/valve/ ./$OUTPK3DIR/
|
||||
mv -v ./tmp/Half-Life_Program_Files/media ./$OUTPK3DIR/media
|
||||
mv -v ./tmp/Half-Life_Program_Files/logos ./$OUTPK3DIR/logos
|
||||
|
||||
# Get the latest patch, because that'll fix the menu assets and add more fun, free content
|
||||
wget -nc -O ./tmp/patch1110.zip http://archive.org/download/hl_shareware_data/valve/patch1110.zip
|
||||
unzip -o ./tmp/patch1110.zip -d ./$OUTPK3DIR
|
||||
|
||||
# Dangerous rm -rf'ing going on here
|
||||
printf "All done. Would you like to clean up temporary files? (./tmp dir)\ny/n: "
|
||||
read CHOICE
|
||||
|
||||
if [[ "$CHOICE" == [Yy]* ]]; then
|
||||
rm -rfv ./tmp
|
||||
fi
|
32
install_from_steam.sh
Executable file
32
install_from_steam.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )"
|
||||
|
||||
STEAMPATH="$HOME/.steam/steam/steamapps/common/Half-Life"
|
||||
OUTPK3DIR="pak0_steam.pk3dir"
|
||||
|
||||
if ! [ -x "$(command -v rsync)" ]; then
|
||||
printf "Error: rsync is not installed.\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# take parameter if present
|
||||
if [ $# -gt 0 ]; then
|
||||
STEAMPATH="$1"
|
||||
else
|
||||
if ! [ -f "$STEAMPATH"/valve/halflife.wad ]; then
|
||||
printf "Path to Half-Life (STEAM) folder:\n"
|
||||
read STEAMPATH
|
||||
fi
|
||||
fi
|
||||
|
||||
# check before moving
|
||||
if ! [ -f "$STEAMPATH"/valve/halflife.wad ]; then
|
||||
printf "Error: Can't figure out where Half-Life's data is.\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p ./$OUTPK3DIR
|
||||
rsync -av "$STEAMPATH"/valve/ ./$OUTPK3DIR/
|
||||
|
||||
# Dangerous rm -rf'ing going on here
|
||||
printf "All done. FreeHL will be playable, but the menu will have placeholder assets.\n"
|
Loading…
Reference in a new issue