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