home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Complet / FreeDOS / fdbootcd.iso / FREEDOS / PACKAGES / BASE / DISK04 / SAMCFG / POSTINST.BAT < prev   
DOS Batch File  |  2004-04-19  |  6KB  |  200 lines

  1. @echo off
  2. if [%errorlevel%]==[] goto error
  3. if [%_CWD%]==[] goto error
  4. if "%cdrom%"=="C:" goto error2
  5. if "%cdrom%"=="c:" goto error2
  6. if "%step6%"=="√" goto end
  7. goto begin
  8.  
  9. rem #1: Bootsector
  10. rem #2: Search bootup files
  11. rem  -2a: comfile (comspec/shell/command interpreter, command.com)
  12. rem  -2b: autofile (bootup automation script, autoexec.bat)
  13. rem  -2c: cfgfile (device driver loading script, [fd]config.sys)
  14. rem #3: Create bootup files
  15. rem #4: Translate programs and install them
  16. rem #5: Clean up
  17.  
  18. :begin
  19. cls
  20. set fdosdir=%_CWD%
  21. if "%bootsrc%"=="" set path=%fdosdir%;%path%
  22. if "%bootsrc%"=="diskette" set path=%fdosdir%;%path%
  23. REM ctty nul
  24. cdd %fdosdir%
  25. ren localize.txt localize.%lang%
  26. if exist %fdosdir%\INSTBASE\freedos.log set GUI_inst=true
  27. for %%x in ( 1 2 3 4 5 6 ) DO set step%%x=Θ
  28. set comfile=%fdosdir%\BIN\command.com
  29. goto infomenu
  30.  
  31. :infomenu
  32. if exist %fdosroot%\nls\localize.%lang% set nlspath=%fdosroot%\nls
  33. if exist a:\freedos\localize.%lang% set nlspath=a:\freedos
  34. ctty con
  35. cls
  36. for %%x in ( 0 1 2 ) do localize 3.%%x
  37. for %%x in ( 1 2 3 4 5 6 ) do if "%step%%x%"=="√" localize 4.%%x
  38. for %%x in ( 1 2 3 4 5 6 ) do if "%step%%x%"=="Θ" localize 5.%%x
  39. REM ctty nul
  40. %fdosroot%\bin\sleep 1
  41. for %%x in ( 1 2 3 4 5 6 ) do if "%step%%x%"=="Θ" goto step%%x
  42. goto end
  43.  
  44. :step1
  45. set step1=√
  46. set copycmd=/y
  47. rem Create Bootsector
  48. %fdosdir%\bin\SYS %fdosdir% c: c:\fdosboot.bin BOOTONLY 
  49. copy %fdosdir%\bin\kernel32.sys c:\kernel.sys
  50. REM set iofiles=c:\io.sys c:\dosplus.sys c:\drbios.sys c:\drdos.sys c:\ibmbio.com c:\winboot.sys
  51. REM for %%x in ( %iofiles% ) do if exist %%x goto metadual
  52. goto infomenu
  53.  
  54.  
  55. :step2
  56. set nlspath=%fdosdir%
  57. ren localize.txt localize.%lang%
  58. goto step2a
  59.  
  60. :step2a
  61. set comfile=%fdosdir%\command.com
  62. IF EXIST C:\command.com goto step2b
  63. set comfile=c:\command.com
  64. goto step2b
  65.  
  66. :step2b
  67. echo @echo off > %fdosdir%\fdauto.bat
  68. for %%x in ( 1 2 3 4 5 6 7 8 ) do localize 2.%%x >> %fdosdir%\fdauto.bat
  69. set autofile=%fdosdir%\fdauto.bat
  70. if exist c:\autoexec.bat goto step2c
  71. rem Moving file and adjusting %autofile%
  72. copy %fdosdir%\fdauto.bat c:\autoexec.bat
  73. if exist c:\autoexec.bat del %fdosdir%\fdauto.bat
  74. if exist c:\autoexec.bat set autofile=c:\autoexec.bat
  75. goto step2c
  76.  
  77. :step2c
  78. cls
  79. set cpugen=3
  80. set nlspath=%fdosdir%
  81. echo !SET dosdir=%fdosdir%> c:\fdconfig.sys
  82. if not exist c:\config.sys ren c:\fdconfig.sys config.sys
  83. for %%x in ( c:\config.sys c:\fdconfig.sys ) do if exist %%x set cfgfile=%%x
  84. set step2=√
  85. goto infomenu
  86.  
  87. :step3
  88. CDD %fdosdir%\NLS
  89. if exist makecmd.bat call makecmd.bat
  90. if not exist command.com copy %comspec% command.com
  91. if not exist xmsswap.com copy command.com xmsswap.com
  92. set copycmd=/y
  93. IF NOT EXIST %comfile% copy command.com %comfile%
  94. cls
  95. set step3=√
  96. goto infomenu
  97.  
  98.  
  99. :step4
  100. set nlspath=%fdosdir%
  101. cls
  102. echo !SET lang=%lang% >> %cfgfile%
  103. for %%x in ( 0 1 2 3 4 5 6 7 8 9 10 ) DO LOCALIZE 0.%%x >> %cfgfile%
  104. goto sub4_%cpugen%86
  105.  
  106. :sub4_186
  107. copy %fdosdir%\NLS\command.com %comfile%
  108. for %%x in ( 1 2 3 ) DO LOCALIZE 0.%cpugen%%%x >> %cfgfile%
  109. rem swap FreeCOM (non-XMS version!) to harddisk when using CALL /S prog.exe
  110. ECHO 1?SHELLHIGH=%fdosdir%\bin\KSSF.COM %comfile% /K %autofile% >> %cfgfile%
  111. REM for %%x in ( 1 ) DO LOCALIZE 2.%cpugen%%%x >> %autofile%
  112. set step4=√
  113. goto infomenu
  114.  
  115. :sub4_286
  116. copy %fdosdir%\NLS\xmsswap.com %comfile%
  117. for %%x in ( 1 2 ) DO LOCALIZE 0.%cpugen%%%x >> %cfgfile%
  118. ECHO 1?DEVICE=%fdosdir%\BIN\FDXMS286.SYS >> %cfgfile%
  119. ECHO 1?SHELL=%comfile% /K %autofile% >> %cfgfile%
  120. ECHO 2?SHELL=%comfile% /D /K SET PATH=%fdosdir%\bin >> %cfgfile%
  121. REM for %%x in ( 1 ) DO LOCALIZE 2.%cpugen%%%x >> %autofile%
  122. goto sub4keyb
  123.  
  124. :sub4_386
  125. copy %fdosdir%\NLS\xmsswap.com %comfile%
  126. set umb_list=NOEMS
  127. rem UMB_list is mostly VMware specific, but should hardly harm on real machines.
  128. rem Areas not explicitly included are being taken care of by the auto-scan.
  129. if not "%color%"=="Mono" set umb_list=NOEMS I=B000-B7FF I=DC00-EBFF I=C800-C8FF
  130. for %%x in ( 1 2 3 ) DO LOCALIZE 0.%cpugen%%%x >> %cfgfile%
  131. ECHO 12?DEVICE=%fdosdir%\BIN\HIMEM.EXE >> %cfgfile%
  132. ECHO 2?DEVICE=%fdosdir%\BIN\EMM386.EXE %umb_list% >> %cfgfile%
  133. ECHO ;1?DEVICE=%fdosdir%\bin\atapicdd.sys /D:FDCD0001 >> %cfgfile%
  134. ECHO 12?SHELLHIGH=%comfile% /K %autofile% >> %cfgfile%
  135. ECHO 3?SHELLHIGH=%comfile% /D /K set path=%fdosdir%\bin >> %cfgfile%
  136. for %%x in ( 1 ) DO LOCALIZE 2.%cpugen%%%x >> %autofile%
  137. set umb_list=
  138. goto sub4keyb
  139.  
  140. :sub4keyb
  141. set step4=√
  142. if "%keybfile%"=="" goto infomenu
  143. CDD %fdosdir%\bin\key
  144. keyfiles %keybfile%
  145. if not exist %keybfile% keyfiles %keybfile%
  146. cdd -
  147. REM if not exist %fdosdir%\bin\KEY\%keybfile% %fdosdir%\bin\KEY\kblayout.exe -C %keybfile% -d %fdosdir%\bin\KEY
  148. REM if exist %fdosdir%\bin\KEY\%keybfile% 
  149. echo LH KEYB %kblayout%,,%fdosdir%\bin\KEY\%keybfile% %keybrest% >> %autofile%
  150. goto infomenu
  151.  
  152. :step5
  153. if exist %fdosroot%\nls\localize.%lang% set nlspath=%fdosroot%\nls
  154. if exist a:\freedos\localize.%lang% set nlspath=a:\freedos
  155. REM localize 7.4 %cfgfile%, %autofile%, %comfile% >> %autofile%
  156. for %%x in ( 0 1 2 1 ) do localize 7.%%x >> %autofile%
  157. goto step5a
  158.  
  159. :step5a
  160. set step5=√
  161. if not exist %fdosdir%\bin\ctmouse.exe goto infomenu
  162. localize 3.3
  163. REM ctty nul
  164. %fdosdir%\bin\ctmouse.exe
  165. if errorlevel 5 goto infomenu
  166. copy /y %fdosdir%\bin\ctmouse.exe %fdosdir%\bin\mouse.exe 
  167. for %%x in ( %fdosdir%\bin\ctmouse\ctm-%lang%.exe ) do if exist %%x copy /y %fdosdir%\bin\mouse.exe
  168. ECHO MOUSE >> %autofile%
  169. ctty con
  170. goto infomenu
  171.  
  172. :step6
  173. ctty con
  174. set step6=√
  175. alias boot=%fdosdir%\bin\SYS C: C: BOOTONLY
  176. for %%x in ( 0 1 2 3 4 5 6 ) do localize 4.%%x
  177. for %%x in ( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ) do localize 6.%%x
  178. md %fdosdir%\temp
  179.  
  180. cd \
  181. cd %fdosdir%
  182. echo.
  183. echo Type NO (+ENTER) to not install bootsector,
  184. set /P instboot=or press just ENTER to DO install bootsector
  185. if not "%instboot%"=="" goto clean_up
  186. %fdosdir%\bin\SYS C: C: BOOTONLY
  187. goto clean_up
  188.  
  189. :clean_up
  190. set temp=%fdosdir%\temp
  191. set tmp=%fdosdir%\temp
  192. set path=%fdosdir%\bin
  193. set nlspath=%fdosdir%\NLS
  194. for %%x in ( 1 2 3 4 5 6 ) do set step%%x=
  195. for %%x in ( files disksrc bootsrc cputype cdname loadbat cdrom findfile      ) DO set %%x=
  196. for %%x in ( instmode menu1_nr menu2_nr opt form_opt instparm autofile key    ) DO set %%x=
  197. for %%x in ( config cfgfile gui_inst comfile languages fdosroot color display ) DO set %%x=
  198. goto end
  199.  
  200. :end