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