home *** CD-ROM | disk | FTP | other *** search
/ SPEED / SPEED16_09.iso / speed / setup.scr < prev    next >
Text File  |  1994-02-25  |  14KB  |  519 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. preset zoomUseRealSound off
  19. rem Deal with power management for product.bat
  20. set _power "rem power.exe not detected"
  21. detect_power
  22. if %_1% = 1
  23.     set _power "power off"
  24. endif
  25. rem set default tsr lines for product.bat
  26. set _tsr "rem no special tsrs needed"
  27. set _tsr2 "rem no special tsr cleanup needed"
  28. rem Specify where all the text files used in setup live.
  29. set _text %hdroot%\inst%LANG%.txl
  30. rem
  31. err_handler %_text%\errhand.txt
  32. rem
  33. textbox 1 1 80 25 blue
  34. color back cyan
  35. getOpt -help
  36. if %_err% = 0
  37.     type %_text%\setuphlp.txt 3 2 77 15 -border -nocenter
  38.     waitkey
  39.     goto exit_unsaved
  40. endif
  41. type %_text%\setup.txt 3 2 77 6 -border
  42. color text yellow
  43. echo 6 6 70 1 -center "%title%"
  44. color text white
  45. rem ----------------- select card --------------------
  46. :card
  47. textbox 1 9 80 17 blue
  48. menu %_text%\sound.mnu 19 11 44 7 %_text%\sound.tit %_text%\updown.leg
  49. set soundDriver %_1%
  50. set musicDriver "%_2%"
  51. set musicType "%_3%"
  52. set soundDevice "%_4%"
  53. set _soundDevice2 "%_5%"
  54. if "%soundDevice%" eq -
  55.     set soundDevice "%_soundDevice2%"
  56. endif
  57. unset _dma
  58. unset _irq
  59. unset _ioPort
  60. textbox 1 9 80 16 blue
  61. rem set i/o port, etc.
  62. set _musicIoPort "%_ioPort%"
  63. switch %soundDriver%
  64. case escape:
  65.     goto exit_unsaved
  66. case sbdig.drv:
  67.     detect_soundBlaster
  68.     set _musicIoPort "%_ioPort%"
  69. case sbpdig.drv:
  70.     detect_soundBlaster
  71.     set _musicIoPort "%_ioPort%"
  72. case sb16dig.drv:
  73.     detect_soundBlaster
  74.     rem above command now sets _musicIoPort, but it should only be used
  75.     rem with roland music, i.e. if user has waveblaster daughter card.
  76.     if %musicType% eq adl
  77.         set _musicIoPort "%_ioPort%"
  78.     endif
  79. case pasdig.drv:
  80.     rem proaudio spectrum 16
  81.     rem detect settings from config.sys
  82.     detect_spectrum
  83.     set _sb_dma %_2%
  84.     rem if using 16 bit dma, punt and drop back to soundblaster emulation
  85.     rem is this right?
  86.     set _musicIoPort "%_ioPort%"
  87.     if %_dma% > 4
  88.         set soundDriver sbdig.drv
  89.         rem soundblaster emulation is normally dma channel 1
  90.         rem but use values detect_spectrum read from config.sys
  91.         detect_soundBlaster
  92.         set _dma %_sb_dma%
  93.         set _musicIoPort 388
  94.     endif
  95. case default:
  96.     rem explicit defaults
  97. endswitch
  98. rem hard-code default music io port
  99. switch %musicDriver%
  100. case adlib.drv:
  101.     set _musicIoPort 388
  102. case adlibg.drv:
  103.     set _musicIoPort 388
  104. case roland.drv:
  105.     rem Golly, doesn't detect_soundBlaster do this right yet?
  106.     rem set _musicIoPort 330
  107. case default
  108.     rem normal case
  109. endswitch
  110. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  111. setMusicPort "%_musicIoPort%"
  112. if "%soundDevice%" eq none
  113.     set digitizedSound off
  114.     set music off
  115. endif
  116. if "%soundDriver%" eq .none
  117.     set digitizedSound off
  118. endif
  119. if "%musicDriver%" eq .none
  120.     set music off
  121. endif
  122. rem clear dma if it's set to the default
  123. if "%_dma%" = -1
  124.     unset _dma 
  125. endif
  126. color back white
  127. color text black
  128. textbox 1 25 80 1
  129. type %_text%\settings.txt 1 25 80 1
  130. color back cyan
  131. color text white
  132. rem ----------------- prepend driver path -----------------
  133. set _nakedSoundDriver %soundDriver%
  134. appendSlash _cdroots %cdroot%
  135. switch %soundDriver% 
  136. rem these three are pseudo drivers and dont really exist
  137. case .none:
  138. case .internal:
  139. case sb16dig.drv:
  140. rem all others are real
  141. case default:
  142.     set soundDriver %_CDroots%drivers\%soundDriver%
  143.     exist %soundDriver%
  144.     if %_1% eq 0
  145.         rem driver does not exist
  146.         beep
  147.         type %_text%\sounderr.txt 10 10 60 9 -Border
  148.         waitkey 
  149.         unset _soundDevice2
  150.         goto card
  151.     endif
  152. endswitch
  153. switch %musicDriver% 
  154. rem these three are pseudo drivers and dont really exist
  155. case .none:
  156. rem all others are real
  157. case default:
  158.     set musicDriver %_CDroots%drivers\%musicDriver%
  159.     exist %musicDriver%
  160.     if %_1% eq 0
  161.         rem driver does not exist
  162.         beep
  163.         type %_text%\sounderr.txt 10 10 60 9 -Border
  164.         waitkey 
  165.         unset _soundDevice2
  166.         goto card
  167.     endif
  168. endswitch
  169. rem ----------------- note any tsr's needed for this card -------------
  170. switch %_nakedSoundDriver%
  171. case gravisdg.drv:
  172.     rem gravis ultrasound
  173.     set _tsr "ultrasnd.exe -c -d %HDroot%"
  174.     set _tsr2 "ultrasnd.exe -f"
  175.     if %CDroot% ne %HDroot%
  176.         copy ultramid.ini
  177.         copy ultrasnd.exe
  178.     endif
  179. case default:
  180. endswitch
  181. rem ----------------- auto music & sound -----------------
  182. rem Automatically play music and sound unless ? option is given on
  183. rem command line
  184. getOpt ?
  185. if %_err% = 0
  186.     goto loop
  187. endif
  188. rem getenv's argument is case sensitive; usually always uppercase,
  189. rem but windir is lowercase.  That way you can't set it from commandline!
  190. getenv windir
  191. if "%_1%" ne "" 
  192.     rem by golly they're in windows;
  193.     rem don't use the PC Speaker because the driver isn't installed yet
  194.     switch %soundDevice%
  195.     case PCspeaker:
  196.         goto autoMusicTest
  197.     case default:
  198.     endswitch
  199. endif
  200. if %digitizedSound% ne off
  201.     color back blue
  202.     color text yellow blink
  203.     type %_text%\psound.txt 20 20 40 1 
  204.     color text white
  205.     type %_text%\playing.txt 5 21 70 4 
  206.     rem show them which menu item would have gotten them here, more or less.
  207.     color back cyan
  208.     menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 0 -showOnly
  209.     sound knowledg.voc
  210. endif
  211. :autoMusicTest
  212. if %musicType% ne none
  213.     color back blue
  214.     color text yellow blink
  215.     type %_text%\pmusic.txt 20 20 40 1 
  216.     color text white
  217.     type %_text%\playing.txt 5 21 70 4
  218.     rem show them which menu item would have gotten them here, more or less.
  219.     color back cyan
  220.     menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 1 -showOnly
  221.     music kalogo.%musicType%
  222. endif
  223. rem default after automatic test is to save and exit
  224. set _mainDef 4
  225. textbox 5 20 70 5 blue 
  226. goto loop_noclear
  227. :loop
  228. rem ----------------- select function --------------------
  229. textbox 1 9 80 16 blue
  230. :loop_noclear
  231. color back white
  232. color text black
  233. textbox 1 25 80 1
  234. type %_text%\settings.txt 1 25 80 1
  235. color back cyan
  236. color text white
  237. menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default %_mainDef%
  238. set _mainDef 0
  239. switch %_1%
  240. case exit:
  241.     goto exit
  242. case escape:
  243.     goto card
  244. case card:
  245.     goto card
  246. case music:
  247.     if %musicType% ne none
  248.         color back blue
  249.         color text yellow blink
  250.         type %_text%\pmusic.txt 20 20 40 1 
  251.         color text white
  252.         type %_text%\playing.txt 5 21 70 4
  253.         music kalogo.%musicType%
  254.     endif
  255. case sound:
  256.     if %soundDriver% ne .none
  257.         color back blue
  258.         color text yellow blink
  259.         type %_text%\psound.txt 20 20 40 1 
  260.         color text white
  261.         type %_text%\playing.txt 5 21 70 4
  262.         sound knowledg.voc
  263.     endif
  264. case settings:
  265.     goto settings
  266. endswitch
  267. goto loop
  268. rem
  269. rem ----------------- select i/o adr --------------------
  270. :settings
  271. textbox 1 9 80 16 blue
  272. menu %_text%\io.mnu 19 11 44 12 %_text%\io.tit %_text%\updown.leg
  273. textbox 1 9 80 16 blue
  274. if %_1% eq escape
  275.     goto loop
  276. endif
  277. set _ioPort %_1%
  278. color back white
  279. color text black
  280. textbox 1 25 80 1
  281. type %_text%\settings.txt 1 25 80 1
  282. color back cyan
  283. color text white
  284. rem
  285. rem ----------------- select IRQ --------------------
  286. textbox 1 9 80 16 blue
  287. menu %_text%\irq.mnu 19 11 44 12 %_text%\irq.tit %_text%\updown.leg
  288. textbox 1 9 80 16 blue
  289. if %_1% eq escape
  290.     goto loop
  291. endif
  292. set _irq %_1%
  293. color back white
  294. color text black
  295. textbox 1 25 80 1
  296. type %_text%\settings.txt 1 25 80 1
  297. color back cyan
  298. color text white
  299. rem
  300. rem ----------------- select DMA --------------------
  301. textbox 1 9 80 16 blue
  302. menu %_text%\dma.mnu 19 11 44 10 %_text%\dma.tit %_text%\updown.leg
  303. textbox 1 9 80 16 blue
  304. if %_1% eq escape
  305.     goto loop
  306. endif
  307. set _dma %_1%
  308. rem Do we need to handle the PAS16-as-SB kluge again here?  How could we tell?
  309. set _musicIoPort "%_ioPort%"
  310. rem ----- select done ----
  311. rem copy temporary settings (_ioPort, etc.) into real settings (SoundDevParams, etc).
  312. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  313. setMusicPort "%_musicIoPort%"
  314. goto loop
  315. rem
  316. :exit
  317. rem ---------- set up sound files ---------
  318. saveconfig
  319. rem this section will change for each product!
  320. rem copy the music archive for each zoomscape and kav.
  321. exist ka.%musicType%
  322. if %_1% = 0
  323.     goto no_music_archive
  324. endif
  325. if %musicType% ne none
  326.     textbox 1 9 80 17 blue
  327.     color back blue
  328.     color text yellow
  329.     type %_text%\copying4.txt 1 15 80 1 
  330.     color back cyan
  331.     color text white
  332.     copy ka.%musicType% ka.mus
  333. endif
  334. :no_music_archive
  335. rem ---------- copy driver files -----------
  336. copy %_text%\product.bat %shortTitle%.bat -expand
  337. rem ---------- select how much to install -----------
  338. rem feeble attempt to make setup script sense whether subset archives exist.
  339. rem caution: cdrom burner refuses to create empty directories
  340. existdir %cdroot%\cachex1
  341. if %_1% = 0
  342.     goto cache_done
  343. endif
  344. :cache
  345. textbox 1 9 80 17 blue
  346. beep 2
  347. type %_text%\cache.txt 6 18 68 6 -border
  348. menu %_text%\cache.mnu 19 10 44 6 %_text%\cache.tit %_text%\updown.leg
  349. textbox 1 9 80 17 blue
  350. set _choice %_1%
  351. set _needDisk "%_2%"
  352. if %_choice% eq escape
  353.     goto loop
  354. endif
  355. rem delete old copy of cache files, if any.  assume there are two caches.
  356. copy cache1 %hdroot% -dir -uncopy
  357. copy cache2 %hdroot% -dir -uncopy
  358. getdiskfree
  359. set _gotDisk %_1%
  360. if %_gotDisk% < %_needDisk%
  361.     beep
  362.     type %_text%\diskfre2.txt 10 15 60 8 -border
  363.     waitkey_noesc
  364.     switch %_1%
  365.     case escape:
  366.         goto exit_unsaved
  367.     case default:
  368.     endswitch
  369.     goto cache
  370. endif
  371. color back blue
  372. color text yellow
  373. type %_text%\copying3.txt 17 19 50 6 
  374. color back cyan
  375. color text white
  376. rem copy chosen set of quick access files
  377. copy cache%_choice% %hdroot% -dir
  378. copy cachex%_choice% %hdroot% -dir -expand
  379. :cache_done
  380. color back cyan
  381. rem ---------- check and modify config.sys ------------
  382. detect_files
  383. set _nfiles %_1%
  384. set _cfiles %_2%
  385. rem _nfiles is how many files could actually be opened when pictext.exe started
  386. rem _cfiles is the argument to FILES= in CONFIG.SYS
  387. rem _nfiles is often less than _cfiles
  388. set _needfiles 17
  389. set _setfiles 20
  390. if %_nfiles% >= %_needfiles%
  391.     goto files_done
  392. endif
  393. rem they don't have enough file handles.  Is it because of CONFIG.SYS?
  394. if %_cfiles% >= %_setfiles%
  395.     rem nope.  Don't offer to change CONFIG.SYS.
  396.     textbox 1 9 80 17 blue
  397.     beep 1
  398.     type %_text%\files2.txt 7 11 70 13 -border
  399.     waitkey
  400.     goto files_done
  401. endif
  402. rem Their CONFIG.SYS needs changing.
  403. :addfiles
  404.     textbox 1 9 80 17 blue
  405.     beep 2
  406.     type %_text%\files.txt 10 11 63 13 %_text%\files.tit %_text%\yesno.leg
  407.     waitkey_noesc
  408.     switch %_1%
  409.     case %yes%:
  410.         set_files %_setfiles%
  411.         beep
  412.         type %_text%\didfiles.txt 10 11 63 13 -border
  413.         waitkey_noesc
  414.     case %no%:
  415.         rem do nothing
  416.     case escape:
  417.         rem do nothing
  418.     case default:
  419.         goto addfiles
  420.     endswitch
  421.     textbox 1 9 80 17 blue
  422. :files_done
  423. rem ---------- check windows, set up icons, dma, and realsound driver ---------
  424. set _winWarning anykey.txt
  425. detect_windows_dir
  426. set _windir %_1%
  427. if %_windir% eq "none"
  428.     goto no_windows
  429. endif
  430. :do_windows
  431.     textbox 1 9 80 17 blue
  432.     beep 2
  433.     type %_text%\windows.txt 9 11 65 8 %_text%\windows.tit %_text%\yesno.leg
  434.     waitkey_noesc
  435.     switch %_1%
  436.     case %yes%:
  437.         rem copy files needed by windows code
  438.         copy kagroup.exe %_windir%\kagroup.exe
  439.         exist %_windir%\kagroup.inf
  440.         if %_1% = 0
  441.             copy %_text%\kagroup.hdr %_windir%\kagroup.inf -expand
  442.         endif
  443.         copy %_text%\kagroup.inf %_windir%\kagroup.inf -expand -append
  444.         rem when setting up windows, only load device driver if needed
  445.         rem perhaps this should be part of menu file rather than special
  446.         rem case code.
  447.         if "%soundDevice%" eq "PCSpeaker"
  448.             appendSlash _hdroots %hdroot%
  449.             setup_windows %_windir% %_HDRoots%vrsd.386
  450.         endif
  451.         if "%soundDevice%" ne "PCSpeaker"
  452.             setup_windows %_windir%
  453.         endif
  454.         textbox 1 9 80 17 blue
  455.         beep
  456.         type %_text%\windone.txt 10 11 63 11 -border
  457.         set _winWarning windone2.txt
  458.         waitkey
  459.     case %no%:
  460.         rem do nothing
  461.     case escape:
  462.         rem do nothing
  463.     case default:
  464.         goto do_windows
  465.     endswitch
  466. :no_windows
  467. rem ---------- check for ereg option ----------
  468. exist %hdroot%\ereg.exe 
  469. if %_1% = 0
  470.     goto no_ereg
  471. endif
  472. :do_ereg
  473.     textbox 1 9 80 17 blue
  474.     beep 2
  475.     type %_text%\ereg.txt 9 11 65 11 %_text%\ereg.tit %_text%\yesno.leg
  476.     waitkey_noesc
  477.     switch %_1%
  478.     case %yes%:
  479.         spawn ereg
  480.     case %no%:
  481.         rem do nothing
  482.     case escape:
  483.         rem do nothing
  484.     case default:
  485.         goto do_ereg
  486.     endswitch
  487. :no_ereg
  488. rem ---------- all done.  print trailer messages. ----------
  489. color back black
  490. color text white
  491. textbox 1 1 80 25 black
  492. type %_text%\done.txt 1 1 80 15
  493. if "%soundDevice%" eq "Digispeech Portable Sound Plus"
  494.     type %_text%\bmaster.txt 1 16 80 4
  495. endif
  496. rem if "%soundDevice%" eq "Aria Synthesizer Sound Card"
  497. rem     type %_text%\aria.txt 1 16 80 4
  498. rem endif
  499. getenv windir
  500. if "%_1%" ne "" 
  501.     beep
  502.     type %_text%\%_winWarning% 1 21 80 4
  503.     rem pause if their window might go away...
  504.     waitkey
  505.     set _waited 1
  506. endif
  507. rem Since this product's install is invoked by a shell, and 
  508. rem Larry wants it to loop, pause so the final message doesn't
  509. rem get obliterated.  Should only do this if invoked by install.
  510. if "%_waited%" ne 1
  511.     type %_text%\anykey.txt 1 21 80 4
  512.     waitkey
  513. endif
  514. goto final_exit
  515. :exit_unsaved
  516. textbox 1 1 80 25 black
  517. :final_exit
  518. ___ENDSCRIPT___
  519.