 REM -- PGH2U300.BAT/PGSETUP.BAT - H2 300+ UPD MOTO-CONCEPT /PGOBASIC../PPW
 REM --   ..2002NOV13PE/2005JAN10PE/2005DEC21PE(S3)/2006JAN19PE/2006JUL01PE
 REM --                                                       ..2007APR03PE
 ECHO Off
 REM -- COPYRIGHT (C) 1997-2007 H.W.PETER, WUPPERTAL .DE --
 REM -- COPYRIGHT (C) 1997-2007 PETER+GEISENDORF GMBH, SPROCKHOEVEL .DE --

 REM 6789.123456789.123456789.123456789.123456789.123456789.123456789.12345
 REM ----------------------------------------------------------------------


 rem -- %0=PGSETUP.BAT  %1=GEN  %2=DSTDRV:[\DSTPATH]  %3=SRCDRV:[\SRCPATH]
 rem --  %4=[\DSTDIR]\
 rem -- defaults -2004DEC21PE-
 rem -- no parameters: GEN C: .  \PGOFFICE\
 rem --            . denotes actual context from Setup entry
 rem --            (size wont fit on one single diskette)
 rem -- one parameter: GEN %1=destin.drv .  \PGOFFICE\
 rem **            or: GEN %1=destin.drv A: \PGODIR\
 rem **            or: GEN %1=destin.drv A: \

:ENTRY1
 rem -- process %1=OPCODE --
 IF     "%1"=="GEN"                  GOTO ENTRY18
        %0 GEN %1 %2 %3 %4 %5 %6 %7 %8 %9
        EXIT
:ENTRY18

:ENTRY2
 rem -- process %2=DSTDRV:[\DSTPATH] --
 IF NOT "%2"==""                     GOTO ENTRY28
        %0  %1 C: .
        EXIT
:ENTRY28

:ENTRY3
 rem -- process %3=SRCDRV:[\SRCPATH] --
 IF NOT "%3"==""                     GOTO ENTRY38
        %0  %1 %2 .
        EXIT
:ENTRY38

:ENTRY4
 rem -- process %4=[\DSTDIR]\ --
 IF NOT "%4"==""                     GOTO ENTRY48
 IF     EXIST   %2\PGOFFICE\PGO*.ICO GOTO ENTRY41
 IF     EXIST   %2\PGODIR\PGO*.ICO   GOTO ENTRY42
 IF     EXIST   %2\PGO*.ICO          GOTO ENTRY43
:ENTRY41
        %0  %1 %2 %3 \PGOFFICE\
        EXIT
:ENTRY42
        %0  %1 %2 %3 \PGODIR\
        EXIT
:ENTRY43
        %0  %1 %2 %3 \
        EXIT
:ENTRY48

 REM 
 REM -- PGH2U300.BAT/PGSETUP.BAT - setup for source check --

:ENTRY5
:ENTRY50
ECHO --
ECHO -- CHECKING DISK READABILITY (H2U300) - PLEASE WAIT --
ECHO -- IF ERRORS ARE INDICATED, CANCEL BY CTRL-C, AND UNLOAD DISK --
ECHO --
ECHO --
ECHO -- LESE-PRUEFUNG DER DISKETTE (H2U300) - BITTE ETWAS GEDULD --
ECHO -- BEI FEHLER-ANZEIGE DISKETTE ENTLADEN, MIT STRG-C/CTRL-C ABBRECHEN --
ECHO --
 DIR    %3\
 COPY   %3\*.*   NUL:
 IF ERRORLEVEL 1   GOTO SORRY
 CLS
ECHO --
ECHO -- THIS DISK APPEARS TO BE READABLE OK --
ECHO --
ECHO -- DIE DISKETTE ERSCHEINT LESBAR --
ECHO --
 rem -- ECHO -- %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 --
 rem -- ECHO --


 IF      EXIST %2%4*.*               GOTO SETUP
 IF     "%4"=="\PGOFFICE\"           GOTO RERUN
ECHO --
ECHO -- MOTO-CONCEPT INSTALLATION NOT FOUND (H2U300) - PLEASE REPORT SOON --
ECHO --
ECHO -- MOTO-CONCEPT INSTALLATION NICHT ERKANNT (H2U300) - - BITTE MELDEN --
ECHO --
ECHO --
ECHO --                                                  www.pgoffice.com --
ECHO --
GOTO ENDUP

