echo off
if %1x==x statline B:
if not %2x==x goto again
echo    .
echo    Remove the original STORY diskette from drive A: and insert the
echo    PLAY diskette into drive A:.
pause
:again
af > ansi
if errorlevel 1 goto noansi
if exist \config.sys goto fixcon
rem create a config.sys file
:create
copy ansi \config.sys > nul
goto win
:fixcon
rem check config.sys for reference to ansi
if exist pass2 goto append
scan
if errorlevel 2 goto failed
if errorlevel 1 goto append
echo    .
echo    .
echo    Installation is now complete.
goto signoff
:append
copy \config.sys \config.old > nul
copy \config.sys+ansi \config.sys > nul
:win
echo    .
echo    .
if not %2x==x goto hdmess
echo    Installation is now complete.  Please reboot your system.
goto signoff
:hdmess
echo    Installation is now complete.  Please remove the original diskette
echo    from drive A and reboot your system.
:signoff
echo    .
echo    .
echo    See your reference card for an explanation of how to load the story.
goto end
:failed
echo    .
echo    Something is wrong with your config.sys file.  Please reboot your
echo    system and try again.  If this operation fails again, consult your
echo    DOS manual regarding Configuring Your System.
goto end
:noansi
echo    .
if exist a:one goto pcjr
if %2x==x echo  Please find your original DOS diskette and place it in drive B: and
if not %2x==x echo      Please find your original DOS diskette and place it in drive A: and
goto dos
:pcjr
echo    Whenever you are prompted to put a diskette into drive A:, you
echo    should insert the PLAY diskette into the drive, and whenever you
echo    are prompted to put the diskette into drive B:, you should insert
echo    the DOS diskette into the drive.
:dos
if %2x==x goto getb
pause
copy a:ansi.sys %1\ > nul
if exist %1\ansi.sys goto getansi
goto end
:getb
pause
copy b:ansi.sys > nul
if exist ansi.sys goto getansi
echo    .
echo    .
echo    Installation is now complete.
goto signoff
:getansi
echo foo > pass2
goto again
:end
if exist ansi del ansi
if exist install*.bat del install*.bat
if exist gamedir.com del gamedir.com
if exist scan.com del scan.com
if exist yes.com del yes.com
if exist af.exe del af.exe
if exist one del one
if exist pass2 del pass2