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