:SORRY
ECHO --
ECHO -- THIS DISK IS NOT OK (H2U300) -     - PLEASE ACQUIRE A REPLACEMENT --
ECHO --
ECHO -- DIESE DISKETTE IST NICHT OK (H2U300) - - BITTE SOFORT NEU ABRUFEN --
ECHO --
ECHO --
ECHO --                                                  www.pgoffice.com --
ECHO --
GOTO ENDUP

:SETUP

 REM 
 REM -- PGH2U300.BAT/PGSETUP.BAT - setup for /pgoffice (client) stdd update --

 IF     "%4"=="\"                    GOTO SETMDI8
 IF     EXIST   %2\PGIMPORT\*.*      GOTO SETMDI8
 IF     EXIST   %2\PGIMPORT\NUL      GOTO SETMDI8
 IF     EXIST   %2\PGIMPORT\NUL:     GOTO SETMDI8
        MD      %2\PGIMPORT
:SETMDI8
 IF     "%4"=="\"                    GOTO SETMDX8
 IF     EXIST   %2\PGEXPORT\*.*      GOTO SETMDX8
 IF     EXIST   %2\PGEXPORT\NUL      GOTO SETMDX8
 IF     EXIST   %2\PGEXPORT\NUL:     GOTO SETMDX8
        MD      %2\PGEXPORT
:SETMDX8

:SETW95

 IF     EXIST %2%4H2$31?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$32?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$33?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$34?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$35?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$36?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$37?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$38?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$39?.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$4??.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$5??.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$6??.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$7??.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$8??.PGO        GOTO SETCZ
 IF     EXIST %2%4H2$9??.PGO        GOTO SETCZ



 IF     EXIST %2%4H2$280.PGO        GOTO SETSV
 IF     EXIST %2%4H2$281.PGO        GOTO SETSV
 IF     EXIST %2%4H2$282.PGO        GOTO SETSV
 IF     EXIST %2%4H2$283.PGO        GOTO SETSV
 IF     EXIST %2%4H2$284.PGO        GOTO SETSV
 IF     EXIST %2%4H2$290.PGO        GOTO SETSV
 IF     EXIST %2%4H2$29?.PGO        GOTO SETSV
 IF     EXIST %2%4H2$300.PGO        GOTO SETSV

 IF     EXIST %2%4H2$0??.*          GOTO SETCX
 IF     EXIST %2%4H2$1??.*          GOTO SETCX
 IF     EXIST %2%4H2$2??.*          GOTO SETCX
 IF     EXIST %2%4H2$3??.*          GOTO SETCX
 IF     EXIST %2%4H2$4??.*          GOTO SETCX
 IF     EXIST %2%4H2$5??.*          GOTO SETCX
 IF     EXIST %2%4H2$6??.*          GOTO SETCX
 IF     EXIST %2%4H2$7??.*          GOTO SETCX
 IF     EXIST %2%4H2$8??.*          GOTO SETCX
 IF     EXIST %2%4H2$9??.*          GOTO SETCX

:SETCL
ECHO --
ECHO -- GEN/UPD MOTO-CONCEPT CLIENT - OK --
ECHO --
GOTO RERUN

 REM 
 REM -- PGH2U300.BAT/PGSETUP.BAT - setup for /pgoffice - update denied --

:SETCX
 IF     EXIST %2%4H2$0??.*          DIR   %2%4H2$0??.*
 IF     EXIST %2%4H2$1??.*          DIR   %2%4H2$1??.*
 IF     EXIST %2%4H2$2??.*          DIR   %2%4H2$2??.*
 IF     EXIST %2%4H2$3??.*          DIR   %2%4H2$3??.*
 IF     EXIST %2%4H2$4??.*          DIR   %2%4H2$4??.*
 IF     EXIST %2%4H2$5??.*          DIR   %2%4H2$5??.*
 IF     EXIST %2%4H2$6??.*          DIR   %2%4H2$6??.*
 IF     EXIST %2%4H2$7??.*          DIR   %2%4H2$7??.*
 IF     EXIST %2%4H2$8??.*          DIR   %2%4H2$8??.*
 IF     EXIST %2%4H2$9??.*          DIR   %2%4H2$9??.*
ECHO --
ECHO -- PREVIOUS PGM VERSION/SERVER NOT FOUND (H2U300) -  PLEASE REPORT SOON --
ECHO --
ECHO --
ECHO -- LETZTE PGM-VERSION/SERVER NICHT ERKANNT (H2U300) - BITTE BALD MELDEN --
ECHO --
ECHO --
ECHO --                                                     www.pgoffice.com --
ECHO --
GOTO ENDUP

