/* Pre-installation script */
'@echo off'
'cls'

call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'

curdir = directory();
if RIGHT( curdir, 1 ) <> "\" then
    curdir = curdir||'\'

/* Is 'disk.1' in current directory? */
call SysFileTree curdir||'disk.1', 'file', 'F'
if file.0 = 0 then do
    say "File 'disk.1' not found."
    say 'Install.cmd must be started from source drive.'
    say ''
    exit 0;
end;


tmpdir = ''
if curdir <> 'A:\' & curdir <> 'B:\' then
   tmpdir = curdir;
else
   do
     env = 'OS2ENVIRONMENT'
     tmpdir = value( 'tmp',,env );
   
     if tmpdir = '' then do
       tmpdir = value( 'temp',,env );
       if tmpdir = '' then
          tmpdir = 'C:\'
     end;
   end;

say 'Source directory:    '||curdir
say 'Temporary directory: '||tmpdir;
say ''

newdir = directory( tmpdir );
curdir||'disk.1 -o -C pmpninst.exe g21aoi2d.dll gcrtoi1d.dll gcrtoi2d.dll'

'pmpninst.exe '||curdir;

say ''
say 'Cleaning up ...'
'del pmpninst.exe'
'del g21aoi2d.dll'
'del gcrtoi1d.dll'
'del gcrtoi2d.dll'

