echo off
cls
if not "%1"=="" goto ok
echo.
echo  PocketD installation.
echo.
echo  USAGE:	INSTALL pathname
echo  where "pathname" is the drive or directory to install PocketD (can be shared)
echo.
echo  e.g. INSTALL C:
echo       INSTALL C:\POCKETD\
echo       INSTALL \UTILS\		(Sharing with other utilities)
echo.
echo  or   INSTALL C:\POCKETD\ /u	(To un-install PocketD from directory)
echo.
echo  Choose where you want to install PocketD and re-run INSTALL
echo.
goto exit2

:ok
cls

if exist install.bat goto start
echo ERROR! The INSTALL program must be run from the installation drive
goto exit

:start
if NOT "%2"=="/u" goto inst
D	/Yny/ /'//&W PocketD can be uninstalled from a directory shared with other software.// Proceed with Uninstall ?&w'
if not errorlevel 2 goto exit2
d	%1/:=.%1d.exe/zzh
if not errorlevel 1 echo  Nothing to do...
goto exit

:inst
d	/FK:=.d.exe[The complete installation requires $S$B$B$Bk (only D.EXE (31k) is essential).]?
d	/Yny /'/&WPocketD Installation&w//Install (31k) &WD.EXE&w executable program ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help1
d	d.exe /ccfq %1
:help1
d	/Yny /'/Install (37k) &WMENUD.EXE&w executable program ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help1b
d	menud.exe /ccfq %1
:help1b
d	/Yny /'/Install ( 7k) &WSETCOL.EXE&w color config program ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help1c
d	setcol.exe /ccfq %1
:help1c
d	/Yny /'/Install ( 2k) &WD.HLP&w on-line one-page help ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help2
d	d.hlp /ccfq %1
:help2
d	/Yny /'/Install (56k) &WD.MAN&w on-line reference manual ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help3
d	d.man /ccfq %1
:help3
d	/Yny /'/Install (50k) &WD.GDE&w on-line guide ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help4
d	d.gde /ccfq %1
:help4
d	/Yny /'/Install ( 9k) D.EXE pre-prepared &WBAT&w Utilities ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help5
d	.bat /- demo.bat /ccfql %1
:help5
d	/Yny /'/Install (12k) &WDEMO.BAT&w ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto help5b
d	demo.bat /ccfq %1
:help5b
d	/Yny /'/Install (29k) &WREADME&w files ? (Y@/N)'
if not errorlevel 1 goto abort
if not errorlevel 2 goto exit
d	.DOC FILE_ID.DIZ PACKING.LST README.1ST README.D ORDER.FRM /:=.d.exe /ccfql %1
goto exit

:abort
echo.
echo Installation Aborted...
echo.
:exit
d	%1/:=.d.exe [// Total installation: $F files, size $S bytes, using $U bytes////][// Nothing Currently Installed////]KJ
:exit2
