home *** CD-ROM | disk | FTP | other *** search
/ SPEED / SPEED16_09.iso / d / setup.scr < prev    next >
Text File  |  1994-01-12  |  12KB  |  449 lines

  1. rem we are already in the destination directory,
  2. rem and ka.cnf points to the drive and directory we were installed from
  3. indestdir
  4. rem Make drive letter variables for the benefit of batch files launched by kav
  5. getDriveLetter %CDroot%
  6. set CDdrive %_1%
  7. getDriveLetter %HDroot%
  8. set HDdrive %_1%
  9. rem set default values for a few things
  10. preset AutoMovie on
  11. preset mouseSensitivity 50
  12. preset ExtraMemory Automatic
  13. preset musicVolume 70
  14. preset Printing Detect
  15. preset PrinterPort LPT1
  16. preset digitizedSound on
  17. preset music on
  18. rem set default tsr lines for product.bat
  19. set _tsr "rem no special tsrs needed"
  20. set _tsr2 "rem no special tsr cleanup needed"
  21. rem Specify where all the text files used in setup live.
  22. set _text %hdroot%\inst%LANG%.txl
  23. rem
  24. err_handler %_text%\errhand.txt
  25. rem
  26. textbox 1 1 80 25 blue
  27. color back cyan
  28. getOpt -help
  29. if %_err% = 0
  30.     type %_text%\setuphlp.txt 3 2 77 15 -border -nocenter
  31.     waitkey
  32.     goto exit_unsaved
  33. endif
  34. type %_text%\setup.txt 3 2 77 6 -border
  35. color text yellow
  36. echo 6 6 70 1 -center "%title%"
  37. color text white
  38. rem ----------------- select card --------------------
  39. :card
  40. textbox 1 9 80 17 blue
  41. menu %_text%\sound.mnu 19 11 44 13 %_text%\sound.tit %_text%\updown.leg
  42. set soundDriver %_1%
  43. set musicDriver %_2%
  44. set musicType "%_3%"
  45. set soundDevice "%_4%"
  46. set _soundDevice2 "%_5%"
  47. if "%soundDevice%" eq -
  48.     set soundDevice "%_soundDevice2%"
  49. endif
  50. unset _dma
  51. unset _irq
  52. unset _ioPort
  53. textbox 1 9 80 16 blue
  54. rem set i/o port, etc.
  55. switch %_1%
  56. case escape:
  57.     goto exit_unsaved
  58. case sbdig.drv:
  59.     detect_soundBlaster
  60. case sbpdig.drv:
  61.     detect_soundBlaster
  62. case pasdig.drv:
  63.     rem proaudio spectrum 16
  64.     rem detect settings from config.sys
  65.     detect_spectrum
  66.     set _sb_dma %_2%
  67.     rem if using 16 bit dma, punt and drop back to soundblaster emulation
  68.     if %_dma% > 4
  69.         set soundDriver sbdig.drv
  70.         rem soundblaster emulation is normally dma channel 1
  71.         rem but use values detect_spectrum read from config.sys
  72.         detect_soundBlaster
  73.         set _dma %_sb_dma%
  74.     endif
  75. case default:
  76.     rem explicit defaults
  77. endswitch
  78. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  79. setMusicPort "%_ioPort%"
  80. rem Special for demo
  81. set port %_ioPort%
  82. set irq %_irq%
  83. set dma %_dma%
  84. set musicPort %_ioPort%
  85. if "%soundDevice%" eq none
  86.     set digitizedSound off
  87.     set music off
  88. endif
  89. rem clear dma if it's set to the default
  90. if "%_dma%" = -1
  91.     unset _dma 
  92. endif
  93. color back white
  94. color text black
  95. textbox 1 25 80 1
  96. type %_text%\settings.txt 1 25 80 1
  97. color back cyan
  98. color text white
  99. rem ----------------- prepend driver path -----------------
  100. set _nakedSoundDriver %soundDriver%
  101. appendSlash _cdroots %cdroot%
  102. if %soundDriver% ne none
  103.     set soundDriver %_CDroots%drivers\%soundDriver%
  104.     exist %soundDriver%
  105.     switch %_1%
  106.     case 0:
  107.         rem driver does not exist
  108.         beep
  109.         type %_text%\sounderr.txt 10 10 60 9 -Border
  110.         waitkey 
  111.         unset _soundDevice2
  112.         goto card
  113.     case default:
  114.     endswitch
  115. endif
  116. if %musicDriver% ne none
  117.     set musicDriver %_CDroots%drivers\%musicDriver%
  118.     exist %musicDriver%
  119.     switch %_1%
  120.     case 0:
  121.         rem driver does not exist
  122.         beep
  123.         type %_text%\sounderr.txt 10 10 60 9 -Border
  124.         waitkey 
  125.         unset _soundDevice2
  126.         goto card
  127.     case default:
  128.     endswitch
  129. endif
  130. rem ----------------- note any tsr's needed for this card -------------
  131. switch %_nakedSoundDriver%
  132. case gravisdg.drv:
  133.     rem gravis ultrasound
  134.     set _tsr "ultrasnd.exe -c -m100 -d %HDroot%"
  135.     set _tsr2 "ultrasnd.exe -f"
  136.     if %CDroot% ne %HDroot%
  137.         copy ultramid.ini
  138.         copy ultrasnd.exe
  139.     endif
  140. case default:
  141. endswitch
  142. rem ----------------- auto music & sound -----------------
  143. rem Automatically play music and sound unless ? option is given on
  144. rem command line
  145. getOpt ?
  146. if %_err% = 0
  147.     goto loop
  148. endif
  149. rem getenv's argument is case sensitive; usually always uppercase,
  150. rem but windir is lowercase.  That way you can't set it from commandline!
  151. getenv windir
  152. if "%_1%" ne "" 
  153.     rem by golly they're in windows;
  154.     rem don't use the PC Speaker because the driver isn't installed yet
  155.     switch %soundDevice%
  156.     case PCspeaker:
  157.         goto autoMusicTest
  158.     case default:
  159.     endswitch
  160. endif
  161. if %digitizedSound% ne off
  162.     color back blue
  163.     color text yellow blink
  164.     type %_text%\psound.txt 20 20 40 1 
  165.     color text white
  166.     type %_text%\playing.txt 5 21 70 4 
  167.     rem show them which menu item would have gotten them here, more or less.
  168.     color back cyan
  169.     menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 0 -showOnly
  170.     sound knowledg.voc
  171. endif
  172. :autoMusicTest
  173. if %musicType% ne none
  174.     color back blue
  175.     color text yellow blink
  176.     type %_text%\pmusic.txt 20 20 40 1 
  177.     color text white
  178.     type %_text%\playing.txt 5 21 70 4
  179.     rem show them which menu item would have gotten them here, more or less.
  180.     color back cyan
  181.     menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 1 -showOnly
  182.     music kalogo.%musicType%
  183. endif
  184. rem default after automatic test is to save and exit
  185. set _mainDef 4
  186. textbox 5 20 70 5 blue 
  187. goto loop_noclear
  188. :loop
  189. rem ----------------- select function --------------------
  190. textbox 1 9 80 16 blue
  191. :loop_noclear
  192. color back white
  193. color text black
  194. textbox 1 25 80 1
  195. type %_text%\settings.txt 1 25 80 1
  196. color back cyan
  197. color text white
  198. menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default %_mainDef%
  199. set _mainDef 0
  200. switch %_1%
  201. case exit:
  202.     goto exit
  203. case escape:
  204.     goto card
  205. case card:
  206.     goto card
  207. case music:
  208.     if %musicType% ne none
  209.         color back blue
  210.         color text yellow blink
  211.         type %_text%\pmusic.txt 20 20 40 1 
  212.         color text white
  213.         type %_text%\playing.txt 5 21 70 4
  214.         music kalogo.%musicType%
  215.     endif
  216. case sound:
  217.     if %soundDriver% ne none
  218.         color back blue
  219.         color text yellow blink
  220.         type %_text%\psound.txt 20 20 40 1 
  221.         color text white
  222.         type %_text%\playing.txt 5 21 70 4
  223.         sound knowledg.voc
  224.     endif
  225. case settings:
  226.     goto settings
  227. endswitch
  228. goto loop
  229. rem
  230. rem ----------------- select i/o adr --------------------
  231. :settings
  232. textbox 1 9 80 16 blue
  233. menu %_text%\io.mnu 19 11 44 12 %_text%\io.tit %_text%\updown.leg
  234. textbox 1 9 80 16 blue
  235. if %_1% eq escape
  236.     goto loop
  237. endif
  238. set _ioPort %_1%
  239. color back white
  240. color text black
  241. textbox 1 25 80 1
  242. type %_text%\settings.txt 1 25 80 1
  243. color back cyan
  244. color text white
  245. rem
  246. rem ----------------- select IRQ --------------------
  247. textbox 1 9 80 16 blue
  248. menu %_text%\irq.mnu 19 11 44 12 %_text%\irq.tit %_text%\updown.leg
  249. textbox 1 9 80 16 blue
  250. if %_1% eq escape
  251.     goto loop
  252. endif
  253. set _irq %_1%
  254. color back white
  255. color text black
  256. textbox 1 25 80 1
  257. type %_text%\settings.txt 1 25 80 1
  258. color back cyan
  259. color text white
  260. rem
  261. rem ----------------- select DMA --------------------
  262. textbox 1 9 80 16 blue
  263. menu %_text%\dma.mnu 19 11 44 10 %_text%\dma.tit %_text%\updown.leg
  264. textbox 1 9 80 16 blue
  265. if %_1% eq escape
  266.     goto loop
  267. endif
  268. set _dma %_1%
  269. rem ----- select done ----
  270. rem copy temporary settings (_ioPort, etc.) into real settings (SoundDevParams, etc).
  271. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  272. setMusicPort "%_ioPort%"
  273. goto loop
  274. rem
  275. :exit
  276. rem ---------- set up sound files ---------
  277. saveconfig
  278. rem this section will change for each product!
  279. rem copy the music archive for each zoomscape and kav.
  280. if %musicType% ne none
  281.     textbox 1 9 80 17 blue
  282.     color back blue
  283.     color text yellow
  284.     type %_text%\copying4.txt 1 15 80 1 
  285.     color back cyan
  286.     color text white
  287.     rem copy ka.%musicType% ka.mus
  288. endif
  289. rem ---------- copy driver files -----------
  290. set _needCpu 486
  291. getCpuType
  292. set _gotCpu %_1%
  293. set _product demo486.bat
  294. if %_gotCpu% < %_needCpu%
  295.     set _product demo386.bat
  296. endif
  297. copy %_text%\%_product% %shortTitle%.bat -expand
  298. rem won't be needed once kav pays attention to soundDriver etc.
  299. if %soundDriver% ne none
  300.     copy %soundDriver% sound.drv
  301. endif
  302. if %soundDriver% eq none
  303.     rm sound.drv
  304. endif
  305. if %musicDriver% ne none
  306.     copy %musicDriver% music.drv
  307. endif
  308. if %musicDriver% eq none
  309.     rm music.drv
  310. endif
  311. rem ---------- select how much to install -----------
  312. rem feeble attempt to make setup script sense whether subset archives exist.
  313. rem caution: cdrom burner refuses to create empty directories
  314. existdir %cdroot%\cachex1
  315. if %_1% = 0
  316.     goto cache_done
  317. endif
  318. :cache
  319. textbox 1 9 80 17 blue
  320. beep 2
  321. type %_text%\cache.txt 6 18 68 6 -border
  322. menu %_text%\cache.mnu 19 10 44 6 %_text%\cache.tit %_text%\updown.leg
  323. textbox 1 9 80 17 blue
  324. set _choice %_1%
  325. set _needDisk %_2%
  326. if %_choice% eq escape
  327.     goto loop
  328. endif
  329. rem delete old copy of cache files, if any.  assume there are two caches.
  330. copy cache1 %hdroot% -dir -uncopy
  331. copy cache2 %hdroot% -dir -uncopy
  332. getdiskfree
  333. set _gotDisk %_1%
  334. if %_gotDisk% < %_needDisk%
  335.     beep
  336.     type %_text%\diskfre2.txt 17 19 50 6 -border
  337.     waitkey
  338.     goto cache
  339. endif
  340. color back blue
  341. color text yellow
  342. type %_text%\copying3.txt 17 19 50 6 
  343. color back cyan
  344. color text white
  345. rem copy chosen set of quick access files
  346. copy cache%_choice% %hdroot% -dir
  347. copy cachex%_choice% %hdroot% -dir -expand
  348. :cache_done
  349. color back cyan
  350. rem ---------- check and modify config.sys ------------
  351. detect_files
  352. set _nfiles %_1%
  353. rem detect_files actually opens files, so it may disagree with config.sys
  354. rem always use files=20, but check for 17 open files
  355. set _needfiles 17
  356. set _setfiles 20
  357. if %_nfiles% < %_needfiles%
  358. :addfiles
  359.     textbox 1 9 80 17 blue
  360.     beep 2
  361.     type %_text%\files.txt 10 11 63 13 %_text%\files.tit %_text%\yesno.leg
  362.     waitkey_noesc
  363.     switch %_1%
  364.     case %yes%:
  365.         set_files %_setfiles%
  366.         beep
  367.         type %_text%\didfiles.txt 10 11 63 13 -border
  368.         waitkey_noesc
  369.     case %no%:
  370.         rem do nothing
  371.     case escape:
  372.         rem do nothing
  373.     case default:
  374.         goto addfiles
  375.     endswitch
  376.     textbox 1 9 80 17 blue
  377. endif
  378. rem ---------- check windows, set up icons, dma, and realsound driver ---------
  379. set _winWarning anykey.txt
  380. detect_windows_dir
  381. set _windir %_1%
  382. if %_windir% eq "none"
  383.     goto no_windows
  384. endif
  385. :do_windows
  386.     textbox 1 9 80 17 blue
  387.     beep 2
  388.     type %_text%\windows.txt 9 11 65 8 %_text%\windows.tit %_text%\yesno.leg
  389.     waitkey_noesc
  390.     switch %_1%
  391.     case %yes%:
  392.         rem copy files needed by windows code
  393.         copy kagroup.exe %_windir%\kagroup.exe
  394.         exist %_windir%\kagroup.inf
  395.         if %_1% = 0
  396.             copy %_text%\kagroup.hdr %_windir%\kagroup.inf -expand
  397.         endif
  398.         copy %_text%\kagroup.inf %_windir%\kagroup.inf -expand -append
  399.         rem when setting up windows, only load device driver if needed
  400.         rem perhaps this should be part of menu file rather than special
  401.         rem case code.
  402.         if "%soundDevice%" eq "PCSpeaker"
  403.             appendSlash _hdroots %hdroot%
  404.             setup_windows %_windir% %_HDRoots%vrsd.386
  405.         endif
  406.         if "%soundDevice%" ne "PCSpeaker"
  407.             setup_windows %_windir%
  408.         endif
  409.         textbox 1 9 80 17 blue
  410.         beep
  411.         type %_text%\windone.txt 10 11 63 11 -border
  412.         set _winWarning windone2.txt
  413.         waitkey
  414.     case %no%:
  415.         rem do nothing
  416.     case escape:
  417.         rem do nothing
  418.     case default:
  419.         goto do_windows
  420.     endswitch
  421. :no_windows
  422. color back black
  423. color text white
  424. textbox 1 1 80 25 black
  425. type %_text%\done.txt 1 1 80 15
  426. if "%soundDevice%" eq "Digispeech Portable Sound Plus"
  427.     type %_text%\bmaster.txt 1 16 80 4
  428. endif
  429. getenv windir
  430. if "%_1%" ne "" 
  431.     beep
  432.     type %_text%\%_winWarning% 1 21 80 4
  433.     rem pause if their window might go away...
  434.     waitkey
  435.     set _waited 1
  436. endif
  437. rem Since this product's install is invoked by a shell, and 
  438. rem Larry wants it to loop, pause so the final message doesn't
  439. rem get obliterated.  Should only do this if invoked by install.
  440. if "%_waited%" ne 1
  441.     type %_text%\anykey.txt 1 21 80 4
  442.     waitkey
  443. endif
  444. goto final_exit
  445. :exit_unsaved
  446. textbox 1 1 80 25 black
  447. :final_exit
  448. ___ENDSCRIPT___
  449.