:SETCZ
 IF     EXIST %2%4H2$0??.*          DIR   %2%4H2$0??.*
 IF     EXIST %2%4H2$1??.*          DIR   %2%4H2$1??.*
 IF     EXIST %2%4H2$2??.*          DIR   %2%4H2$2??.*
 IF     EXIST %2%4H2$3??.*          DIR   %2%4H2$3??.*
 IF     EXIST %2%4H2$4??.*          DIR   %2%4H2$4??.*
 IF     EXIST %2%4H2$5??.*          DIR   %2%4H2$5??.*
 IF     EXIST %2%4H2$6??.*          DIR   %2%4H2$6??.*
 IF     EXIST %2%4H2$7??.*          DIR   %2%4H2$7??.*
 IF     EXIST %2%4H2$8??.*          DIR   %2%4H2$8??.*
 IF     EXIST %2%4H2$9??.*          DIR   %2%4H2$9??.*
ECHO --
ECHO -- FOUND NEWER PGM VERSION/SERVER (H2U300) -  - NO UPDATE OR CHANGES --
ECHO --
ECHO --
ECHO -- NEUERE PGM-VERSION/SERVER ERKANNT (H2U300) - KEINE AKTUALISIERUNG --
ECHO --
GOTO ENDUP

 REM 
 REM -- PGH2U300.BAT/PGSETUP.BAT - setup for /pgoffice (server) update --

:SETSV
ECHO --
ECHO -- GEN/UPD MOTO-CONCEPT SERVER --
ECHO --
 IF     EXIST %2%4PGOALL.PGO     DEL %2%4PGOALL.PGO
 ECHO A>      %2%4PGOALL.PGO

 IF NOT EXIST %3\LHA.EXE             GOTO SETSV$1
 IF     EXIST %2%4SX*.EXE        DEL %2%4SX*.EXE
 FOR %%A IN  (%3\SX*.PGO)    DO COPY /B %%A            %2%4SX*.EXE
 FOR %%A IN  (%2%4SX*.EXE)   DO      %3\LHA.EXE E /M /C   %%A %2%4
 rem -- FOR %%A IN  (%2%4SX*.EXE)    DO %%A <%2%4PGOALL.PGO
:SETSV$1
 IF     EXIST %2%4SX*.EXE        DEL %2%4SX*.EXE

 IF NOT EXIST %3\LHA.EXE             GOTO SETSV$2
 IF     EXIST %2%4S3*.EXE        DEL %2%4S3*.EXE
 FOR %%A IN  (%3\S3*.PGO)    DO COPY /B %%A            %2%4S3*.EXE
 FOR %%A IN  (%2%4S3*.EXE)   DO      %3\LHA.EXE E /M /C   %%A %2%4
 rem -- FOR %%A IN  (%2%4S3*.EXE)    DO %%A <%2%4PGOALL.PGO
:SETSV$2
 IF     EXIST %2%4S3*.EXE        DEL %2%4S3*.EXE

 IF     EXIST %3\A*.*           COPY %3\A*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\B*.*           COPY %3\B*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\C*.*           COPY %3\C*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\D*.*           COPY %3\D*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\G*.*           COPY %3\G*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\H*.*           COPY %3\H*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\U*.*           COPY %3\U*.*         %2%4*.*          /V <%2%4PGOALL.PGO
 IF     EXIST %3\PGOGEN.BAT     COPY %3\PGOGEN.BAT   %2%4PGOGENH2.300 /V <%2%4PGOALL.PGO

 IF     EXIST %2%4PGOFFICE.EXE       GOTO SETSV$8
 IF     EXIST %2%4PGOffice.BAT   DEL %2%4PGOffice.BAT
 IF     EXIST %2%4PGOFFICE.NCX   DEL %2%4PGOFFICE.NCX
 IF     EXIST %2%4PGOFFICE.PGO   DEL %2%4PGOFFICE.PGO
:SETSV$8

 IF NOT "%4"=="\PGODIR\"             GOTO SETSV$B8
 IF NOT EXIST %2%4PGOBASIC.EXE       GOTO SETSV$B8
 IF     EXIST %2%4PGOGENH2.2?F       GOTO SETSV$B8
 IF     EXIST %2%4PGOGENH2.3?F       GOTO SETSV$B8
 IF     EXIST %3\PGOBINGO.*     COPY %3\PGOBINGO.*   %2%4PGOBASIC.*   /V <%2%4PGOALL.PGO
 IF     EXIST %3\PGOBASIC.*     COPY %3\PGOBASIC.*   %2%4PGOBASIC.*   /V <%2%4PGOALL.PGO
