home *** CD-ROM | disk | FTP | other *** search
/ Season's Greetings & Games Unlimited / UGOLD_cd2.iso / lotf / install.bat < prev    next >
DOS Batch File  |  1993-11-29  |  2KB  |  88 lines

  1. echo off
  2. if "%1"=="" goto usage
  3. if "%2"=="" goto usage
  4. goto start
  5. :usage
  6. echo This command installs the program by copying the files from a floppy 
  7. echo disk, to your hard disk. If you have already done this, no further
  8. echo installation is needed - type LOTF to run the game, or README for more
  9. echo information.
  10. echo.
  11. echo To copy the files to the hard disk, enter:
  12. echo.
  13. echo   INSTALL source-drive destination-drive [optional-directory-name]
  14. echo.
  15. echo The directory defaults to \LOTF if it is not specified.
  16. echo.
  17. echo E.g. 
  18. echo.
  19. echo   INSTALL A: C:
  20. echo.
  21. echo to copy the files from the disk in drive A:, to the directory \LOTF 
  22. echo on drive C:.
  23. echo.
  24. echo The destination directory is created if it does not already exist. Note
  25. echo that if a path is specified, such as \GAMES\LOTF, only the final
  26. echo subdirectory can be created - the remaining directories must already
  27. echo exist (\GAMES in this example).
  28. goto done
  29.  
  30. :start
  31. if not exist %1lotfdsk1.id goto badsrc
  32.  
  33. if "%3"=="" goto defdir
  34. rem Check/create user specified directory
  35. if not exist %2%3\nul echo Creating directory %2%3...
  36. if not exist %2%3\nul mkdir %2%3
  37. if not exist %2%3\nul goto dirfail
  38. if exist %2%3\hiscore.dat copy %2%3\hiscore.dat %2%3\hiscore.old
  39. echo Copying files to %2%3...
  40. xcopy %1*.* %2%3
  41. if errorlevel 1 goto copyfail
  42. %2
  43. cd %3
  44. goto success
  45.  
  46. :defdir
  47. rem Check/create default directory
  48. if not exist %2\LOTF\nul echo Creating directory %2\LOTF...
  49. if not exist %2\LOTF\nul mkdir %2\LOTF
  50. if not exist %2\LOTF\nul goto dirfail
  51. if exist %2\LOTF\hiscore.dat copy %2\LOTF\hiscore.dat %2\LOTF\hiscore.old
  52. echo Copying files to %2\LOTF...
  53. xcopy %1*.* %2\LOTF\
  54. if errorlevel 1 goto copyfail
  55. %2
  56. cd \LOTF
  57.  
  58. :success
  59. echo.
  60. echo Installation complete. Type LOTF to start the game.
  61. if not exist hiscore.old goto done
  62.  
  63. echo.
  64. echo The old hi-score data has been saved in HISCORE.OLD. Use
  65. echo.
  66. echo   COPY HISCORE.OLD HISCORE.DAT
  67. echo.
  68. echo to restore the old scores.
  69. echo.
  70. echo If you have just installed a different version of the program, run
  71. echo SETUP now to select any newly available options.
  72. goto done
  73.  
  74. :badsrc
  75. echo INSTALL: The source drive does not contain the program files.
  76. echo.
  77. echo Type INSTALL, without any arguments, for instructions.
  78. goto done
  79.  
  80. :dirfail
  81. echo INSTALL: Unable to create destination directory.
  82. goto done
  83.  
  84. :copyfail
  85. echo INSTALL: File copy failed.
  86.  
  87. :done
  88.