@ECHO OFF
rem   dc2.bat
cd %3
md samples
if not "%1" == "U" goto SKIP4
if exist nc2.bat copy nc2.bat nc2bat.bak > nul:
if exist pe2.pro copy pe2.pro pe2pro.bak > nul:
:SKIP4
if exist c:\alley.k goto SKIP3
if exist %2alley.k copy %2alley.k c:\ > nul:
:SKIP3
%2systype
copy %2readme.* > nul:
if exist %2g2beta.sys copy %2g2beta.sys > nul:
cls
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO        Extracting INSTALLATION DISK #1 files
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
%2g2system -o > nul:
if not errorlevel 1 goto OK1
ECHO 
ECHO        ERROR EXTRACTING SYSTEM FILES...INSTALLATION ABORTED
ECHO 
goto EREND
:OK1
if exist nc2bat.bak copy nc2bat.bak nc2.bat > nul:
if exist nc2bat.bak del nc2bat.bak
cls
if exist %2disk2.000 goto OK5
ECHO 
ECHO 
ECHO 
:LOOP1
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO        Now insert INSTALLATION DISK #2 into drive %2
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
pause
if exist %2disk2.000 goto OK5
cls
ECHO 
ECHO        DID NOT FIND DISK 2 IN THE "%2" DRIVE...TRY AGAIN
ECHO 
goto LOOP1
:OK5
cls
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO        Extracting INSTALLATION DISK #2 files
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
%2g2util -o > nul:
if exist pe2pro.bak copy pe2pro.bak pe2.pro > nul:
if not errorlevel 1 goto OK2
ECHO 
ECHO        ERROR EXTRACTING UTILITY FILES...INSTALLATION ABORTED
ECHO 
goto EREND
:OK2
if exist pe2pro.bak del pe2pro.bak
if "%1" == "U" goto SKIP1
%2g2sample -o > nul:
if not exist %2g2post.exe goto OK3
if not exist g2sys.sys goto OK3
%2g2post -o > nul:
if not errorlevel 1 goto OK3
ECHO 
ECHO        ERROR EXTRACTING SAMPLE FILES...INSTALLATION WILL PROCEED
ECHO        HOWEVER THERE WILL BE NO POST PROCESSORS, TOOLING FILES
ECHO        PROTOCOL FILES, ENGRAVING FONTS OR OTHER SAMPLES INSTALLED
ECHO 
goto SKIP2
:OK3
if exist g2sys.sys del g2sys.sys
:SKIP2
if exist %2*.pmb copy %2*.pmb > nul:
cls
ECHO 
ECHO           Remove any INSTALLATION DISK from its drive
ECHO 
ECHO 
ECHO 
ECHO           In order to run GRAFX II system files on your hardware,
ECHO           you need to configure the software to run on the hardware
ECHO           you are using.
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
pause
g2config
cls
ECHO 
ECHO 
ECHO 
ECHO           Please stand by while the Post Processors are being
ECHO                       installed onto the system
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
inspost -s
cls
ECHO 
ECHO 
ECHO 
ECHO           Please stand by while the Tooling Files are being
ECHO                       installed onto the system
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
toolist -s
cls
ECHO 
ECHO 
ECHO 
ECHO         Please stand by while the job description list is built
extlist @geo
cls
ECHO 
ECHO 
ECHO           The installation is now complete
ECHO 
ECHO           The first document you should read is README.TXT located in
ECHO           the %3 directory. From DOS, Just type in README.
ECHO 
ECHO           BRACKET.geo and LATHE1.geo are sample programs for you to get
ECHO           started with.
ECHO 
ECHO           TO START GRAFX II Type the following: (WRITE THIS DOWN!)
ECHO 
ECHO                      CD %3 [Enter]
ECHO                      NC2 [Enter]
ECHO 
pause
goto END
:SKIP1
cls
ECHO 
ECHO 
ECHO           THIS INSTALLATION DISK contains:
ECHO        a) Sample Post Processors  (.PMB extension)
ECHO        b) Sample Tooling files    (.TLL extension)
ECHO        c) Sample Engraving fonts  (.VEC extension)
ECHO        d) Sample Geometry files   (.GEO extension)
ECHO        e) Sample Toolpath files   (.DMB extension)
ECHO        f) Sample Protocol files   (.CPL extension)
ECHO        g) Sample DXF Header file  (DXFHEAD.DXH)
ECHO 
ECHO        When updating an existing GRAFX II system, these files are
ECHO        installed into the %3\samples directory.  You may want to look
ECHO        at this directory and use the DOS copy command to copy whatever
ECHO        files you want to be installed on the system up to the %3
ECHO        directory.
ECHO 
ECHO        Ready to copy samples into %3\SAMPLES
ECHO 
ECHO 
pause
cd samples
cls
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO        Extracting SAMPLES
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
ECHO 
%2g2sample -n -o > nul:
if not exist %2g2post.exe goto OK4
if not exist %3\g2sys.sys goto OK4
%2g2post -n -o > nul:
if not errorlevel 1 goto OK4
ECHO 
ECHO        ERROR EXTRACTING SAMPLE FILES...INSTALLATION WILL PROCEED
ECHO        HOWEVER THERE WILL BE NO NEW POST PROCESSORS, TOOLING FILES
ECHO        PROTOCOL FILES, ENGRAVING FONTS OR OTHER SAMPLES INSTALLED
ECHO 
:OK4
if exist %2*.pmb copy %2*.pmb > nul:
cd %3
if exist g2sys.sys del g2sys.sys
g2config -cp
ECHO 
ECHO           Remove any INSTALLATION DISK from its drive
ECHO 
ECHO        The first document you should read is README.TXT located in
ECHO        the %3 directory. From DOS, Just type in README.
ECHO 
ECHO        The installation is now complete, to start GRAFX II
ECHO           Type NC2 followed by [Enter]
ECHO 
pause
:END
cls
:EREND
ECHO ON
