.Key  ""
set src1  "KOE2.lha"
set dst  "KOE-II-VikingsA"

echo ""
echo "  This script will unpack the following lha archives:"
echo ""
echo "  $src1 => $dst"
echo ""

lab GETDRIVE
echo "  Which drive do you want to unpack to? [0,1,2,3] "  NOLINE
failat 20
skip >NIL: ? 

lab 0
  set drive "DF0:"
  skip HAVEDRIVE
;
lab 1
  set drive "DF1:"
  skip HAVEDRIVE
;
lab 2
  set drive "DF2:"
  skip HAVEDRIVE
;
lab 3
  set drive "DF3:"
  skip HAVEDRIVE
;

lab HAVEDRIVE
ask "  Do you have a blank unformatted disk in drive $drive?"
if not WARN
	echo ""
	echo "  Try again when you do ..."
	echo "  All Done.  Click close gadget to get rid of window."
	endcli
endif

echo ""
echo "  ==> sys:system/format drive $drive name $dst NOICONS"
sys:system/format drive $drive name $dst NOICONS
echo "  ==> :c/lha -axm x $src1 $dst:"
:c/lha -axm x $src1 $dst:
echo ""
echo "  Installing $drive"
sys:c/install $drive

echo "  Copying selected proprietary files from your sys: directory ..."


if exists sys:c/Assign
	copy sys:c/Assign	$dst:c
endif

if exists sys:c/If
	copy sys:c/If		$dst:c
endif

if exists sys:c/Else
	copy sys:c/Else		$dst:c
endif

if exists sys:c/EndCLI
	copy sys:c/EndCLI	$dst:c
endif

if exists sys:c/Mount
	copy sys:c/Mount	$dst:c
endif

if exists sys:c/Run
	copy sys:c/Run		$dst:c
endif

if exists sys:c/Type
	copy sys:c/Type		$dst:c
endif

if exists sys:c/Version
	copy sys:c/Version	$dst:c
endif

if exists sys:c/Wait
	copy sys:c/Wait		$dst:c
endif


if exists sys:l/null-handler
	copy sys:l/null-handler		$dst:l
endif


if exists sys:libs/icon.library
	copy sys:libs/icon.library	$dst:libs
endif

echo "  All Done.  Click close gadget to get rid of window."
endcli


endskip
echo "  Invalid Drive Selection, Please try again!"
skip back GETDRIVE






