home *** CD-ROM | disk | FTP | other *** search
- rem we are already in the destination directory,
- rem and ka.cnf points to the drive and directory we were installed from
- indestdir
- rem Make drive letter variables for the benefit of batch files launched by kav
- getDriveLetter %CDroot%
- set CDdrive %_1%
- getDriveLetter %HDroot%
- set HDdrive %_1%
- rem set default values for a few things
- preset AutoMovie on
- preset mouseSensitivity 50
- preset ExtraMemory Automatic
- preset musicVolume 70
- preset soundVolume 100
- preset Printing Detect
- preset PrinterPort LPT1
- preset digitizedSound on
- preset music on
- preset zoomUseRealSound off
- rem Deal with power management for product.bat
- set _power "rem power.exe not detected"
- detect_power
- if %_1% = 1
- set _power "power off"
- endif
- rem set default tsr lines for product.bat
- set _tsr "rem no special tsrs needed"
- set _tsr2 "rem no special tsr cleanup needed"
- rem Specify where all the text files used in setup live.
- set _text %hdroot%\inst%LANG%.txl
- rem
- err_handler %_text%\errhand.txt
- rem
- textbox 1 1 80 25 blue
- color back cyan
- getOpt -help
- if %_err% = 0
- type %_text%\setuphlp.txt 3 2 77 15 -border -nocenter
- waitkey
- goto exit_unsaved
- endif
- type %_text%\setup.txt 3 2 77 6 -border
- color text yellow
- echo 6 6 70 1 -center "%title%"
- color text white
- rem ----------------- select card --------------------
- :card
- textbox 1 9 80 17 blue
- menu %_text%\sound.mnu 19 11 44 13 %_text%\sound.tit %_text%\updown.leg
- set soundDriver %_1%
- set musicDriver "%_2%"
- set musicType "%_3%"
- set soundDevice "%_4%"
- set _soundDevice2 "%_5%"
- if "%soundDevice%" eq -
- set soundDevice "%_soundDevice2%"
- endif
- unset _dma
- unset _irq
- unset _ioPort
- textbox 1 9 80 16 blue
- rem set i/o port, etc.
- set _musicIoPort "%_ioPort%"
- switch %soundDriver%
- case escape:
- goto exit_unsaved
- case sbdig.drv:
- detect_soundBlaster
- set _musicIoPort "%_ioPort%"
- case sbpdig.drv:
- detect_soundBlaster
- set _musicIoPort "%_ioPort%"
- set soundVolume 80
- case sb16dig.drv:
- detect_soundBlaster
- rem above command now sets _musicIoPort, but it should only be used
- rem with roland music, i.e. if user has waveblaster daughter card.
- if %musicType% eq adl
- set _musicIoPort "%_ioPort%"
- endif
- set soundVolume 80
- case pasdig.drv:
- rem proaudio spectrum 16
- rem detect settings from config.sys
- detect_spectrum
- set _sb_dma %_2%
- rem if using 16 bit dma, punt and drop back to soundblaster emulation
- rem is this right?
- set _musicIoPort "%_ioPort%"
- if %_dma% > 4
- set soundDriver sbdig.drv
- rem soundblaster emulation is normally dma channel 1
- rem but use values detect_spectrum read from config.sys
- detect_soundBlaster
- set _dma %_sb_dma%
- set _musicIoPort 388
- endif
- set soundVolume 70
- case default:
- rem explicit defaults
- endswitch
- rem hard-code default music io port
- switch %musicDriver%
- case adlib.drv:
- set _musicIoPort 388
- case adlibg.drv:
- set _musicIoPort 388
- case roland.drv:
- set _musicIoPort 330
- type %_text%\roland.txt 10 10 60 10
- waitkey
- color back blue
- textbox 10 10 60 10
- case default
- rem normal case
- endswitch
- setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
- setMusicPort "%_musicIoPort%"
- if "%soundDevice%" eq none
- set digitizedSound off
- set music off
- endif
- if "%soundDriver%" eq .none
- set digitizedSound off
- endif
- rem horrible kudge soon to be replaced with new column in sound.mnu
- rem changes from LK
- if "%soundDriver%" eq ADLIBDIG.DRV
- set music off
- endif
- rem end changes
- if "%musicDriver%" eq PCSPKR.DRV
- set music off
- endif
- if "%musicDriver%" eq .none
- set music off
- endif
- rem clear dma if it's set to the default
- if "%_dma%" = -1
- unset _dma
- endif
- color back white
- color text black
- textbox 1 25 80 1
- type %_text%\settings.txt 1 25 80 1
- color back cyan
- color text white
- rem ----------------- prepend driver path -----------------
- set _nakedSoundDriver %soundDriver%
- appendSlash _cdroots %cdroot%
- switch %soundDriver%
- rem these three are pseudo drivers and dont really exist
- case .none:
- case .internal:
- case sb16dig.drv:
- rem all others are real
- case default:
- set soundDriver %_CDroots%drivers\%soundDriver%
- exist %soundDriver%
- if %_1% eq 0
- rem driver does not exist
- beep
- type %_text%\sounderr.txt 10 10 60 9 -Border
- waitkey
- unset _soundDevice2
- goto card
- endif
- endswitch
- switch %musicDriver%
- rem these three are pseudo drivers and dont really exist
- case .none:
- rem all others are real
- case default:
- set musicDriver %_CDroots%drivers\%musicDriver%
- exist %musicDriver%
- if %_1% eq 0
- rem driver does not exist
- beep
- type %_text%\sounderr.txt 10 10 60 9 -Border
- waitkey
- unset _soundDevice2
- goto card
- endif
- endswitch
- rem ----------------- note any tsr's needed for this card -------------
- switch %_nakedSoundDriver%
- case gravisdg.drv:
- rem gravis ultrasound
- set _tsr "ultrasnd.exe -c -d %HDroot%"
- set _tsr2 "ultrasnd.exe -f"
- if %CDroot% ne %HDroot%
- copy ultramid.ini
- copy ultrasnd.exe
- endif
- case default:
- endswitch
- rem ----------------- auto music & sound -----------------
- rem Automatically play music and sound unless ? option is given on
- rem command line
- getOpt ?
- if %_err% = 0
- goto loop
- endif
- rem getenv's argument is case sensitive; usually always uppercase,
- rem but windir is lowercase. That way you can't set it from commandline!
- getenv windir
- if "%_1%" ne ""
- rem by golly they're in windows;
- rem don't use the PC Speaker because the driver isn't installed yet
- switch %soundDevice%
- case PCspeaker:
- goto autoMusicTest
- case default:
- endswitch
- endif
- if %digitizedSound% ne off
- color back blue
- color text yellow blink
- type %_text%\psound.txt 20 20 40 1
- color text white
- type %_text%\playing.txt 5 21 70 4
- rem show them which menu item would have gotten them here, more or less.
- color back cyan
- menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 0 -showOnly
- sound knowledg.voc
- endif
- :autoMusicTest
- if %musicType% ne none
- color back blue
- color text yellow blink
- type %_text%\pmusic.txt 20 20 40 1
- color text white
- type %_text%\playing.txt 5 21 70 4
- rem show them which menu item would have gotten them here, more or less.
- color back cyan
- menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default 1 -showOnly
- music kalogo.%musicType%
- endif
- rem default after automatic test is to save and exit
- set _mainDef 4
- textbox 5 20 70 5 blue
- goto loop_noclear
- :loop
- rem ----------------- select function --------------------
- textbox 1 9 80 16 blue
- :loop_noclear
- color back white
- color text black
- textbox 1 25 80 1
- type %_text%\settings.txt 1 25 80 1
- color back cyan
- color text white
- menu %_text%\main.mnu 19 10 44 9 %_text%\main.tit %_text%\updown.leg -default %_mainDef%
- set _mainDef 0
- switch %_1%
- case exit:
- goto exit
- case escape:
- goto card
- case card:
- goto card
- case music:
- if %musicType% ne none
- color back blue
- color text yellow blink
- type %_text%\pmusic.txt 20 20 40 1
- color text white
- type %_text%\playing.txt 5 21 70 4
- music kalogo.%musicType%
- endif
- case sound:
- if %soundDriver% ne .none
- color back blue
- color text yellow blink
- type %_text%\psound.txt 20 20 40 1
- color text white
- type %_text%\playing.txt 5 21 70 4
- sound knowledg.voc
- endif
- case settings:
- goto settings
- endswitch
- goto loop
- rem
- rem ----------------- select i/o adr --------------------
- :settings
- textbox 1 9 80 16 blue
- menu %_text%\io.mnu 19 11 44 12 %_text%\io.tit %_text%\updown.leg
- textbox 1 9 80 16 blue
- if %_1% eq escape
- goto loop
- endif
- set _ioPort %_1%
- color back white
- color text black
- textbox 1 25 80 1
- type %_text%\settings.txt 1 25 80 1
- color back cyan
- color text white
- rem
- rem ----------------- select IRQ --------------------
- textbox 1 9 80 16 blue
- menu %_text%\irq.mnu 19 11 44 12 %_text%\irq.tit %_text%\updown.leg
- textbox 1 9 80 16 blue
- if %_1% eq escape
- goto loop
- endif
- set _irq %_1%
- color back white
- color text black
- textbox 1 25 80 1
- type %_text%\settings.txt 1 25 80 1
- color back cyan
- color text white
- rem
- rem ----------------- select DMA --------------------
- textbox 1 9 80 16 blue
- menu %_text%\dma.mnu 19 11 44 10 %_text%\dma.tit %_text%\updown.leg
- textbox 1 9 80 16 blue
- if %_1% eq escape
- goto loop
- endif
- set _dma %_1%
- rem Do we need to handle the PAS16-as-SB kluge again here? How could we tell?
- set _musicIoPort "%_ioPort%"
- rem ----- select done ----
- rem copy temporary settings (_ioPort, etc.) into real settings (SoundDevParams, etc).
- setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
- setMusicPort "%_musicIoPort%"
- goto loop
- rem
- :exit
- rem ---------- set up sound files ---------
- saveconfig
- rem this section will change for each product!
- rem copy the music archive for each zoomscape and kav.
- exist ka.%musicType%
- if %_1% = 0
- goto no_music_archive
- endif
- if %musicType% ne none
- textbox 1 9 80 17 blue
- color back blue
- color text yellow
- type %_text%\copying4.txt 1 15 80 1
- color back cyan
- color text white
- copy ka.%musicType% ka.mus
- endif
- :no_music_archive
- rem ---------- copy driver files -----------
- copy %_text%\product.bat %shortTitle%.bat -expand
- rem ---------- select how much to install -----------
- rem feeble attempt to make setup script sense whether subset archives exist.
- rem caution: cdrom burner refuses to create empty directories
- existdir %cdroot%\cachex1
- if %_1% = 0
- goto cache_done
- endif
- :cache
- textbox 1 9 80 17 blue
- beep 2
- type %_text%\cache.txt 6 18 68 6 -border
- menu %_text%\cache.mnu 19 10 44 6 %_text%\cache.tit %_text%\updown.leg
- textbox 1 9 80 17 blue
- set _choice %_1%
- set _needDisk "%_2%"
- if %_choice% eq escape
- goto loop
- endif
- rem delete old copy of cache files, if any. assume there are two caches.
- copy cache1 %hdroot% -dir -uncopy
- copy cache2 %hdroot% -dir -uncopy
- getdiskfree
- set _gotDisk %_1%
- if %_gotDisk% < %_needDisk%
- beep
- type %_text%\diskfre2.txt 10 15 60 8 -border
- waitkey_noesc
- switch %_1%
- case escape:
- goto exit_unsaved
- case default:
- endswitch
- goto cache
- endif
- color back blue
- color text yellow
- type %_text%\copying3.txt 17 19 50 6
- color back cyan
- color text white
- rem copy chosen set of quick access files
- copy cache%_choice% %hdroot% -dir
- copy cachex%_choice% %hdroot% -dir -expand
- :cache_done
- color back cyan
- rem ---------- check and modify config.sys ------------
- detect_files
- set _nfiles %_1%
- set _cfiles %_2%
- rem _nfiles is how many files could actually be opened when pictext.exe started
- rem _cfiles is the argument to FILES= in CONFIG.SYS
- rem _nfiles is often less than _cfiles
- set _needfiles 17
- set _setfiles 20
- if %_nfiles% >= %_needfiles%
- goto files_done
- endif
- rem they don't have enough file handles. Is it because of CONFIG.SYS?
- if %_cfiles% >= %_setfiles%
- rem nope. Don't offer to change CONFIG.SYS.
- textbox 1 9 80 17 blue
- beep 1
- type %_text%\files2.txt 7 11 70 13 -border
- waitkey
- goto files_done
- endif
- rem Their CONFIG.SYS needs changing.
- :addfiles
- textbox 1 9 80 17 blue
- beep 2
- type %_text%\files.txt 10 11 63 13 %_text%\files.tit %_text%\yesno.leg
- waitkey_noesc
- switch %_1%
- case %yes%:
- set_files %_setfiles%
- beep
- type %_text%\didfiles.txt 10 11 63 13 -border
- waitkey_noesc
- case %no%:
- rem do nothing
- case escape:
- rem do nothing
- case default:
- goto addfiles
- endswitch
- textbox 1 9 80 17 blue
- :files_done
- rem ---------- check windows, set up icons, dma, and realsound driver ---------
- set _winWarning anykey.txt
- detect_windows_dir
- set _windir %_1%
- if %_windir% eq "none"
- goto no_windows
- endif
- :do_windows
- textbox 1 9 80 17 blue
- beep 2
- type %_text%\windows.txt 9 11 65 8 %_text%\windows.tit %_text%\yesno.leg
- waitkey_noesc
- switch %_1%
- case %yes%:
- rem copy files needed by windows code
- copy kagroup.exe %_windir%\kagroup.exe
- exist %_windir%\kagroup.inf
- if %_1% = 0
- copy %_text%\kagroup.hdr %_windir%\kagroup.inf -expand
- endif
- copy %_text%\kagroup.inf %_windir%\kagroup.inf -expand -append
- rem when setting up windows, only load device driver if needed
- rem perhaps this should be part of menu file rather than special
- rem case code.
- if "%soundDevice%" eq "PCSpeaker"
- appendSlash _hdroots %hdroot%
- setup_windows %_windir% %_HDRoots%vrsd.386
- endif
- if "%soundDevice%" ne "PCSpeaker"
- setup_windows %_windir%
- endif
- textbox 1 9 80 17 blue
- beep
- type %_text%\windone.txt 10 11 63 11 -border
- set _winWarning windone2.txt
- waitkey
- case %no%:
- rem do nothing
- case escape:
- rem do nothing
- case default:
- goto do_windows
- endswitch
- :no_windows
- rem ---------- check for ereg option ----------
- exist %hdroot%\ereg.on
- if %_1% = 0
- goto no_ereg
- endif
- :test_ereg
- textbox 1 9 80 17 blue
- beep 2
- type %_text%\ereg.txt 9 11 65 11 %_text%\ereg.tit %_text%\yesno.leg
- waitkey_noesc
- switch %_1%
- case %yes%:
- rem fall through to ereg.
- case %no%:
- goto no_ereg
- case escape:
- goto no_ereg
- case default:
- goto test_ereg
- endswitch
- rem On-line registration.
- textbox 1 1 80 25 blue
- color back cyan
- rem detect characteristics of user's system
- getDiskFree
- set Diskfree %_1%
- getMemFree
- set memfree %_1%
- detect_windows_dir
- set windows_dir %_1%
- detect_compressedDisk
- set compressed %_1%
- color back blue
- type %_text%\e_ereg.txt 5 22 70 4
- color back cyan
- set _next 0
- :ereg_loop
- menu %_text%\e_ereg.mnu 6 2 70 18 %_text%\e_ereg.tit %_text%\e_ereg.leg -default %_next% -anyKey
- set _choice %_1%
- set _next "%_2%"
- set _line "%_3%"
- switch %_choice%
- case escape:
- goto ereg_done
- case quit:
- goto ereg_done
- case save:
- saveconfig
- goto ereg_register
- case default:
- set_eval _val %%%_choice%%%
- rem promptdir "%_val%" 5 19 60 6 %_text%\e_entry.tit %_text%\e_entry.txt -any
- rem Prompt coordinates are tied closely to menu coordinates.
- promptdir "%_val%" 36 %_line% 36 1 -any
- if "%_1%" ne escape
- set %_choice% "%_1%"
- endif
- rem textbox 5 19 52 7 blue
- endswitch
- goto ereg_loop
- :ereg_register
- rem second menu
- preset |prefix 1
- set _next 1
- :ereg_register_loop
- textbox 1 1 80 25 blue
- menu %_text%\e_dial.mnu 6 10 70 8 %_text%\e_dial.tit %_text%\e_dial.leg -default %_next%
- set _choice %_1%
- set _phone "%_2%"
- switch %_choice%
- case escape:
- goto ereg_done
- case quit:
- goto ereg_done
- case |prefix:
- set_eval _val %%%_choice%%%
- rem Prompt coordinates are tied closely to menu coordinates.
- textbox 1 1 80 25 blue
- promptdir "%_val%" 20 10 40 6 %_text%\e_prefix.tit %_text%\e_prefix.leg
- if "%_1%" ne escape
- set %_choice% "%_1%"
- endif
- set _next 1
- goto ereg_register_loop
- case toll:
- case tollfree:
- endswitch
- textbox 1 1 80 25 blue
- color back blue
- type %_text%\e_dialin.txt 12 5 54 5
- color back cyan
- register_via_modem %|prefix%%_phone%
- set _bad %_err%
- if %_bad% = 0
- textbox 1 1 80 25 blue
- type %_text%\e_done.txt 5 10 72 10 -border
- endif
- if %_bad% != 0
- textbox 1 1 80 25 blue
- type %_text%\e_err.txt 5 10 72 10 -border
- endif
- waitkey_noesc
- :ereg_done
- :no_ereg
- rem ---------- all done. print trailer messages. ----------
- color back black
- color text white
- textbox 1 1 80 25 black
- type %_text%\done.txt 1 1 80 15
- if "%soundDevice%" eq "Digispeech Portable Sound Plus"
- type %_text%\bmaster.txt 1 16 80 4
- endif
- if "%soundDevice%" eq "Aria Synthesizer Sound Card"
- type %_text%\aria.txt 1 16 80 4
- endif
- getenv windir
- if "%_1%" ne ""
- beep
- type %_text%\%_winWarning% 1 21 80 4
- rem pause if their window might go away...
- waitkey
- set _waited 1
- endif
- rem Since this product's install is invoked by a shell, and
- rem Larry wants it to loop, pause so the final message doesn't
- rem get obliterated. Should only do this if invoked by install.
- if "%_waited%" ne 1
- type %_text%\anykey.txt 1 21 80 4
- waitkey
- endif
- goto final_exit
- :exit_unsaved
- textbox 1 1 80 25 black
- :final_exit
- ___ENDSCRIPT___