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