home *** CD-ROM | disk | FTP | other *** search
/ Science Adventure 2 with Isaac Asimov / SCIENCEV2.IMG / sci2 / setup.scr < prev    next >
Encoding:
Text File  |  1994-03-14  |  15.6 KB  |  618 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 soundVolume 100
  15. preset Printing Detect
  16. preset PrinterPort LPT1
  17. preset digitizedSound on
  18. preset music on
  19. preset zoomUseRealSound off
  20. rem Deal with power management for product.bat
  21. set _power "rem power.exe not detected"
  22. detect_power
  23. if %_1% = 1
  24.     set _power "power off"
  25. endif
  26. rem set default tsr lines for product.bat
  27. set _tsr "rem no special tsrs needed"
  28. set _tsr2 "rem no special tsr cleanup needed"
  29. rem Specify where all the text files used in setup live.
  30. set _text %hdroot%\inst%LANG%.txl
  31. rem
  32. err_handler %_text%\errhand.txt
  33. rem
  34. textbox 1 1 80 25 blue
  35. color back cyan
  36. getOpt -help
  37. if %_err% = 0
  38.     type %_text%\setuphlp.txt 3 2 77 15 -border -nocenter
  39.     waitkey
  40.     goto exit_unsaved
  41. endif
  42. type %_text%\setup.txt 3 2 77 6 -border
  43. color text yellow
  44. echo 6 6 70 1 -center "%title%"
  45. color text white
  46. rem ----------------- select card --------------------
  47. :card
  48. textbox 1 9 80 17 blue
  49. menu %_text%\sound.mnu 19 11 44 13 %_text%\sound.tit %_text%\updown.leg
  50. set soundDriver %_1%
  51. set musicDriver "%_2%"
  52. set musicType "%_3%"
  53. set soundDevice "%_4%"
  54. set _soundDevice2 "%_5%"
  55. if "%soundDevice%" eq -
  56.     set soundDevice "%_soundDevice2%"
  57. endif
  58. unset _dma
  59. unset _irq
  60. unset _ioPort
  61. textbox 1 9 80 16 blue
  62. rem set i/o port, etc.
  63. set _musicIoPort "%_ioPort%"
  64. switch %soundDriver%
  65. case escape:
  66.     goto exit_unsaved
  67. case sbdig.drv:
  68.     detect_soundBlaster
  69.     set _musicIoPort "%_ioPort%"
  70. case sbpdig.drv:
  71.     detect_soundBlaster
  72.     set _musicIoPort "%_ioPort%"
  73.     set soundVolume 80
  74. case sb16dig.drv:
  75.     detect_soundBlaster
  76.     rem above command now sets _musicIoPort, but it should only be used
  77.     rem with roland music, i.e. if user has waveblaster daughter card.
  78.     if %musicType% eq adl
  79.         set _musicIoPort "%_ioPort%"
  80.     endif
  81.     set soundVolume 80
  82. case pasdig.drv:
  83.     rem proaudio spectrum 16
  84.     rem detect settings from config.sys
  85.     detect_spectrum
  86.     set _sb_dma %_2%
  87.     rem if using 16 bit dma, punt and drop back to soundblaster emulation
  88.     rem is this right?
  89.     set _musicIoPort "%_ioPort%"
  90.     if %_dma% > 4
  91.         set soundDriver sbdig.drv
  92.         rem soundblaster emulation is normally dma channel 1
  93.         rem but use values detect_spectrum read from config.sys
  94.         detect_soundBlaster
  95.         set _dma %_sb_dma%
  96.         set _musicIoPort 388
  97.     endif
  98.     set soundVolume 70
  99. case default:
  100.     rem explicit defaults
  101. endswitch
  102. rem hard-code default music io port
  103. switch %musicDriver%
  104. case adlib.drv:
  105.     set _musicIoPort 388
  106. case adlibg.drv:
  107.     set _musicIoPort 388
  108. case roland.drv:
  109.     set _musicIoPort 330
  110.     type %_text%\roland.txt 10 10 60 10
  111.     waitkey
  112.     color back blue
  113.     textbox 10 10 60 10
  114. case default
  115.     rem normal case
  116. endswitch
  117. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  118. setMusicPort "%_musicIoPort%"
  119. if "%soundDevice%" eq none
  120.     set digitizedSound off
  121.     set music off
  122. endif
  123. if "%soundDriver%" eq .none
  124.     set digitizedSound off
  125. endif
  126. rem horrible kudge soon to be replaced with new column in sound.mnu
  127. rem changes from LK
  128. if "%soundDriver%" eq ADLIBDIG.DRV
  129.     set music off
  130. endif
  131. rem end changes
  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. if %_choice% eq escape
  369.     goto loop
  370. endif
  371. rem delete old copy of cache files, if any.  assume there are two caches.
  372. copy cache1 %hdroot% -dir -uncopy
  373. copy cache2 %hdroot% -dir -uncopy
  374. getdiskfree
  375. set _gotDisk %_1%
  376. if %_gotDisk% < %_needDisk%
  377.     beep
  378.     type %_text%\diskfre2.txt 10 15 60 8 -border
  379.     waitkey_noesc
  380.     switch %_1%
  381.     case escape:
  382.         goto exit_unsaved
  383.     case default:
  384.     endswitch
  385.     goto cache
  386. endif
  387. color back blue
  388. color text yellow
  389. type %_text%\copying3.txt 17 19 50 6 
  390. color back cyan
  391. color text white
  392. rem copy chosen set of quick access files
  393. copy cache%_choice% %hdroot% -dir
  394. copy cachex%_choice% %hdroot% -dir -expand
  395. :cache_done
  396. color back cyan
  397. rem ---------- check and modify config.sys ------------
  398. detect_files
  399. set _nfiles %_1%
  400. set _cfiles %_2%
  401. rem _nfiles is how many files could actually be opened when pictext.exe started
  402. rem _cfiles is the argument to FILES= in CONFIG.SYS
  403. rem _nfiles is often less than _cfiles
  404. set _needfiles 17
  405. set _setfiles 20
  406. if %_nfiles% >= %_needfiles%
  407.     goto files_done
  408. endif
  409. rem they don't have enough file handles.  Is it because of CONFIG.SYS?
  410. if %_cfiles% >= %_setfiles%
  411.     rem nope.  Don't offer to change CONFIG.SYS.
  412.     textbox 1 9 80 17 blue
  413.     beep 1
  414.     type %_text%\files2.txt 7 11 70 13 -border
  415.     waitkey
  416.     goto files_done
  417. endif
  418. rem Their CONFIG.SYS needs changing.
  419. :addfiles
  420.     textbox 1 9 80 17 blue
  421.     beep 2
  422.     type %_text%\files.txt 10 11 63 13 %_text%\files.tit %_text%\yesno.leg
  423.     waitkey_noesc
  424.     switch %_1%
  425.     case %yes%:
  426.         set_files %_setfiles%
  427.         beep
  428.         type %_text%\didfiles.txt 10 11 63 13 -border
  429.         waitkey_noesc
  430.     case %no%:
  431.         rem do nothing
  432.     case escape:
  433.         rem do nothing
  434.     case default:
  435.         goto addfiles
  436.     endswitch
  437.     textbox 1 9 80 17 blue
  438. :files_done
  439. rem ---------- check windows, set up icons, dma, and realsound driver ---------
  440. set _winWarning anykey.txt
  441. detect_windows_dir
  442. set _windir %_1%
  443. if %_windir% eq "none"
  444.     goto no_windows
  445. endif
  446. :do_windows
  447.     textbox 1 9 80 17 blue
  448.     beep 2
  449.     type %_text%\windows.txt 9 11 65 8 %_text%\windows.tit %_text%\yesno.leg
  450.     waitkey_noesc
  451.     switch %_1%
  452.     case %yes%:
  453.         rem copy files needed by windows code
  454.         copy kagroup.exe %_windir%\kagroup.exe
  455.         exist %_windir%\kagroup.inf
  456.         if %_1% = 0
  457.             copy %_text%\kagroup.hdr %_windir%\kagroup.inf -expand
  458.         endif
  459.         copy %_text%\kagroup.inf %_windir%\kagroup.inf -expand -append
  460.         rem when setting up windows, only load device driver if needed
  461.         rem perhaps this should be part of menu file rather than special
  462.         rem case code.
  463.         if "%soundDevice%" eq "PCSpeaker"
  464.             appendSlash _hdroots %hdroot%
  465.             setup_windows %_windir% %_HDRoots%vrsd.386
  466.         endif
  467.         if "%soundDevice%" ne "PCSpeaker"
  468.             setup_windows %_windir%
  469.         endif
  470.         textbox 1 9 80 17 blue
  471.         beep
  472.         type %_text%\windone.txt 10 11 63 11 -border
  473.         set _winWarning windone2.txt
  474.         waitkey
  475.     case %no%:
  476.         rem do nothing
  477.     case escape:
  478.         rem do nothing
  479.     case default:
  480.         goto do_windows
  481.     endswitch
  482. :no_windows
  483. rem ---------- check for ereg option ----------
  484. exist %hdroot%\ereg.on 
  485. if %_1% = 0
  486.     goto no_ereg
  487. endif
  488. :test_ereg
  489.     textbox 1 9 80 17 blue
  490.     beep 2
  491.     type %_text%\ereg.txt 9 11 65 11 %_text%\ereg.tit %_text%\yesno.leg
  492.     waitkey_noesc
  493.     switch %_1%
  494.     case %yes%:
  495.         rem fall through to ereg.
  496.     case %no%:
  497.         goto no_ereg
  498.     case escape:
  499.         goto no_ereg
  500.     case default:
  501.         goto test_ereg
  502.     endswitch
  503. rem On-line registration.
  504. textbox 1 1 80 25 blue
  505. color back cyan
  506. rem detect characteristics of user's system
  507. getDiskFree
  508. set Diskfree %_1%
  509. getMemFree
  510. set memfree %_1%
  511. detect_windows_dir
  512. set windows_dir %_1%
  513. detect_compressedDisk
  514. set compressed %_1%
  515. color back blue
  516. type %_text%\e_ereg.txt 5 22 70 4
  517. color back cyan
  518. set _next 0
  519. :ereg_loop
  520. menu %_text%\e_ereg.mnu 6 2 70 18 %_text%\e_ereg.tit %_text%\e_ereg.leg -default %_next% -anyKey
  521. set _choice %_1%
  522. set _next "%_2%"
  523. set _line "%_3%"
  524. switch %_choice% 
  525. case escape:
  526.     goto ereg_done
  527. case quit:
  528.     goto ereg_done
  529. case save:
  530.     saveconfig
  531.     goto ereg_register
  532. case default:
  533.     set_eval _val %%%_choice%%%
  534.     rem promptdir "%_val%" 5 19 60 6 %_text%\e_entry.tit %_text%\e_entry.txt -any
  535.     rem Prompt coordinates are tied closely to menu coordinates.
  536.     promptdir "%_val%" 36 %_line% 36 1 -any
  537.     if "%_1%" ne escape
  538.         set %_choice% "%_1%"
  539.     endif
  540.     rem textbox 5 19 52 7 blue
  541. endswitch
  542. goto ereg_loop
  543. :ereg_register
  544. rem second menu
  545. preset |prefix 1
  546. set _next 1
  547. :ereg_register_loop
  548. textbox 1 1 80 25 blue
  549. menu %_text%\e_dial.mnu 6 10 70 8 %_text%\e_dial.tit %_text%\e_dial.leg -default %_next%
  550. set _choice %_1%
  551. set _phone "%_2%"
  552. switch %_choice% 
  553. case escape:
  554.     goto ereg_done
  555. case quit:
  556.     goto ereg_done
  557. case |prefix:
  558.     set_eval _val %%%_choice%%%
  559.     rem Prompt coordinates are tied closely to menu coordinates.
  560.     textbox 1 1 80 25 blue
  561.     promptdir "%_val%" 20 10 40 6 %_text%\e_prefix.tit %_text%\e_prefix.leg
  562.     if "%_1%" ne escape
  563.         set %_choice% "%_1%"
  564.     endif
  565.     set _next 1
  566.     goto ereg_register_loop
  567. case toll:
  568. case tollfree:
  569. endswitch
  570. textbox 1 1 80 25 blue
  571. color back blue
  572. type %_text%\e_dialin.txt 12 5 54 5
  573. color back cyan
  574. register_via_modem %|prefix%%_phone%
  575. set _bad %_err%
  576. if %_bad% = 0
  577.     textbox 1 1 80 25 blue
  578.     type %_text%\e_done.txt 5 10 72 10 -border
  579. endif
  580. if %_bad% != 0
  581.     textbox 1 1 80 25 blue
  582.     type %_text%\e_err.txt 5 10 72 10 -border
  583. endif
  584. waitkey_noesc
  585. :ereg_done
  586. :no_ereg
  587. rem ---------- all done.  print trailer messages. ----------
  588. color back black
  589. color text white
  590. textbox 1 1 80 25 black
  591. type %_text%\done.txt 1 1 80 15
  592. if "%soundDevice%" eq "Digispeech Portable Sound Plus"
  593.     type %_text%\bmaster.txt 1 16 80 4
  594. endif
  595. if "%soundDevice%" eq "Aria Synthesizer Sound Card"
  596.     type %_text%\aria.txt 1 16 80 4
  597. endif
  598. getenv windir
  599. if "%_1%" ne "" 
  600.     beep
  601.     type %_text%\%_winWarning% 1 21 80 4
  602.     rem pause if their window might go away...
  603.     waitkey
  604.     set _waited 1
  605. endif
  606. rem Since this product's install is invoked by a shell, and 
  607. rem Larry wants it to loop, pause so the final message doesn't
  608. rem get obliterated.  Should only do this if invoked by install.
  609. if "%_waited%" ne 1
  610.     type %_text%\anykey.txt 1 21 80 4
  611.     waitkey
  612. endif
  613. goto final_exit
  614. :exit_unsaved
  615. textbox 1 1 80 25 black
  616. :final_exit
  617. ___ENDSCRIPT___
  618.