home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 2 / CD-ROM_Today_-_The_Disc_2_June-July_1994.iso / bodydemo / setup.scr < prev    next >
Text File  |  1994-04-14  |  24KB  |  964 lines

  1. rem ____ Start Script ____
  2. rem we are already in the destination directory,
  3. rem and ka.cnf points to the drive and directory we were installed from
  4. indestdir
  5. rem Make drive letter variables for the benefit of batch files launched by kav
  6. getDriveLetter %CDroot%
  7. set CDdrive %_1%
  8. getDriveLetter %HDroot%
  9. set HDdrive %_1%
  10. rem set default values for a few things
  11. preset AutoMovie On
  12. preset mouseSensitivity 50
  13. preset ExtraMemory Automatic
  14. preset musicVolume 70
  15. preset soundVolume 80
  16. preset Printing Detect
  17. preset PrinterPort LPT1
  18. set digitizedSound On
  19. preset music On
  20. preset zoomUseRealSound Off
  21. getSoundPort _ioPort _irq _dma _drq
  22. getMusicPort _musicIo
  23. set _soundMenuHeight 14
  24. set _soundMenu sound.mnu
  25. exist %CDRoot%\drivers\algdig.drv
  26. if %_1% = 0
  27.     set _soundMenuHeight 10
  28.     set _soundMenu sound4.mnu
  29. endif
  30. rem Deal with power management for product.bat
  31. set _power "rem power.exe not detected"
  32. detect_power
  33. if %_1% = 1
  34.     set _power "power off"
  35. endif
  36. rem set default tsr lines for product.bat
  37. set _tsr "rem no special tsrs needed"
  38. set _tsr2 "rem no special tsr cleanup needed"
  39. rem Specify where all the text files used in setup live.
  40. set _text %hdroot%\inst%LANG%.txl
  41. rem
  42. err_handler %_text%\errhand.txt
  43. rem lk 12:35 3/27
  44. rem --------- Disallow setup if in Windows ---------
  45. rem getenv's argument is case sensitive; usually always uppercase,
  46. rem but windir is lowercase.  That way you can't set it from commandline!
  47. getenv windir
  48. if "%_1%" ne ""
  49.     rem by golly they're in windows;
  50.     textbox 1 1 80 25 blue
  51.     color back blue
  52.     beep 2
  53.     type %_text%\nowin.txt 10 11 60 7
  54.     waitkey_noesc
  55.     goto exit_unsaved
  56. endif
  57. rem lk 2:35 3/26 start
  58. rem This check is to see if the CDROM is in the caddy when you run setup
  59. rem because, if you don't you'll get a driver missing error.
  60. :checkCd
  61. existdir %CDRoot%\drivers
  62. if %_1% = 0
  63.     textbox 1 1 25 80 blue
  64.     color back blue
  65.     beep 1
  66.     type %_text%\nocd.txt 15 10 50 7 
  67.     waitKey_noEsc
  68.     switch "%_1%"
  69.     case escape:    
  70.         goto exit_unsaved
  71.     case default:
  72.     endswitch
  73.     color back cyan
  74.     goto checkCd
  75. endif
  76. rem lk 2:49 3/26 end
  77. rem
  78. textbox 1 1 80 25 blue
  79. color back cyan
  80. getOpt -help
  81. if %_err% = 0
  82.     type %_text%\setuphlp.txt 3 2 77 15 -border -nocenter
  83.     waitkey
  84.     goto exit_unsaved
  85. endif
  86. type %_text%\setup.txt 3 2 77 6 -border
  87. color text yellow
  88. echo 6 6 70 1 -center "%title%"
  89. color text white
  90. rem ----------------- select card --------------------
  91. :card
  92. textbox 1 9 80 17 blue
  93. rem menu %_text%\sound.mnu 20 10 44 14 %_text%\sound.tit %_text%\updown.leg
  94. menu %_text%\%_soundMenu% 20 10 44 %_soundMenuHeight% %_text%\sound.tit %_text%\updown.leg
  95. set soundDriver %_1%
  96. if %soundDriver% eq quit
  97.     goto exit_unsaved
  98. endif
  99. set musicDriver "%_2%"
  100. set musicType "%_3%"
  101. set music "%_4%"
  102. set soundDevice "%_5%"
  103. set _iomnu "%_6%"
  104. set _irqmnu "%_7%"
  105. set _dmamnu "%_8%"
  106. set _soundDevice2 "%_9%"
  107. if "%soundDevice%" eq -
  108.     set soundDevice "%_soundDevice2%"
  109. endif
  110. unset _dma
  111. unset _irq
  112. unset _ioPort
  113. textbox 1 9 80 16 blue
  114. rem set i/o port, etc.
  115. set _musicIo "%_ioPort%"
  116. set stopMovies On
  117. rem don't run sbtest if this is really a Reveal card
  118. switch %soundDevice%
  119. case SC400:
  120.     set _reveal "-noAuto"
  121. case SC600FM:
  122.     set _reveal "-noAuto"
  123. case SC600GM:
  124.     set _reveal "-noAuto"
  125. case SC600:
  126.     set _reveal "-noAuto"
  127. case default:
  128.     set _reveal ""
  129. endswitch
  130. switch %soundDriver%
  131. case escape:
  132.     goto exit_unsaved
  133. case algdig.drv:
  134.     set soundVolume 80
  135. case sbdig.drv:
  136.     detect_soundBlaster %_reveal%
  137.     set _musicIo "%_ioPort%"
  138. case sbpdig.drv:
  139.     detect_soundBlaster
  140.     set soundVolume 80
  141.     set _musicIo "%_ioPort%"
  142. case sb16dig.drv:
  143.     detect_soundBlaster
  144.     rem above command now sets _musicIo, but it should only be used
  145.     rem with roland music, i.e. if user has waveblaster daughter card.
  146.     if %musicType% eq adl
  147.         set _musicIo "%_ioPort%"
  148.     endif
  149.     rem Workaround for kav movie bug
  150.     if %musicType% eq rld
  151.         set stopMovies Off
  152.     endif
  153. case pasdig.drv:
  154.     rem proaudio spectrum 16
  155.     rem detect settings from config.sys
  156.     detect_spectrum
  157.     set _sb_dma %_2%
  158.     rem if using 16 bit dma, punt and drop back to soundblaster emulation
  159.     rem is this right?
  160.     set _musicIo "%_ioPort%"
  161.     if %_dma% > 4
  162.         set soundDriver sbdig.drv
  163.         rem soundblaster emulation is normally dma channel 1
  164.         rem but use values detect_spectrum read from config.sys
  165.         detect_soundBlaster
  166.         set _dma %_sb_dma%
  167.         set _musicIo 388
  168.     endif
  169.     set soundVolume 70
  170. case default:
  171.     rem explicit defaults
  172. endswitch
  173. rem hard-code default music io port
  174. switch %musicDriver%
  175. case adlib.drv:
  176.     set _musicIo 388
  177. case adlibg.drv:
  178.     set _musicIo 388
  179. case roland.drv:
  180.     if %soundDriver% ne sb16dig.drv
  181.         set _musicIo 330
  182.     endif
  183. case default
  184.     rem normal case
  185. endswitch
  186. set _musicTmp %music%
  187. set _digiTmp %digitizedSound%
  188. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  189. setMusicPort "%_musicIo%"
  190. set music %_musicTmp%
  191. set digitizedSound %_digiTmp%
  192. if "%soundDevice%" eq none
  193.     set digitizedSound Off
  194.     set music Off
  195. endif
  196. if "%soundDriver%" eq .none
  197.     set digitizedSound Off
  198. endif
  199. if "%musicDriver%" eq PCSPKR.DRV
  200.     set music Off
  201. endif
  202. if "%musicDriver%" eq .none
  203.     set music Off
  204. endif
  205. rem clear dma if it's set to the default
  206. if "%_dma%" = -1
  207.     unset _dma 
  208. endif
  209. color back white
  210. color text black
  211. textbox 1 25 80 1
  212. type %_text%\settings.txt 1 25 80 1
  213. color back cyan
  214. color text white
  215. rem ----------------- prepend driver path -----------------
  216. set _nakedSoundDriver %soundDriver%
  217. appendSlash _cdroots %cdroot%
  218. switch %soundDriver% 
  219. rem these three are pseudo drivers and dont really exist
  220. case .none:
  221. case .internal:
  222. case sb16dig.drv:
  223. rem all others are real
  224. case default:
  225.     set soundDriver %_CDroots%drivers\%soundDriver%
  226.     exist %soundDriver%
  227.     if %_1% eq 0
  228.         rem driver does not exist
  229.         beep
  230.         type %_text%\sounderr.txt 10 10 60 9 -Border
  231.         waitkey 
  232.         unset _soundDevice2
  233.         goto card
  234.     endif
  235. endswitch
  236. switch %musicDriver% 
  237. rem these three are pseudo drivers and dont really exist
  238. case .none:
  239. rem all others are real
  240. case default:
  241.     set musicDriver %_CDroots%drivers\%musicDriver%
  242.     exist %musicDriver%
  243.     if %_1% eq 0
  244.         rem driver does not exist
  245.         beep
  246.         type %_text%\sounderr.txt 10 10 60 9 -Border
  247.         waitkey 
  248.         unset _soundDevice2
  249.         goto card
  250.     endif
  251. endswitch
  252. rem ----------------- note any tsr's needed for this card -------------
  253. closeDrivers
  254. unset _sc600mode
  255. rem set default tsr lines for product.bat
  256. set _tsr "rem no special tsrs needed"
  257. set _tsr2 "rem no special tsr cleanup needed"
  258. set _vol1 "rem No special sound device"
  259. set _vol2 "rem No special sound device cleanup"
  260. switch %soundDevice%
  261. case GRAVIS:
  262.     rem gravis ultrasound
  263.     set _tsr "ultrasnd.exe -c -d %HDroot%"
  264.     set _tsr2 "ultrasnd.exe -f"
  265.     if %CDroot% ne %HDroot%
  266.         copy ultramid.ini
  267.         copy ultrasnd.exe
  268.     endif
  269. case SC600:
  270.     rem Reveal SC600 in native general midi mode
  271.     set _sc600mode GM
  272. case SC600FM:
  273.     rem Reveal SC600 in Sound Blaster (FM) mode
  274.     set _sc600mode FM
  275. case default:
  276. endswitch
  277. if "%_sc600mode%" ne ""
  278.     rem getenv SNDSCAPE
  279.     rem set _tsr "%_1%\ssinit %_sc600mode% /w"
  280.     set _tsr "%hdroot%\callss %_sc600mode% /w"
  281.     set _vol1 "%hdroot%\ssvol 127 110 100"
  282.     set _vol2 "%hdroot%\ssvol /r"
  283.     unset _sc600mode
  284.     rem ssinit is not a tsr, so we can run it now.
  285.     spawn %_tsr%
  286.     spawn %_vol1%
  287.     textbox 1 1 80 25 blue
  288.     color back white
  289.     color text black
  290.     type %_text%\settings.txt 1 25 80 1
  291.     color back cyan
  292.     color text white
  293.     type %_text%\setup.txt 3 2 77 6 -border
  294.     color text yellow
  295.     echo 6 6 70 1 -center "%title%"
  296.     color text white
  297.     openDrivers
  298. endif
  299. rem ----------------- auto music & sound -----------------
  300. rem Automatically play music and sound unless ? option is given on
  301. rem command line
  302. getOpt ?
  303. if %_err% = 0
  304.     goto loop
  305. endif
  306. if %musicType% ne -
  307.     color back blue
  308.     color text yellow blink
  309.     type %_text%\pmusic.txt 20 20 40 1 
  310.     color text white
  311.     type %_text%\playing.txt 5 21 70 4
  312.     rem show them which menu item would have gotten them here, more or less.
  313.     color back cyan
  314.     menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 0 -showOnly
  315.     music kalogo.%musicType%
  316. endif
  317. rem getenv's argument is case sensitive; usually always uppercase,
  318. rem but windir is lowercase.  That way you can't set it from commandline!
  319. getenv windir
  320. if "%_1%" ne "" 
  321.     rem by golly they're in windows;
  322.     rem don't use the PC Speaker because the driver isn't installed yet
  323.     switch %soundDevice%
  324.     case PCspeaker:
  325.         goto noAutoSoundTest
  326.     case default:
  327.     endswitch
  328. endif
  329. if %digitizedSound% ne Off
  330.     color back blue
  331.     color text yellow blink
  332.     type %_text%\psound.txt 20 20 40 1 
  333.     color text white
  334.     type %_text%\playing.txt 5 21 70 4 
  335.     rem show them which menu item would have gotten them here, more or less.
  336.     color back cyan
  337.     menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 1 -showOnly
  338.     sound knowledg.voc
  339. endif
  340. :noAutoSoundTest
  341. rem default after automatic test is to save and exit
  342. set _mainDef 4
  343. textbox 5 20 70 5 blue 
  344. goto loop_noclear
  345. :loop
  346. rem ----------------- select function --------------------
  347. textbox 1 9 80 16 blue
  348. :loop_noclear
  349. color back white
  350. color text black
  351. textbox 1 25 80 1
  352. type %_text%\settings.txt 1 25 80 1
  353. color back cyan
  354. color text white
  355. menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default %_mainDef%
  356. set _mainDef 0
  357. switch %_1%
  358. case exit:
  359.     goto exit
  360. case escape:
  361.     goto card
  362. case card:
  363.     goto card
  364. case music:
  365.     if "%musicType%" ne -
  366.         color back blue
  367.         color text yellow blink
  368.         type %_text%\pmusic.txt 20 20 40 1 
  369.         color text white
  370.         type %_text%\playing.txt 5 21 70 4
  371.         music kalogo.%musicType%
  372.     endif
  373. case sound:
  374.     if "%soundDriver%" ne .none
  375.         color back blue
  376.         color text yellow blink
  377.         type %_text%\psound.txt 20 20 40 1 
  378.         color text white
  379.         type %_text%\playing.txt 5 21 70 4
  380.         sound knowledg.voc
  381.     endif
  382. case settings:
  383.     goto settings
  384. endswitch
  385. goto loop
  386. :settings
  387. rem
  388. rem ----------------- LK OPTION MENU --------------------
  389. rem Needed files are:  all files preceded by "o_", settings.txt, updown.leg,
  390. rem and setup.txt
  391. textbox 1 1 80 25 blue
  392. color back cyan
  393. indestdir
  394. rem detect characteristics of user's system
  395. getDiskFree
  396. rem set Diskfree %_1%
  397. getMemFree
  398. rem set memfree %_1%
  399. detect_windows_dir
  400. rem set windows_dir %_1%
  401. color back blue
  402. rem type %_text%\ereg.txt 5 21 70 4
  403. color back cyan
  404. set _next 0
  405. getSoundPort _ioport _irq _dma _drq
  406. getMusicPort _musicIo
  407. :o_main_loop_clear
  408. textbox 1 1 80 25 Blue
  409. :o_main_loop
  410. color back white
  411. color text black
  412. textbox 1 25 80 1
  413. type %_text%\settings.txt 1 25 80 1
  414. color back cyan
  415. color text white
  416. menu %_text%\o_option.mnu 4 3 74 19 %_text%\o_option.tit %_text%\o_tog.leg -default %_next% -anyKey
  417. set _type %_1%
  418. set _line "%_2%"
  419. set _var "%_3%"
  420. set _next "%_4%"
  421. set _ch1 "%_5%"
  422. set _ch2 "%_6%"
  423. switch %_type% 
  424. case escape:
  425.     textbox 1 1 80 25 Blue
  426.     type %_text%\setup.txt 3 2 77 6 -border
  427.     color text yellow
  428.     echo 6 6 70 1 -center "%title%"
  429.     color text white
  430.     goto loop
  431. case quit:
  432.     set _musicTmp %music%
  433.     set _digiTmp %digitizedSound%
  434.     setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  435.     setMusicPort "%_musicIo%"
  436.     set music %_musicTmp%
  437.     set digitizedSound %_digiTmp%
  438.     textbox 1 1 80 25 Blue
  439.     type %_text%\setup.txt 3 2 77 6 -border
  440.     color text yellow
  441.     echo 6 6 70 1 -center "%title%"
  442.     color text white
  443.     goto loop
  444. case quitSave:
  445.     set _musicTmp %music%
  446.     set _digiTmp %digitizedSound%
  447.     setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  448.     setMusicPort "%_musicIo%"
  449.     set music %_musicTmp%
  450.     set digitizedSound %_digiTmp%
  451.     saveconfig
  452.     textbox 1 1 80 25 Blue
  453.     type %_text%\setup.txt 3 2 77 6 -border
  454.     color text yellow
  455.     echo 6 6 70 1 -center "%title%"
  456.     color text white
  457.     goto loop
  458. case ENUM:
  459.     rem either one or the other
  460.     set_eval _inVar %%%_var%%%
  461.     if "%_inVar%" eq "%_ch1%"
  462.         set %_var% "%_ch2%"
  463.     endif
  464.     if "%_inVar%" eq "%_ch2%" 
  465.         set %_var% "%_ch1%"
  466.     endif
  467.     if "%_inVar%" eq "" 
  468.         set %_var% "%_ch1%"
  469.     endif
  470.     if "%_1%" ne ""
  471.         readKey
  472.     endif
  473. case BOOL:
  474.     rem either On / Off
  475.     set_eval _inVar %%%_var%%%
  476.     if "%_inVar%" eq "On"
  477.         set %_var% "Off"
  478.     endif
  479.     if "%_inVar%" eq "Off" 
  480.         set %_var% "On"
  481.     endif
  482.     if "%_inVar%" eq "" 
  483.         set %_var% "On"
  484.     endif
  485.     if "%_1%" ne ""
  486.         readKey
  487.     endif
  488. case LINE:
  489.     rem Open entry
  490.     set_eval _inVar %%%_var%%%
  491.     rem Prompt coordinates are tied closely to menu coordinates.
  492.     set _o_tmp %_line%
  493.     sub _o_tmp 1
  494.     echo 36 %_o_tmp% 36 1
  495.     promptdir "" 34 %_line% 38 1 -any
  496.     if "%_1%" eq escape
  497.         goto o_main_loop
  498.     endif
  499.     if "%_1%" ne escape
  500.         set %_var% "%_1%"
  501.     endif
  502. case PRCT:
  503.     rem Percentage 0-100
  504.     set_eval _inVar %%%_var%%%
  505.     rem lk 3/26/94 start
  506.     rem next four ifs are exceptions because SBDIG.DRV and PCSPKR.DRV
  507.     rem doesn't handle soundVolume
  508.     if "%_var%" ne SoundVolume
  509.         goto o_noDriver
  510.     endif
  511.     set _noChangeVol 0
  512.     if "%_nakedSoundDriver%" eq PCSPKR.DRV
  513.         set _noChangeVol 1
  514.     endif
  515.     if "%_nakedSoundDriver%" eq SBDIG.DRV
  516.         set _noChangeVol 1
  517.     endif
  518.     if "%_noChangeVol%" > 0
  519.         set soundVolume 100
  520.         beep 1
  521.         sub _next 1
  522.         textbox 1 1 80 24 blue
  523.         color back blue
  524.         type %_text%\o_novol.txt 18 10 44 4
  525.         color back cyan
  526.         waitKey_noesc
  527.         textbox 10 21 60 4 blue
  528.         goto o_main_loop
  529.     endif
  530.     unset _noChangeVol
  531. :o_noDriver
  532.     rem lk 3/26/94 end
  533.     rem Prompt coordinates are tied closely to menu coordinates.
  534.     set _o_tmp %_line%
  535.     sub _o_tmp 1
  536.     color back lightmagenta
  537.     echo 36 %_o_tmp% 30 1 "   ]                               "
  538.     promptdir "" 34 %_line% 5 1 -any
  539.     color back cyan
  540.     if "%_1%" eq escape
  541.         goto o_main_loop
  542.     endif
  543.     if "%_1%" < 1
  544.         beep 1
  545.         sub _next 1
  546.         goto o_main_loop
  547.     endif
  548.     if "%_1%" > 100
  549.         beep 1
  550.         sub _next 1
  551.         goto o_main_loop
  552.     endif
  553.     if "%_1%" ne escape
  554.         set %_var% "%_1%"
  555.     endif
  556. case INT:
  557.     rem Any number specified in menu
  558.     set_eval _inVar %%%_var%%%
  559.     rem Prompt coordinates are tied closely to menu coordinates.
  560.     set _o_tmp %_line%
  561.     sub _o_tmp 1
  562.     echo 36 %_o_tmp% 36 1
  563.     rem Use _min=1 to stop input of strings
  564.     promptdir "" 34 %_line% 38 1 -any
  565.     if "%_1%" eq escape
  566.         goto o_main_loop
  567.     endif
  568.     if "%_1%" < %_ch1%
  569.         beep 1
  570.         sub _next 1
  571.         goto o_main_loop
  572.     endif
  573.     if "%_1%" > %_ch2%
  574.         beep 1
  575.         sub _next 1
  576.         goto o_main_loop
  577.     endif
  578.     if "%_1%" ne escape
  579.         set %_var% "%_1%"
  580.     endif
  581. case DIR:
  582.     rem expect a path
  583.     set_eval _inVar %%%_var%%%
  584.     rem Prompt coordinates are tied closely to menu coordinates.
  585.     set _o_tmp %_line%
  586.     sub _o_tmp 1
  587.     color back lightmagenta
  588.     echo 36 %_o_tmp% 39 1 "                                     ]"
  589.     promptdir "" 34 %_line% 39 1
  590.     color back cyan
  591.     if "%_1%" eq escape
  592.         goto o_main_loop
  593.     endif
  594.     if "%_1%" ne escape
  595.         set %_var% "%_1%"
  596.     endif
  597. case SMIO:
  598.     rem
  599.     rem ----------------- select music i/o adr --------------------
  600.     textbox 1 1 80 25 blue
  601.     textbox 1 9 80 16 blue
  602.     menu %_text%\o_io.mnu 19 11 44 12 %_text%\o_io.tit %_text%\updown.leg -anyKey
  603.     textbox 1 9 80 16 blue
  604.     if %_1% eq escape
  605.         goto o_main_loop_clear
  606.     endif
  607.     set "_musicIo" "%_1%"
  608.     textbox 1 1 80 25 blue
  609.     rem
  610. case SIO:
  611.     if %_ioMnu% eq -
  612.         goto o_main_loop
  613.     endif
  614.     rem
  615.     rem ----------------- select i/o adr --------------------
  616.     textbox 1 1 80 25 blue
  617.     textbox 1 9 80 16 blue
  618.     menu %_text%\o_ioMnu.mnu 19 11 44 12 %_text%\o_io.tit %_text%\updown.leg -literal "%_ioMnu%"
  619.     textbox 1 9 80 16 blue
  620.     if %_1% eq escape
  621.         goto o_main_loop_clear
  622.     endif
  623.     set _ioPort %_1%
  624.     textbox 1 1 80 25 blue
  625.     rem
  626. case SIRQ:
  627.     if %_irqMnu% eq -
  628.         goto o_main_loop
  629.     endif
  630.     rem
  631.     rem ----------------- select IRQ --------------------
  632.     textbox 1 1 80 25 blue
  633.     menu %_text%\o_irqMnu.mnu 19 11 44 12 %_text%\o_irq.tit %_text%\updown.leg -literal "%_irqMnu%"
  634.     if %_1% eq escape
  635.         goto o_main_loop_clear
  636.     endif
  637.     set _irq %_1%
  638.     textbox 1 1 80 25 blue
  639. case SDMA:
  640.     if %_dmaMnu% eq -
  641.         goto o_main_loop
  642.     endif
  643.     rem
  644.     rem ----------------- select DMA --------------------
  645.     textbox 1 1 80 25 blue
  646.     menu %_text%\o_dmaMnu.mnu 19 11 44 10 %_text%\o_dma.tit %_text%\updown.leg -literal "%_dmaMnu%"
  647.     if %_1% eq escape
  648.         goto o_main_loop_clear
  649.     endif
  650.     set _dma %_1%
  651.     textbox 1 1 80 25 blue
  652. endswitch
  653. goto o_main_loop
  654. inDestDir
  655. goto out
  656. set _follow 0
  657. set _next 1
  658. textbox 1 1 80 25 blue 
  659. rem
  660. rem ----------------- END LK OPTIONS --------------------
  661. :exit
  662. rem ---------- set up sound files ---------
  663. set _musicTmp %music%
  664. set _digiTmp %digitizedSound%
  665. setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
  666. setMusicPort "%_musicIo%"
  667. set music %_musicTmp%
  668. set digitizedSound %_digiTmp%
  669. saveconfig
  670. rem this section will change for each product!
  671. rem copy the music archive for each zoomscape and kav.
  672. exist ka.%musicType%
  673. if %_1% = 0
  674.     goto no_music_archive
  675. endif
  676. if %musicType% ne -
  677.     textbox 1 9 80 17 blue
  678.     color back blue
  679.     color text yellow
  680.     type %_text%\copying4.txt 1 15 80 1 
  681.     color back cyan
  682.     color text white
  683.     copy ka.%musicType% ka.mus
  684. endif
  685. :no_music_archive
  686. rem ---------- copy driver files -----------
  687. copy %_text%\product.bat %shortTitle%.bat -expand
  688. rem ---------- select how much to install -----------
  689. rem feeble attempt to make setup script sense whether subset archives exist.
  690. rem caution: cdrom burner refuses to create empty directories
  691. existdir %cdroot%\cache2
  692. if %_1% = 0
  693.     goto cache_done
  694. endif
  695. :cache
  696. textbox 1 9 80 17 blue
  697. beep 2
  698. type %_text%\cache.txt 6 18 68 6 -border
  699. menu %_text%\cache.mnu 19 10 44 6 %_text%\cache.tit %_text%\updown.leg
  700. textbox 1 9 80 17 blue
  701. set _choice %_1%
  702. set _needDisk "%_2%"
  703. if %_choice% eq escape
  704.     goto loop
  705. endif
  706. rem delete old copy of cache files, if any.  assume there are two caches.
  707. copy cache1 %hdroot% -dir -uncopy
  708. copy cache2 %hdroot% -dir -uncopy
  709. set _diskWarning diskfre2.txt
  710. detect_compressedDisk
  711. if %_1% = 1
  712.     set _diskWarning dskcfre2.txt
  713.     add _needDisk %_needDisk%
  714. endif
  715. getdiskfree
  716. set _gotDisk %_1%
  717. if %_gotDisk% < %_needDisk%
  718.     beep
  719.     type %_text%\%_diskWarning% 10 15 60 8 -border
  720.     waitkey_noesc
  721.     switch %_1%
  722.     case escape:
  723.         goto exit_unsaved
  724.     case default:
  725.     endswitch
  726.     goto cache
  727. endif
  728. color back blue
  729. color text yellow
  730. type %_text%\copying3.txt 17 19 50 6 
  731. color back cyan
  732. color text white
  733. rem copy chosen set of quick access files
  734. copy cache%_choice% %hdroot% -dir
  735. rem copy cachex%_choice% %hdroot% -dir -expand
  736. :cache_done
  737. color back cyan
  738. rem ---------- check and modify config.sys ------------
  739. detect_files
  740. set _nfiles %_1%
  741. set _cfiles %_2%
  742. rem _nfiles is how many files could actually be opened when pictext.exe started
  743. rem _cfiles is the argument to FILES= in CONFIG.SYS
  744. rem _nfiles is often less than _cfiles
  745. set _needfiles 17
  746. set _setfiles 20
  747. if %_nfiles% >= %_needfiles%
  748.     goto files_done
  749. endif
  750. rem they don't have enough file handles.  Is it because of CONFIG.SYS?
  751. if %_cfiles% >= %_setfiles%
  752.     rem nope.  Don't offer to change CONFIG.SYS.
  753.     textbox 1 9 80 17 blue
  754.     beep 1
  755.     type %_text%\files2.txt 7 11 70 13 -border
  756.     waitkey
  757.     goto files_done
  758. endif
  759. rem Their CONFIG.SYS needs changing.
  760. :addfiles
  761.     textbox 1 9 80 17 blue
  762.     beep 2
  763.     type %_text%\files.txt 10 11 63 13 %_text%\files.tit %_text%\yesno.leg
  764.     waitkey_noesc
  765.     switch %_1%
  766.     case %yes%:
  767.         set_files %_setfiles%
  768.         beep
  769.         type %_text%\didfiles.txt 10 11 63 13 -border
  770.         waitkey_noesc
  771.     case %no%:
  772.         rem do nothing
  773.     case escape:
  774.         rem do nothing
  775.     case default:
  776.         goto addfiles
  777.     endswitch
  778.     textbox 1 9 80 17 blue
  779. :files_done
  780. rem ---------- check windows, set up icons, dma, and realsound driver ---------
  781. set _winWarning anykey.txt
  782. detect_windows_dir
  783. set _windir %_1%
  784. if %_windir% eq "none"
  785.     goto no_windows
  786. endif
  787. :do_windows
  788.     textbox 1 9 80 17 blue
  789.     beep 2
  790.     type %_text%\windows.txt 9 11 65 8 %_text%\windows.tit %_text%\yesno.leg
  791.     waitkey_noesc
  792.     switch %_1%
  793.     case %yes%:
  794.         rem copy files needed by windows code
  795.         copy kagroup.exe %_windir%\kagroup.exe
  796.         exist %_windir%\kagroup.inf
  797.         if %_1% = 0
  798.             copy %_text%\kagroup.hdr %_windir%\kagroup.inf -expand
  799.         endif
  800.         copy %_text%\kagroup.inf %_windir%\kagroup.inf -expand -append
  801.         rem when setting up windows, only load device driver if needed
  802.         rem perhaps this should be part of menu file rather than special
  803.         rem case code.
  804.         if "%soundDevice%" eq "PCSpeaker"
  805.             appendSlash _hdroots %hdroot%
  806.             setup_windows %_windir% %_HDRoots%vrsd.386
  807.         endif
  808.         if "%soundDevice%" ne "PCSpeaker"
  809.             setup_windows %_windir%
  810.         endif
  811.         textbox 1 9 80 17 blue
  812.         beep
  813.         type %_text%\windone.txt 10 11 63 11 -border
  814.         set _winWarning windone2.txt
  815.         waitkey
  816.     case %no%:
  817.         rem do nothing
  818.     case escape:
  819.         rem do nothing
  820.     case default:
  821.         goto do_windows
  822.     endswitch
  823. :no_windows
  824. rem ---------- check for ereg option ----------
  825. exist %hdroot%\ereg.on 
  826. if %_1% = 0
  827.     goto no_ereg
  828. endif
  829. :test_ereg
  830.     textbox 1 9 80 17 blue
  831.     beep 2
  832.     type %_text%\ereg.txt 9 11 65 11 %_text%\ereg.tit %_text%\yesno.leg
  833.     waitkey_noesc
  834.     switch %_1%
  835.     case %yes%:
  836.         rem fall through to ereg.
  837.     case %no%:
  838.         goto no_ereg
  839.     case escape:
  840.         goto no_ereg
  841.     case default:
  842.         goto test_ereg
  843.     endswitch
  844. rem On-line registration.
  845. textbox 1 1 80 25 blue
  846. color back cyan
  847. rem detect characteristics of user's system
  848. getDiskFree
  849. set Diskfree %_1%
  850. getMemFree
  851. set memfree %_1%
  852. detect_windows_dir
  853. set windows_dir %_1%
  854. detect_compressedDisk
  855. set compressed %_1%
  856. color back blue
  857. type %_text%\e_ereg.txt 5 22 70 4
  858. color back cyan
  859. set _next 0
  860. :ereg_loop
  861. menu %_text%\e_ereg.mnu 6 2 70 18 %_text%\e_ereg.tit %_text%\e_ereg.leg -default %_next% -anyKey
  862. set _choice %_1%
  863. set _next "%_2%"
  864. set _line "%_3%"
  865. switch %_choice% 
  866. case escape:
  867.     goto ereg_done
  868. case quit:
  869.     goto ereg_done
  870. case save:
  871.     saveconfig
  872.     goto ereg_register
  873. case default:
  874.     set_eval _val %%%_choice%%%
  875.     rem promptdir "%_val%" 5 19 60 6 %_text%\e_entry.tit %_text%\e_entry.txt -any
  876.     rem Prompt coordinates are tied closely to menu coordinates.
  877.     promptdir "%_val%" 36 %_line% 36 1 -any
  878.     if "%_1%" ne escape
  879.         set %_choice% "%_1%"
  880.     endif
  881.     rem textbox 5 19 52 7 blue
  882. endswitch
  883. goto ereg_loop
  884. :ereg_register
  885. rem second menu
  886. preset |prefix 1
  887. set _next 0
  888. :ereg_register_loop
  889. textbox 1 1 80 25 blue
  890. menu %_text%\e_dial.mnu 6 10 70 8 %_text%\e_dial.tit %_text%\e_dial.leg -default %_next%
  891. set _choice %_1%
  892. set _phone "%_2%"
  893. switch %_choice% 
  894. case escape:
  895.     goto done
  896. case quit:
  897.     goto done
  898. case |prefix:
  899.     set_eval _val %%%_choice%%%
  900.     rem Prompt coordinates are tied closely to menu coordinates.
  901.     textbox 1 1 80 25 blue
  902.     promptdir "%_val%" 20 10 40 6 %_text%\e_prefix.tit %_text%\e_prefix.leg
  903.     if "%_1%" ne escape
  904.         set %_choice% "%_1%"
  905.     endif
  906.     set _next 1
  907.     goto ereg_register_loop
  908. case toll:
  909. case tollfree:
  910. endswitch
  911. textbox 1 1 80 25 blue
  912. color back blue
  913. type %_text%\e_dialin.txt 12 5 54 5
  914. color back cyan
  915. register_via_modem %|prefix%%_phone%
  916. set _bad %_err%
  917. if %_bad% = 0
  918.     textbox 1 1 80 25 blue
  919.     type %_text%\e_done.txt 5 10 72 10 -border
  920. endif
  921. if %_bad% != 0
  922.     textbox 1 1 80 25 blue
  923.     type %_text%\e_err.txt 5 10 72 10 -border
  924. endif
  925. waitkey_noesc
  926. :ereg_done
  927. :no_ereg
  928. rem ---------- all done.  print trailer messages. ----------
  929. color back black
  930. color text white
  931. textbox 1 1 80 25 black
  932. type %_text%\done.txt 1 1 80 15
  933. if "%soundDevice%" eq "DIGISP"
  934.     type %_text%\bmaster.txt 1 16 80 4
  935. endif
  936. if "%soundDevice%" eq "ARIA"
  937.     type %_text%\aria.txt 1 16 80 4
  938. endif
  939. if "%soundDevice%" eq "RLDSC"
  940.     type %_text%\roland.txt 1 16 80 4
  941. endif
  942. rem since we're invoked with kawin, don't need to tell them to restart windows
  943. rem However, this code is used to pause the setup screen when run from Windows.
  944. getenv windir
  945. if "%_1%" ne "" 
  946.     beep
  947.     type %_text%\%_winWarning% 1 21 80 4
  948.     rem pause if their window might go away...
  949.     waitkey
  950.     set _waited 1
  951. endif
  952. rem Since this product's install is invoked by a shell, and 
  953. rem Larry wants it to loop, pause so the final message doesn't
  954. rem get obliterated.  Should only do this if invoked by install.
  955. if "%_waited%" ne 1
  956.     type %_text%\anykey.txt 1 21 80 4
  957.     waitkey
  958. endif
  959. goto final_exit
  960. :exit_unsaved
  961. textbox 1 1 80 25 black
  962. :final_exit
  963. ___ENDSCRIPT___
  964.