{$M 4096,0,4096}
{$X+}


USES DOS, Crt, LibFile, Devices;

CONST
  MainFile='PUMP.EXE';
  VtoFileSpec='C:\PUMP.VTO';
  MINIMUM_MEM=575000;

VAR
  f:file;

Procedure CheckMem;
Var Mem:Word;
Begin
  asm
    mov ah,48h
    mov bx,0ffffh
    int 21h
    mov Mem,bx
  end;
  If LongInt(Mem)*16<MINIMUM_MEM then Begin
     Writeln('Insufficient Memory to run this program.');
     Writeln('Try to get more conventional memory');
     Halt(1);
  End;
End;

BEGIN
    { Memoria }
    {CheckMem;}

    { Borrar el VTO si existe }
    Assign(f, VtoFileSpec);
    {$I-}
    Reset(f);
    {$I+}
    if Ioresult = 0 then
      Erase(f);

    { Ejecutar el setup }
    FicheroExe := MainFile;
    CommandLine := '';
    ExecFile(LF_FindFile('SETUP.EXE')^.offs);

    { Si existe el VTO, ejecutar }
    Assign(f, VtoFileSpec);
    {$I-}
    Reset(f);
    {$I+}
    if IOResult = 0 THEN BEGIN
      Close(f);
      { Ejecutar PUMP.EXE a trav‚s de SHELL.EXE }
      FicheroExe := MainFile;
      CommandLine := '@'+ VtoFileSpec;
{      ExecFile(LF_FindFile('DEMOVT.EXE')^.offs);}
      Exec('DEMOVT.DAT',CommandLine);
      Assign(f, VtoFileSpec);
      Erase(f);
      Writeln('(c) 1995 Iguana.')
    END
END.
