home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPEED
/
SPEED16_09.iso
/
d
/
setup.scr
< prev
next >
Wrap
Text File
|
1994-01-12
|
12KB
|
449 lines
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 Printing Detect
preset PrinterPort LPT1
preset digitizedSound on
preset music on
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.
switch %_1%
case escape:
goto exit_unsaved
case sbdig.drv:
detect_soundBlaster
case sbpdig.drv:
detect_soundBlaster
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
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%
endif
case default:
rem explicit defaults
endswitch
setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
setMusicPort "%_ioPort%"
rem Special for demo
set port %_ioPort%
set irq %_irq%
set dma %_dma%
set musicPort %_ioPort%
if "%soundDevice%" eq none
set digitizedSound off
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%
if %soundDriver% ne none
set soundDriver %_CDroots%drivers\%soundDriver%
exist %soundDriver%
switch %_1%
case 0:
rem driver does not exist
beep
type %_text%\sounderr.txt 10 10 60 9 -Border
waitkey
unset _soundDevice2
goto card
case default:
endswitch
endif
if %musicDriver% ne none
set musicDriver %_CDroots%drivers\%musicDriver%
exist %musicDriver%
switch %_1%
case 0:
rem driver does not exist
beep
type %_text%\sounderr.txt 10 10 60 9 -Border
waitkey
unset _soundDevice2
goto card
case default:
endswitch
endif
rem ----------------- note any tsr's needed for this card -------------
switch %_nakedSoundDriver%
case gravisdg.drv:
rem gravis ultrasound
set _tsr "ultrasnd.exe -c -m100 -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 ----- select done ----
rem copy temporary settings (_ioPort, etc.) into real settings (SoundDevParams, etc).
setSoundPort "%_ioPort%" "%_irq%" "%_dma%" "%_drq%"
setMusicPort "%_ioPort%"
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.
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
rem copy ka.%musicType% ka.mus
endif
rem ---------- copy driver files -----------
set _needCpu 486
getCpuType
set _gotCpu %_1%
set _product demo486.bat
if %_gotCpu% < %_needCpu%
set _product demo386.bat
endif
copy %_text%\%_product% %shortTitle%.bat -expand
rem won't be needed once kav pays attention to soundDriver etc.
if %soundDriver% ne none
copy %soundDriver% sound.drv
endif
if %soundDriver% eq none
rm sound.drv
endif
if %musicDriver% ne none
copy %musicDriver% music.drv
endif
if %musicDriver% eq none
rm music.drv
endif
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 17 19 50 6 -border
waitkey
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%
rem detect_files actually opens files, so it may disagree with config.sys
rem always use files=20, but check for 17 open files
set _needfiles 17
set _setfiles 20
if %_nfiles% < %_needfiles%
: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
endif
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
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
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___