failat 21

echo "*n*n*e[1;32m _____________________________________________________________________"
echo " *e[43m                                                                     *e[0m"
echo " *e[0;32;43m                  Welcome to MagicWB v1.5: UNPACK*e[1m                    *e[0m"
echo " *e[1;4;43m                                                                     *e[0m"
echo "*n*n*n You have activated the MagicWB Unpack Utility. This utility will NOT"
echo " INSTALL MagicWB to your HardDisk. It will just UNPACK MagicWB to your"
echo " HardDisk. Once it is unpacked you can go into the MagicWB directory"
echo " and activate the Installer to install MagicWB.*n"
echo " MagicWB had to be packed because otherwise it would not have fit on"
echo " a normal disk. Make sure that you have got at least 2 MB free space"
echo " on your HardDisk to unpack MagicWB!*n"
echo noline "*n Would you like to unpack MagicWB? "
set > NIL: InpVar ?

if $InpVar eq "ja"
  skip start
endif

if $InpVar eq "j"
  skip start
endif

if $InpVar eq "yes"
  skip start
endif

if $InpVar eq "y"
  skip start
endif

echo "*n[32m Unpacking aborted! I hope I see you again...*n"
quit 

lab start
echo "*e[1;1H*e[J"
echo "*n*n Now, please enter the path where MagicWB should be unpacked to"
echo " (a directory called 'MagicWB' will automatically be created in the"
echo " path you have entered).*n"
echo "[32m The path MUST HAVE A TRAILING SLASH (/) at the end of the pathname![0m"
echo " If not, it will not work! (If the destination is just a device/volume"
echo " you certainly must only enter a colon (:) at the end of the name)*n*n"

lab PathRepeat
echo noline " Please enter path: "
set Path "[Return]"
set > NIL: Path ?
if not exists $Path
  echo " Wrong path, '$Path' does not exist! Try again...*n"
  skip back PathRepeat
endif
echo "*e[1;1H*e[J"    
echo " MagicWB will be unpacked to the path '[32m$Path[0m'*n*n"
:C/LhX x -x -a MagicWB.lha $Path

if warn 
  echo "*n[32m Unpacking failed! Please try again (check memory).[0m"
  wait 5
else 
  echo "*n MagicWB has been successfully unpacked to [32m$Path[0m."
  echo " Please consult the documentation of MagicWB for further information."
  echo "*n   [Return]"
  set > NIL: Return ?
endif

quit