echo   #############################################
echo   #  Installation procedure for WATCOM C/386  #
echo   #############################################
#
ask doshost Will you be using DOS as a development environment [1800K] ?
ask os2host Will you be using OS/2 as a development environment [499K] ?
ask dosx Will you be developing 32-bit applications for a DOS Extender [503K] ?
set pls n
set ecs n
set dos4g n
set ads n
if %dosx ask pls Do you wish to install support for the Phar Lap DOS extender [171K] ?
if %dosx ask ecs Do you wish to install support for the Ergo DOS extender [18K] ?
if %dosx ask dos4g Do you wish to install support for the Rational DOS extender [417K] ?
if %dosx ask ads Do you wish to install support for the AutoCAD Development System [71K] ?
ask win3tgt Will you be developing 32-bit applications for Windows 3.x [2087K] ? 
set wex n
set sdk n
set doc n
set penw n
if %win3tgt ask wex Do you want Windows 3.x examples installed [644K] ?
if %win3tgt ask sdk Do you want Windows 3.x SDK examples installed [152K] ?
if %win3tgt ask doc Do you want Windows 3.x on-line help installed [3928K] ?
if %win3tgt ask penw Do you want Windows for Pen support installed [100K] ?
ask os2tgt Will you be developing 32-bit applications for OS/2 2.0 [900K] ? 
ask help Do you wish to install the HELP utility and help files [460K] ?
ask nlm Do you wish to install debugger support for NLMs [135K] ?
ask wprof Do you wish to install the Profiler [550K] ?
ask pen Do you wish to install PenPoint Debugger Support [28K] ?
#
# create directories
#
mkdir %2
mkdir %2bin
mkdir %2binb
mkdir %2binp
mkdir %2binp\dll
mkdir %2binp\help
mkdir %2binw
if %nlm mkdir %2nlm
mkdir %2lib386
mkdir %2lib386\dos
if %os2tgt mkdir %2lib386\os2
mkdir %2lib386\win
mkdir %2src
mkdir %2src\goodies
if %win3tgt mkdir %2src\inc
mkdir %2src\startup
mkdir %2src\startup\386
if %ads mkdir %2src\startup\ads
if %sdk mkdir %2src\dll
if %sdk mkdir %2src\sdkpatch
if %sdk mkdir %2src\sdkpatch\bitmap
if %sdk mkdir %2src\sdkpatch\cliptext
if %sdk mkdir %2src\sdkpatch\clock
if %sdk mkdir %2src\sdkpatch\cursor
if %sdk mkdir %2src\sdkpatch\dde
if %sdk mkdir %2src\sdkpatch\editcntl
if %sdk mkdir %2src\sdkpatch\editfile
if %sdk mkdir %2src\sdkpatch\editmenu
if %sdk mkdir %2src\sdkpatch\fileopen
if %sdk mkdir %2src\sdkpatch\generic
if %sdk mkdir %2src\sdkpatch\helpex
if %sdk mkdir %2src\sdkpatch\icon
if %sdk mkdir %2src\sdkpatch\input
if %sdk mkdir %2src\sdkpatch\menu
if %sdk mkdir %2src\sdkpatch\multipad
if %sdk mkdir %2src\sdkpatch\mypal
if %sdk mkdir %2src\sdkpatch\output
if %sdk mkdir %2src\sdkpatch\owncombo
if %sdk mkdir %2src\sdkpatch\prntfile
if %sdk mkdir %2src\sdkpatch\showfont
if %sdk mkdir %2src\sdkpatch\tty
mkdir %2src\win
if %wex mkdir %2src\win\alarm
if %wex mkdir %2src\win\chart
if %wex mkdir %2src\win\datactl
if %wex mkdir %2src\win\edit
if %wex mkdir %2src\win\filedll
if %wex mkdir %2src\win\generic
if %wex mkdir %2src\win\helpex
if %wex mkdir %2src\win\iconview
if %wex mkdir %2src\win\life
if %wex mkdir %2src\win\shootgal
if %wex mkdir %2src\win\watzee
mkdir %2h
mkdir %2h\sys
if %os2tgt mkdir %2h\os2
if %pen mkdir %2pen
#
# install diskette #1
#
unpack %2 %1readme.wpk
unpack %2binb\ %1wcl386.wpk
if %doshost unpack %2bin\ %1wcc386.dos
if %doshost unpack %2bin\ %1386wcgl.wpk
if %doshost unpack %2bin\ %1wcc386p.wpk
if %os2host unpack %2binp\ %1wcc386.os2
if %os2host unpack %2binp\dll\ %1wccopts.dll
if %os2host unpack %2binp\help\ %1wccopts.hpk
if %os2host unpack %2binp\help\ %1wccerrs.hpk
if %os2host unpack %2.\ %1wcc386.prf
if %win3tgt unpack %2.\ %1to31.wpk
unpack %2binb\ %1womp.wpk
unpack %2binb\ %1wdisasm.wpk
if %doshost unpack %2bin\ %1cfig386.wpk
unpack %2src\ %1src386.wpk
if %dos4g unpack %2src\ %1wstubsrc.wpk
unpack %2src\startup\ %1startup.wpk
unpack %2src\startup\386\ %1startup.386
if %win3tgt unpack %2src\startup\386\ %1startup.w32
if %ads unpack %2src\startup\ads\ %1startup.ads
unpack %2h\ %1h.wpk
unpack %2h\ %1h386.wpk
unpack %2h\sys\ %1h_sys.wpk
if %doshost unpack %2bin\ %1cmdedit.wpk
if %os2host unpack %2binp\ %1os2edit.wpk
if %help unpack %2binb\ %1whelp.wpk
#
# install diskette #2
#
enter %1wlink.wpk disk 2, labelled "Linker Library & DOS/4GW Disk"
unpack %2binb\ %1wlink.wpk
if %doshost unpack %2bin\ %1wlinkp.wpk
unpack %2binb\ %1ms2wlink.wpk
unpack %2binb\ %1wstrip.wpk
unpack %2binb\ %1wlib.wpk
unpack %2binb\ %1wmake.wpk
unpack %2binb\ %1wtouch.wpk
if %help unpack %2binb\ %1watcomc.wpk
if %dosx unpack %2lib386\dos\ %1clib3r.dos
if %dosx unpack %2lib386\dos\ %1clib3s.dos
if %dosx unpack %2lib386\dos\ %1emu387.dos
if %dosx unpack %2lib386\dos\ %1graph.dos
if %ads unpack %2lib386\dos\ %1adsstart.wpk
if %os2tgt unpack %2lib386\os2\ %1clib3r.os2
if %os2tgt unpack %2lib386\os2\ %1clib3s.os2
if %os2tgt unpack %2lib386\os2\ %1emu387.os2
ifnot %os2tgt goto skipos2_mtlib
unpack %2lib386\os2\ %1clibmt3r.os2
@file %2_mkmtlib.lbc
> +%2lib386\os2\_mtlib3r.lib
> +%2lib386\os2\_same3r.lib
@file %2_mkdllib.lbc
> +%2lib386\os2\_dllib3r.lib
> +%2lib386\os2\_same3r.lib
spawn %2binb\wlib -q -n -b %2lib386\os2\clibmt3r @%2_mkmtlib
spawn %2binb\wlib -q -n -b %2lib386\os2\clibdl3r @%2_mkdllib
@erase %2_mkmtlib.lbc
@erase %2_mkdllib.lbc
@erase %2lib386\os2\_mtlib3r.lib
@erase %2lib386\os2\_dllib3r.lib
@erase %2lib386\os2\_same3r.lib
unpack %2lib386\os2\ %1clibmt3s.os2
@file %2_mkmtlib.lbc
> +%2lib386\os2\_mtlib3s.lib
> +%2lib386\os2\_same3s.lib
@file %2_mkdllib.lbc
> +%2lib386\os2\_dllib3s.lib
> +%2lib386\os2\_same3s.lib
spawn %2binb\wlib -q -n -b %2lib386\os2\clibmt3s @%2_mkmtlib
spawn %2binb\wlib -q -n -b %2lib386\os2\clibdl3s @%2_mkdllib
@erase %2_mkmtlib.lbc
@erase %2_mkdllib.lbc
@erase %2lib386\os2\_mtlib3s.lib
@erase %2lib386\os2\_dllib3s.lib
@erase %2lib386\os2\_same3s.lib
skipos2_mtlib:
unpack %2lib386\ %1math3r.wpk
unpack %2lib386\ %1math387r.wpk
unpack %2lib386\ %1math3s.wpk
unpack %2lib386\ %1math387s.wpk
unpack %2lib386\ %1noemu387.wpk
if %win3tgt unpack %2binw\ %1filedll.win
if %doshost if %dos4g unpack %2bin\ %1dos4gw.wpk
if %doshost if %dos4g unpack %2bin\ %1pminfo.wpk
if %doshost if %dos4g unpack %2bin\ %1rminfo.wpk
if %dos4g unpack %2binb\ %1wstub.wpk
unpack %2binb\ %1bpatch.wpk
#
# install diskette #3
#
enter %1wvideo.dos disk 3, labelled "Debugger & Profiler Disk"
if %doshost unpack %2bin\ %1wvideo.dos
if %os2host unpack %2binp\ %1wvideo.os2
if %os2host unpack %2binp\ %1vidserv.os2
if %os2host unpack %2binp\dll\ %1vid_dll.wpk
if %os2host unpack %2binp\dll\ %1os2edit.dll
if %win3tgt unpack %2binw\ %1wvideow.win
if %win3tgt unpack %2binw\ %1wdebug.win
if %win3tgt unpack %2binw\ %1wemu387.win
if %win3tgt unpack %2binw\ %1vidserv.win
if %doshost unpack %2bin\ %1trap.wpk
if %doshost unpack %2bin\ %1trap386.wpk
if %doshost if %ads unpack %2bin\ %1adshelp.wpk
if %doshost if %pls unpack %2bin\ %1plshelp.wpk
if %doshost if %dos4g unpack %2bin\ %1rsihelp.wpk
if %doshost if %pls unpack %2bin\ %1dbglib.wpk
if %doshost unpack %2bin\ %1vidserv.dos
if %doshost unpack %2bin\ %1rfx.dos
if %os2host unpack %2binp\ %1rfx.os2
unpack %2binb\ %1vid_dbg.386
unpack %2binb\ %1vid_prs.wpk
unpack %2binb\ %1vid_help.wpk
if %wprof unpack %2binb\ %1wprof.wpk
if %wprof if %ecs unpack %2bin\ %1wsampecs.wpk
if %wprof if %pls unpack %2bin\ %1wsamppls.wpk
if %wprof if %dos4g unpack %2bin\ %1wsamprsi.wpk
if %wprof if %win3tgt unpack %2binw\ %1wsamplew.win
if %wprof if %os2tgt unpack %2binp\ %1wsampos2.wpk
if %wprof if %os2tgt unpack %2binp\ %1wsmpos22.os2
if %wprof unpack %2binb\ %1wprofhlp.wpk
if %doshost if %wprof unpack %2bin\ %1wconfig.wpk
if %doshost if %wprof unpack %2binb\ %1wconfigh.wpk
if %wprof unpack %2binb\ %1bench.wpk
if %wprof unpack %2binb\ %1infobnch.wpk
if %nlm unpack %2nlm\ %1novserv.nlp
if %nlm unpack %2nlm\ %1parserv.nlp
if %nlm unpack %2nlm\ %1serserv.nlp
if %nlm unpack %2nlm\ %1wsample.nlp
if %win3tgt unpack %2binw\ %1win386.win
if %win3tgt unpack %2binw\ %1w386dll.win
#
# install diskette #4
#
enter %1win31mwh.wpk disk 4, labelled "Windows SDK Disk 1"
if %doc unpack %2binw\ %1win31mwh.wpk
if %win3tgt unpack %2binw\ %1shed.wpk
if %win3tgt unpack %2binw\ %1shell.wpk
if %penw unpack %2binw\ %1penapiwh.wpk
if %win3tgt unpack %2binw\ %1mcistrwh.wpk
if %win3tgt unpack %2src\inc\ %1src_inc.wpk
if %win3tgt unpack %2binw\ %1winhelp.wpk
if %win3tgt unpack %2binw\ %1regload.wpk
if %win3tgt unpack %2binw\ %1vtd.wpk
if %penw unpack %2binw\ %1penwin.wpk
if %win3tgt unpack %2binw\ %1ddeml.wpk
if %win3tgt unpack %2binw\ %1dib.wpk
if %win3tgt unpack %2binw\ %1lzexpand.wpk
if %win3tgt unpack %2binw\ %1ole.wpk
if %win3tgt unpack %2binw\ %1stress.wpk
if %win3tgt unpack %2binw\ %1toolhelp.wpk
if %win3tgt unpack %2binw\ %1ver.wpk
if %penw unpack %2binw\ %1msmouse.wpk
if %penw unpack %2binw\ %1penwini.wpk
if %penw unpack %2binw\ %1vgap.wpk
if %penw unpack %2binw\ %1yesmouse.wpk
if %win3tgt unpack %2h\ %1win31hdr.wpk
if %win3tgt unpack %2h\ %1win3xhdr.wpk
if %win3tgt unpack %2binb\ %1rcpp.wpk
if %win3tgt unpack %2binb\ %1rc.wpk
if %win3tgt unpack %2binb\ %1mrbc.wpk
if %win3tgt unpack %2bin\ %1markmidi.wpk
unpack %2binb\ %1techinfo.wpk
#
# install diskette #5
#
enter %1hc30.wpk disk 5, labelled "Windows SDK Disk 2"
if %win3tgt unpack %2binb\ %1hc30.wpk
if %win3tgt unpack %2binb\ %1hc31.wpk
if %win3tgt unpack %2binw\ %1commdlg.lng
ifnot %win3tgt goto skip_commdlg
@copy %2binw\commdlg.por %2binw\commdlg.dan
@spawn %2binb\bpatch -p -b %2binw\cdlg_dan.dif -f %2binw\commdlg.dan
@erase %2binw\cdlg_dan.dif
@copy %2binw\commdlg.por %2binw\commdlg.dll
@spawn %2binb\bpatch -p -b %2binw\cdlg_dll.dif -f %2binw\commdlg.dll
@erase %2binw\cdlg_dll.dif
@copy %2binw\commdlg.por %2binw\commdlg.dut
@spawn %2binb\bpatch -p -b %2binw\cdlg_dut.dif -f %2binw\commdlg.dut
@erase %2binw\cdlg_dut.dif
@copy %2binw\commdlg.por %2binw\commdlg.fin
@spawn %2binb\bpatch -p -b %2binw\cdlg_fin.dif -f %2binw\commdlg.fin
@erase %2binw\cdlg_fin.dif
@copy %2binw\commdlg.por %2binw\commdlg.frn
@spawn %2binb\bpatch -p -b %2binw\cdlg_frn.dif -f %2binw\commdlg.frn
@erase %2binw\cdlg_frn.dif
@copy %2binw\commdlg.por %2binw\commdlg.ger
@spawn %2binb\bpatch -p -b %2binw\cdlg_ger.dif -f %2binw\commdlg.ger
@erase %2binw\cdlg_ger.dif
@copy %2binw\commdlg.por %2binw\commdlg.itn
@spawn %2binb\bpatch -p -b %2binw\cdlg_itn.dif -f %2binw\commdlg.itn
@erase %2binw\cdlg_itn.dif
@copy %2binw\commdlg.por %2binw\commdlg.nor
@spawn %2binb\bpatch -p -b %2binw\cdlg_nor.dif -f %2binw\commdlg.nor
@erase %2binw\cdlg_nor.dif
@copy %2binw\commdlg.por %2binw\commdlg.spa
@spawn %2binb\bpatch -p -b %2binw\cdlg_spa.dif -f %2binw\commdlg.spa
@erase %2binw\cdlg_spa.dif
@copy %2binw\commdlg.por %2binw\commdlg.swe
@spawn %2binb\bpatch -p -b %2binw\cdlg_swe.dif -f %2binw\commdlg.swe
@erase %2binw\cdlg_swe.dif
skip_commdlg:
if %penw unpack %2binw\ %1beditde.wpk
if %penw unpack %2binw\ %1heditde.wpk
if %win3tgt unpack %2binb\ %1wbind.wpk
if %doshost if %dos4g unpack %2bin\ %1privatxm.wpk
if %doshost unpack %2bin\ %1chkmouse.wpk
if %win3tgt unpack %2lib386\win\ %1clib3r.win
if %win3tgt unpack %2lib386\win\ %1clib3s.win
if %win3tgt unpack %2lib386\win\ %1emu387.win
if %wex unpack %2src\win\ %1build.wex
if %wex unpack %2src\win\alarm\ %1alarm.wex
if %wex unpack %2src\win\chart\ %1chart.wex
if %wex unpack %2src\win\datactl\ %1datactl.wex
if %wex unpack %2src\win\edit\ %1edit.wex
if %wex unpack %2src\win\filedll\ %1filedll.wex
if %wex unpack %2src\win\generic\ %1generic.wex
if %wex unpack %2src\win\helpex\ %1helpex.wex
if %wex unpack %2src\win\iconview\ %1iconview.wex
if %wex unpack %2src\win\life\ %1life.wex
if %wex unpack %2src\win\shootgal\ %1shootgal.wex
if %wex unpack %2src\win\watzee\ %1watzee.wex
if %win3tgt unpack %2binw\ %1windebug.win
if %sdk unpack %2src\dll\ %1dll.sdk
if %sdk unpack %2src\sdkpatch\ %1batch.sdk
if %sdk unpack %2src\sdkpatch\bitmap\ %1bitmap.sdk
if %sdk unpack %2src\sdkpatch\cliptext\ %1cliptext.sdk
if %sdk unpack %2src\sdkpatch\clock\ %1clock.sdk
if %sdk unpack %2src\sdkpatch\cursor\ %1cursor.sdk
if %sdk unpack %2src\sdkpatch\dde\ %1dde.sdk
if %sdk unpack %2src\sdkpatch\editcntl\ %1editcntl.sdk
if %sdk unpack %2src\sdkpatch\editfile\ %1editfile.sdk
if %sdk unpack %2src\sdkpatch\editmenu\ %1editmenu.sdk
if %sdk unpack %2src\sdkpatch\fileopen\ %1fileopen.sdk
if %sdk unpack %2src\sdkpatch\generic\ %1generic.sdk
if %sdk unpack %2src\sdkpatch\helpex\ %1helpex.sdk
if %sdk unpack %2src\sdkpatch\icon\ %1icon.sdk
if %sdk unpack %2src\sdkpatch\input\ %1input.sdk
if %sdk unpack %2src\sdkpatch\menu\ %1menu.sdk
if %sdk unpack %2src\sdkpatch\multipad\ %1multipad.sdk
if %sdk unpack %2src\sdkpatch\mypal\ %1mypal.sdk
if %sdk unpack %2src\sdkpatch\output\ %1output.sdk
if %sdk unpack %2src\sdkpatch\owncombo\ %1owncombo.sdk
if %sdk unpack %2src\sdkpatch\prntfile\ %1prntfile.sdk
if %sdk unpack %2src\sdkpatch\showfont\ %1showfont.sdk
if %sdk unpack %2src\sdkpatch\tty\ %1tty.sdk
if %pen unpack %2pen\ %1ppdebug.wpk
if %help unpack %2binb\ %1graphhlp.wpk
if %win3tgt unpack %2lib386\win\ %1win386.wpk
if %win3tgt unpack %2binw\ %1win386b.win
if %win3tgt unpack %2binw\ %1w386dllb.win
if %win3tgt unpack %2lib386\win\ %1win386b.wpk
if %os2tgt unpack %2.\ %1wimp.wpk
if %os2tgt unpack %2.\ %1os2386.wpk
if %os2tgt unpack %2binp\help\ %1watcomc.hpk
unpack %2src\goodies\ %1goodies.wpk
ifnot %doc goto skip_win31doc
#
# install diskette #1
#
enter %1w31h.pk0 disk labelled "Windows Help Disk 1"
unpack %2.\ %1w31h.pk0
@copy %2w31h.0 %2binw\win31wh.hlp
@erase %2w31h.0
unpack %2.\ %1w31h.pk1
@append %2w31h.1 %2binw\win31wh.hlp
@erase %2w31h.1
unpack %2.\ %1w31h.pk4
#
# install diskette #2
#
enter %1w31h.pk2 disk labelled "Windows Help Disk 2"
unpack %2.\ %1w31h.pk2
@append %2w31h.2 %2binw\win31wh.hlp
@erase %2w31h.2
unpack %2.\ %1w31h.pk3
@append %2w31h.3 %2binw\win31wh.hlp
@erase %2w31h.3
@append %2w31h4.0 %2binw\win31wh.hlp
@erase %2w31h4.0
unpack %2.\ %1w31h.pk5
@append %2w31h4.1 %2binw\win31wh.hlp
@erase %2w31h4.1
skip_win31doc:
ifnot %os2tgt goto skip_os2386lib
spawn %2wimp %2lib386\os2\os2386.lib %2os2386.lbc
@erase %2wimp.exe
@erase %2os2386.lbc
skip_os2386lib:
#
# install OS/2 header diskette
#
ifnot %os2tgt goto skip_os2hdr
enter %1os2hdr.wpk disk labelled "OS/2 Header Files"
unpack %2h\os2\ %1os2hdr.wpk
skip_os2hdr:
#
# create newconf.sys for DOS
#
file %2newconf.sys
> files=20
#
# create newconf.os2 for OS/2
#
file %2newconf.os2
> SET PATH=%2BINP;%2BINB
> LIBPATH=%2BINP\DLL
> SET HELP=%2BINP\HELP
> SET BOOKSHELF=%2BINP\HELP
> SET INCLUDE=%2H;%2H\OS2
> SET WATCOM=%2.
#
# create autoc386.bat
#
file %2autoc386.bat
> path %2bin;%2binb;%2binw
> set include=%2h
> set watcom=%2.
#
# create cdemo32.bat
#
file %2cdemo32.bat
> @echo off
> set __opath=%%path%%
> set path=%2bin;%2binb
> set __oinc=%%include%%
> set include=%2h
> set watcom=%2.
> wcl386 /l=dos4g %2src\calendar
> dos4gw calendar
> set include=%%__oinc%%
> set __oinc=
> set path=%%__opath%%
> set __opath=
#
# create graphics demo
#
file %2grdemo32.bat
> @echo off
> set __opath=%%path%%
> set path=%2bin;%2binb
> set __oinc=%%include%%
> set include=%2h
> set watcom=%2.
> wcl386 /l=dos4g %2src\grdemo
> dos4gw grdemo
> set include=%%__oinc%%
> set __oinc=
> set path=%%__opath%%
> set __opath=
#
file %2src\win\build.mif
> WIN386=1
#
# create Windows demo
#
file %2windemo.bat
> @echo off
> set __opath=%%path%%
> set path=%2bin;%2binb;%2binw
> set __oinc=%%include%%
> set include=%2h
> set watcom=%2.
> cd %2src\win\life
> wmake
> if errorlevel 1 goto errorexit
> ..\iswin
> if errorlevel 1 goto win
> set path=%%__opath%%
> win life
> goto exit
> :win
> echo Return to windows with ALT-ESCAPE.
> echo Select "File" from the program manager, and select
> echo the RUN option to run life
> goto exit
> :errorexit
> echo make did not work!
> :exit
> cd %2.
> set include=%%__oinc%%
> set __oinc=
> set path=%%__opath%%
> set __opath=
#
# create OS/2 2.0 demo
#
file %2os2demo.cmd
> @echo off
> set __opath=%%path%%
> set path=%2binp;%2binb
> set __oinc=%%include%%
> set include=%2h;%%include%%
> set watcom=%2.
> wcl386 /l=os2v2_pm %2src\shapes
> shapes
> set include=%%__oinc%%
> set __oinc=
> set path=%%__opath%%
> set __opath=