:SETSV$B8

 IF NOT "%4"=="\PGODIR\"             GOTO SETSV$F8
 IF NOT EXIST %2%4PGOFFICE.EXE       GOTO SETSV$F8
 IF     EXIST %2%4PGOGENH2.2?F       GOTO SETSV$F8
 IF     EXIST %2%4PGOGENH2.3?F       GOTO SETSV$F8
 IF     EXIST %3\PGOBINGO.*     COPY %3\PGOBINGO.*   %2%4PGOFFICE.*   /V <%2%4PGOALL.PGO
 IF     EXIST %3\PGOFFICE.*     COPY %3\PGOFFICE.*   %2%4PGOFFICE.*   /V <%2%4PGOALL.PGO
:SETSV$F8

 IF NOT "%4"=="\PGOFFICE\"           GOTO SETSV$W8
 IF NOT EXIST %2%4PGOFFICE.EXE       GOTO SETSV$W8
 rem OT EXIST %2%4PGOGENH2.2?F       GOTO SETSV$W8
 rem OT EXIST %2%4PGOGENH2.3?F       GOTO SETSV$W8
 IF     EXIST %3\PGOWINGO.*     COPY %3\PGOWINGO.*   %2%4PGOFFICE.*   /V <%2%4PGOALL.PGO
 IF     EXIST %3\PGOWINGO.*     COPY %3\PGOWINGO.*   %2%4PGOFFICE.*   /V <%2%4PGOALL.PGO

 IF NOT EXIST %3\PGOJRX\*.*          GOTO SETSV$W8
 rem -- remove subdir PGOJRX; issue WNT.RD stmt first, W9X.DELTREE stmt 2nd
 IF NOT EXIST %2%4PGOJRX\            GOTO SETSV$W2
        ECHO J | RD                  %2%4PGOJRX\      /S
        GOTO SETSV$W2
:SETSV$W2
 IF NOT EXIST %2%4PGOJRX\            GOTO SETSV$W4
        ECHO J | DELTREE             %2%4PGOJRX\
        GOTO SETSV$W4
:SETSV$W4
 IF NOT EXIST %3\PGOJRX\*.*          GOTO SETSV$W6
        XCOPY %3\PGOJRX\*.*          %2%4PGOJRX\*.*   /S/E/V/H/R
        GOTO SETSV$W6
:SETSV$W6
:SETSV$W8

 REM 
 REM -- PGH2U300.BAT/PGSETUP.BAT - final --

 IF     EXIST %2%4PGOBINGO.*     DEL %2%4PGOBINGO.*
 IF     EXIST %2%4PGOWINGO.*     DEL %2%4PGOWINGO.*
 IF     EXIST %2%4PGOGEN.BAT     DEL %2%4PGOGEN.BAT
 IF     EXIST %2%4PGOALL.PGO     DEL %2%4PGOALL.PGO

 IF     EXIST %2%4PGOBASIC.DXA   DEL %2%4PGOBASIC.DXA
 IF     EXIST %2%4PGOFFICE.DXA   DEL %2%4PGOFFICE.DXA

 IF NOT EXIST %2%4A$NEWS.PGO         GOTO SETSV$Z
 rem -- (nomore=auto): IF EXIST   PGOBEG.BAT        PGOBEG.BAT
:SETSV$Z


:RERUN
 rem -- repeat if \PGOFFICE and \PGODIR directories coexist --
:RERUN2
 IF NOT "%4"=="\PGOFFICE\"           GOTO RERUN28
 IF NOT EXIST %2\PGODIR\PGO*.ICO     GOTO RERUN28
        %0  %1 %2 %3 \PGODIR\
        EXIT
:RERUN28

ECHO --                                                             --
ECHO --      OK - PLEASE START MOTO-CONCEPT (SERVER/T1) NOW.        --
ECHO --                                                             --
ECHO --                                                             --
ECHO --      OK - BITTE JETZT MOTO-CONCEPT (SERVER/T1) STARTEN.     --
ECHO --                                                             --
GOTO ENDUP


 rem -- (2002MAY30PE): leave DOSBOX open to show/read latest msg (no final EXIT stmt) --
:ENDUP
 %2
 IF     EXIST %2%4H2XCOM.BAT         %2%4H2XCOM.BAT XXX
REM 