home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 October / PCpro_2006_10.ISO / files / wininside / ubcd / ubcd34-basic.exe / ubcd34-basic.iso / dosapps / freedos / postinst.bat < prev   
Encoding:
DOS Batch File  |  2003-09-25  |  7.2 KB  |  196 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 init
  8.  
  9. :init
  10. rem unset variables to make some environmentspace.
  11.  
  12. set bin_dir=A:
  13. if not "%cdrom%"=="" set bin_dir=%cdrom%\freedos\setup\bin
  14. set files=sys.com debug.com attrib.com locate.com
  15. REM for %%x in ( %files% ) do if not exist %bin_dir%\%%x goto complain
  16. goto begin
  17.  
  18. :begin
  19. cls
  20. ctty nul
  21. set fdosdir=%_CWD%
  22. if exist %fdosdir%\INSTBASE\freedos.log set GUI_inst=true
  23. for %%x in ( 1 2 3 4 5 6 ) DO set step%%x=Θ
  24. set comfile=%fdosdir%\BIN\command.com
  25. goto infomenu
  26.  
  27. :infomenu
  28. ctty con
  29. cls
  30. %header%
  31. echo.
  32. echo Performing post installation steps:
  33. echo %step1% Stage 1 : Setup kernel and bootsectorfiles
  34. echo %step2% Stage 2 : Create configuration file %cfgfile%
  35. echo %step3% Stage 3 : Create automation file %autofile%
  36. echo %step4% Stage 4 : Setting up translated programs.
  37. echo %step5% Stage 5 : Installing mousedriver
  38. echo %step6% Stage 6 : Writing bootsector
  39. ctty nul
  40. %bin_dir%\sleep 1
  41. if "%step1%"=="Θ" goto step1
  42. if "%step2%"=="Θ" goto step2
  43. if "%step3%"=="Θ" goto step3
  44. if "%step4%"=="Θ" goto step4
  45. if "%step5%"=="Θ" goto step5
  46. if "%step6%"=="Θ" goto step6
  47. goto end
  48.  
  49. :step1
  50. set step1=√
  51. set copycmd=/y
  52. rem Create Bootsector
  53. SYS %fdosdir% c: c:\fdosboot.bin BOOTONLY 
  54. copy %fdosdir%\bin\kernel32.sys c:\kernel.sys
  55.  
  56. REM %bin_dir%\hasfat32
  57. REM if errorlevel 1 set core=%core16%
  58.  
  59. REM set iofiles=c:\io.sys c:\dosplus.sys c:\drbios.sys c:\drdos.sys c:\ibmbio.com c:\winboot.sys
  60. REM for %%x in ( %iofiles% ) do if exist %%x goto metadual
  61. goto infomenu
  62.  
  63. :step2
  64. rem Determine the appropriate eXtended Memory Services [XMS] manager
  65. if "%cputype%"=="80386" set xmsline=1?DEVICE=%fdosdir%\BIN\FDXMS.SYS
  66. if "%cputype%"=="80286" set xmsline=1?DEVICE=%fdosdir%\BIN\FDXMS286.SYS
  67. if "%cputype%"=="80186" set xmsline=;XMS driver not available on %cputype% platform
  68. if "%cputype%"=="80086" set xmsline=;XMS driver not available on %cputype% platform
  69.  
  70. cls
  71. if "%GUI_inst%"=="true" goto step2a1
  72. echo ;for help on commands, please see %fdosdir%\config.sys    > c:\fdconfig.sys
  73. echo !LASTDRIVE=Z                                             >> c:\fdconfig.sys
  74. echo !BUFFERS=20                                              >> c:\fdconfig.sys
  75. echo !FILES=40                                                >> c:\fdconfig.sys
  76. goto step2a1
  77.  
  78. :step2a1
  79. echo MENU 1 - Load FreeDOS and XMS-memory driver              >> c:\fdconfig.sys
  80. echo MENU 2 - Load FreeDOS without drivers                    >> c:\fdconfig.sys
  81. echo MENUDEFAULT=1,5                                          >> c:\fdconfig.sys
  82. echo %xmsline%                                                >> c:\fdconfig.sys
  83. echo 1?DOS=HIGH                                               >> c:\fdconfig.sys
  84. set step2=√
  85. for %%x in ( 80086 80186 80286 ) do if "%cputype%"=="%%x" goto infomenu
  86. goto step2a2
  87.  
  88. :step2a2
  89. rem install cdrom support (386+). . .
  90. set cdinfo=1?DEVICE=%fdosdir%\bin\atapicdd.sys /D:FDCD0001
  91. REM please uncomment the following line to allow setup to add cdrom support.
  92. REM strangely enough it crashes the combination of:
  93. REM kernel2030_32/fdXxms0.92/atapicdd0.2.10/ freecom 0.82pl2-xms-swap
  94.  
  95. REM for %%x in ( 1 2 3 4 5 6 7 8 9 0 ) do if exist FDCD000%%x goto step2a
  96.  
  97. REM no cdromdrivers loaded, so comment them out, but add anyway.
  98. set cdinfo=;%cdinfo%
  99. goto step2b
  100.  
  101. :step2a
  102. if NOT exist %fdosdir%\bin\atapicdd.sys set cdinfo=;%cdinfo%
  103. if "%scsidrvr%"=="" goto step2b
  104. rem copy and install non-atapi (ASPI?) drivers. AtapiCDD should be able to handle them!
  105. rem the device-path in config.sys needs to be corrected. I can't get the base filename!
  106. for %%x in ( %scsidrvr% ) do copy %%x %fdosdir%\bin
  107. for %%x in ( %scsidrvr% ) do echo ;1?DEVICE=%fdosdir%\bin\%%x >> c:\fdconfig.sys
  108. goto step2b
  109.  
  110. :step2b
  111. echo %cdinfo% >> c:\fdconfig.sys
  112. set cdinfo=
  113. goto infomenu
  114.  
  115. :step3
  116. cls
  117. REM ## IF NOT [%KEY%]==[none] set KEY=%fdosdir%\bin\key\%key%.key
  118. rem ## rem Xkeyb wants a base file to start with...
  119. rem ## if not [%KEY%]==[none] copy /y %fdosdir%\bin\key\pc437.key %fdosdir%\bin\pc437.key
  120. if "%GUI_inst%"=="true" goto step3a1
  121.  
  122. echo @echo off                                                 >  %fdosdir%\fdauto.bat
  123. echo set dircmd=/p/ogn                                        >> %fdosdir%\fdauto.bat
  124. echo IF EXIST %fdosdir%\bin\mouse.exe %fdosdir%\bin\mouse.exe >> %fdosdir%\fdauto.bat
  125. echo IF EXIST FDCD0001 %fdosdir%\bin\Shsucdx /D:FDCD0001      >> %fdosdir%\fdauto.bat
  126. echo set dosdir=%fdosdir%                                     >> %fdosdir%\fdauto.bat
  127. echo set path=C:\;%fdosdir%;%fdosdir%\bin                     >> %fdosdir%\fdauto.bat
  128. echo set NLSDIR=%fdosdir%\NLS                                 >> %fdosdir%\fdauto.bat
  129. goto step3a1
  130.  
  131. :step3a1
  132. echo set lang=%lang%                                          >> %fdosdir%\fdauto.bat
  133. echo set key=%key%                                            >> %fdosdir%\fdauto.bat
  134. if not exist c:\config.sys ren c:\fdconfig.sys config.sys
  135. set step3=√
  136. if exist c:\autoexec.bat goto infomenu
  137. copy %fdosdir%\fdauto.bat c:\autoexec.bat
  138. if exist c:\autoexec.bat del %fdosdir%\fdauto.bat
  139. goto infomenu
  140.  
  141.  
  142. :step4
  143. REM first determine which files were actually used. Later, set up nationalised stuff (FreeCOM, CTmouse)
  144. for %%x in ( c:\config.sys c:\fdconfig.sys ) do if exist %%x set cfgfile=%%x
  145. for %%x in ( c:\autoexec.bat %fdosdir%\fdauto.bat ) do if exist %%x set autofile=%%x
  146. echo 1?SHELL=%fdosdir%\BIN\CMDXSWP.COM /P=%autofile%          >> %cfgfile%
  147. echo 2?SHELL=%comfile% /P=%autofile%                          >> %cfgfile%
  148. if exist %fdosdir%\bin\key\%key% echo %fdosdir%\bin\keyb %fdosdir%\bin\key\%key% >> %autofile%
  149. echo echo BootFiles: %cfgfile%, %autofile%, %comfile%         >> %autofile%
  150. echo echo type HELP to get support on commands and navigation >> %autofile%
  151. echo echo.                                                    >> %autofile%
  152. echo echo Welcome to FreeDOS                                  >> %autofile%
  153. echo echo.                                                    >> %autofile%
  154. set step4=√
  155. CDD %fdosdir%\NLS
  156. if exist makecmd.bat call makecmd.bat
  157. if not exist command.com copy %comspec% command.com
  158. if not exist xmsswap.com copy command.com xmsswap.com
  159. set copycmd=/y
  160. copy command.com %comfile%
  161. copy xmsswap.com %fdosdir%\bin\cmdxswp.com
  162. if exist %fdosdir%\bin\ctmouse\ctm-%lang%.exe copy /y %fdosdir%\bin\ctmouse\ctm-%lang%.exe %fdosdir%\bin\ctmouse.exe
  163. cls
  164. set workdir=
  165. for %%x in ( "" "none" ) do if "%key%"==%%x goto infomenu
  166. for %%x in ( %fdosdir%\bin\key\*.kc ) do if not %%x==%fdosdir%\bin\key\%key% del %%x
  167. goto infomenu
  168.  
  169. :step5
  170. set step5=√
  171. if not exist %fdosdir%\bin\ctmouse.exe goto infomenu
  172. echo Trying to install mouse support (may hang your computer)
  173. ctty nul
  174. %fdosdir%\bin\ctmouse.exe
  175. if errorlevel 5 goto infomenu
  176. copy /y %fdosdir%\bin\ctmouse.exe %fdosdir%\bin\mouse.exe 
  177. if not exist c:\kernel.sys copy /y c:\fdkernel.sys c:\kernel.sys
  178. ctty con
  179. echo Mouse support succesfully installed!
  180. goto infomenu
  181.  
  182. :step6
  183. ctty con
  184. set step6=√
  185. alias boot=SYS %FDOSDIR% C: BOOTONLY
  186. call %cdrom%\freedos\setup\batch\finaltxt.bat
  187. set step1=
  188. set step2=
  189. set step3=
  190. set step4=
  191. set step5=
  192. set step6=
  193. goto end
  194.  
  195. :end
  196.