@echo off
rem ...
rem ... InspectA installation batch file
rem ...
rem Real mode version

:SETLOCAL

set P=
set S=REM
set D=REM
set O=DOS

    if '%O%' == '' goto noEnv

    if '%1' == '-H' goto getHelp
    if '%1' == '-h' goto getHelp
    if '%1' == '/H' goto getHelp
    if '%1' == '/h' goto getHelp

    if '%1' == '-D' set D=
    if '%1' == '-d' set D=
    if '%1' == '/D' set D=
    if '%1' == '/d' set D=
    if '%1' == '-S' set S=
    if '%1' == '-s' set S=
    if '%1' == '/S' set S=
    if '%1' == '/s' set S=

    if not exist inspect%P%.exe goto noInspectA
    if not exist iconfig%P%.exe goto noInspectA
    if not exist config.%O%     goto noConfigs
%D% if not exist mailer.Dyn     goto noConfigs
%S% if not exist mailer.Sta     goto noConfigs

    iConfig%P% -c . -i config.%O%
%D% iConfig%P% -c . -i mailer.Dyn
%S% iConfig%P% -c . -i mailer.Sta

    echo.
    echo. Use InspectA to copy/move these to a convenient location!
    echo.

    inspect%P% -c .

    goto endAll

:noEnv
    echo.
    echo. There is insufficient environment space available for %0
    echo. Either increase your global environment space, or quit all
    echo. applications and run %0 from the first shell.
    goto endError

:noInspectA
    echo.
    echo. This installation batch file must be run on your hard drive
    echo. in the same directory as Inspect%P%.exe and IConfig%P%.exe
    goto endError

:noConfigs
    echo.
    echo. This installation batch file requires a template config file(s):
    echo.    - config.%O%
%D% echo.    - mailer.dyn
%S% echo.    - mailer.sta
    goto endError

:endError
    rem ... beep for good measure
    echo. 
    echo. %0 aborted.
:getHelp
    echo.
    echo. %0: usage:
    echo.
    echo.        %0 [-S] [-D] [-H]
    echo.
    echo.  Installs standard InspectA DOS or OS/2 configuration.
    echo.
    echo.  -H  issues this help message
    echo.  -S  includes a template config for STATIC (Opus/BT) systems
    echo.  -D  includes a template config for DYNAMIC (FD/InterMail/SEAdog) systems
    echo.
    pause
    goto endAll

:endAll
:ENDLOCAL

