home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Complet / FreeDOS / fdbootcd.iso / FREEDOS / SETUP / BATCH / TEXTMENU.BAT < prev   
DOS Batch File  |  2004-04-15  |  3KB  |  100 lines

  1. @echo off
  2. goto start
  3. :start
  4. %fdosroot%\bin\whichfat C:
  5. if "%errorlevel%"=="1" set opt=fdisk
  6. if "%errorlevel%"=="12" set opt=format
  7. if errorlevel 16 set opt=install
  8. goto begin
  9.  
  10. :quit
  11. SET TEXTMENU=QUIT
  12. goto end
  13.  
  14. :begin
  15. cls
  16. for %%x in ( 0 1 2 3 ) do localize 2.%%x
  17. if "%cdrom%"=="C:" goto choices
  18. for %%x in ( 4 5 ) do if not "%opt%"=="fdisk" localize 2.%%x
  19. for %%x in ( install format ) do if "%opt%"=="%%x" localize 2.6
  20. for %%x in ( 7 8 9 10 ) do localize 2.%%x
  21. goto choices
  22.  
  23. :choices
  24. set form_opt=/U
  25. %fdosroot%\bin\choice /N /C:1234qQrR %menu2txt%
  26. if "%errorlevel%"=="5" goto quit
  27. if "%errorlevel%"=="6" goto quit
  28. if "%errorlevel%"=="7" FDISK /REBOOT
  29. if "%errorlevel%"=="8" FDISK /REBOOT
  30. if "%cdrom%"=="C:" goto fdisk
  31. if "%errorlevel%"=="1" goto fdisk
  32. if "%errorlevel%"=="2" goto askdrvs
  33. if "%errorlevel%"=="3" set form_opt=/U
  34. if "%errorlevel%"=="3" goto askdrvs
  35. if "%errorlevel%"=="4" goto setupDOS
  36. goto start
  37.  
  38. :fdisk
  39. FDISK /MONO
  40. if not "%errorlevel%"=="6" goto start
  41. cls
  42. echo Warning: No (IDE-)harddisk detected, FreeDOS cannot be installed until
  43. echo          a primary partition has been created on a detected harddisk.
  44. echo.
  45. echo          In case of a non standard harddisk or a harddisk on a non-
  46. echo          standard interface (SCSI for example) you may need to load
  47. echo          a driver to access it.
  48. echo.
  49. pause
  50. goto start
  51.  
  52. :askdrvs
  53. set /p wipedrv=Which drive(s) do you want to format (example. C: D:)?
  54. echo Please type the complete word 'YES' or 'NO' below at the following question(s):
  55. for %%x in ( %wipedrv% ) do if exist %%x\nul  format  %%x  %form_opt% /Q /V:FREEDOS9RC5
  56. for %%x in ( %wipedrv% ) do if exist %%x:\nul format  %%x: %form_opt% /Q /V:FREEDOS_%%x95
  57. if not "%errorlevel%"=="10" set msg=Format completed on drive(s) %wipedrv%. 
  58. if "%errorlevel%"=="10" set msg=Format failed on drive(s)
  59. echo %msg%
  60. pause
  61. goto start
  62.  
  63. :setupDOS
  64. if "%opt%"=="format" format C:  %form_opt% /Z:SERIOUSLY /Q /V:FREEDOS_C95
  65. if "%opt%"=="format" SYS C: C: C:\BOOTSECT.BIN BOOTONLY BOTH
  66. if "%opt%"=="format" set opt=install
  67. if not "%opt%"=="install" goto begin
  68. set instparm=
  69. if "%color%"=="Mono" set instparm=%instparm% /mono
  70. if "%instmode%"=="Full" set instparm=%instparm% /df %fdosroot%\install\INSTALL.DAT
  71. if "%instmode%"=="Mini" set instparm=%instparm% /df %fdosroot%\install\INSTALL.MIN
  72.  
  73. set instparm=%instparm% /src %cdrom%FREEDOS\PACKAGES
  74. CDD %fdosroot%\install\
  75. if exist c:\fdconfig.sys ren c:\fdconfig.sys fdconfig.old
  76. if exist c:\fdauto.bat ren c:\fdauto.bat fdauto.old
  77. for %%x in ( Mono ) do if "%color%"=="%%x" goto setuptxt
  78. for %%x in ( 8086 80186 80286 ) do if "%cputype%"=="%%x" goto setuptxt
  79. goto setupGUI
  80.  
  81. :setupGUI
  82. if exist a:\driver\ctmouse.exe a:\driver\ctmouse.exe
  83. echo Mouse loaded.
  84. if exist %fdosroot%\bin\cwsdpmi.exe %fdosroot%\bin\cwsdpmi.exe -p -sc:\fdosswap.tmp
  85. echo CWSDPMI loaded
  86. install.exe %instparm% /overwrite /noask
  87. if not "%errorlevel%"=="0" pause Warning: error %errorlevel% occurred! Press a key to continue
  88. if exist c:\fdconfig.sys goto end
  89. echo Fatal Error: GUI installer crashed or exited without installing
  90. echo falling back to text installer.
  91. pause
  92. goto setupTXT
  93.  
  94. :setupTXT
  95. textinst.exe %instparm%
  96. if not %errorlevel%==0 pause Warning: error %errorlevel% occurred! Press a key to continue
  97. goto end
  98.  
  99. :end
  100.