home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 9 Archive
/
09-Archive.zip
/
afe_t11.zip
/
AFET-INS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-09-30
|
5KB
|
232 lines
/* AFExT 1.1 Installation Process */
'@echo off'
call rxfuncadd sysloadfuncs,rexxutil,sysloadfuncs
call sysloadfuncs
call SysCls
Say '';Say ''
Say ' AFE xT INSTALLATION !';Say '';say ''
/* check for presence of required files */
exeu=Stream('afeut.exe','c','query exists')<>''
exea=Stream('afeat.exe','c','query exists')<>''
icou=Stream('afeut.ico','c','query exists')<>''
icoa=Stream('afeat.ico','c','query exists')<>''
cfg=Stream('afet-cfg.exe','c','query exists')<>''
dll=Stream('vrobj.dll','c','query exists')<>''
if exeu=0 then do
say ' Can not find AFEuT.EXE !';exit
end
if exea=0 then do
say ' Can not find AFEaT.EXE !';exit
end
if icou=0 then do
say ' Can not find AFEuT.ICO !';exit
end
if icoa=0 then do
say ' Can not find AFEaT.ICO !';exit
end
if cfg=0 then do
say ' Can not find AFET-CFG.EXE !';exit
end
if dll=0 then do
say ' Can not find VROBJ.DLL !';exit
end
Say ' Will copy programs to correct drive/directory and create a'
say ' desktop objects...';say '';say ''
/* get the path to install AFExT files */
Say ' Give me the full pathname where you want AFExT installed,'
Say ' including the drive.';say '';say ' Example: d:\bin\afe'
say ''
pull pathname
if pathname='' then do
say '';say ' No path specified !'
exit
end
/* if the user appended a "\" at the end of his path we don't want it */
if right(pathname,1)=="\" then do
pathlength=length(pathname)
pathlength=pathlength-1
newafepath=substr(pathname,1,pathlength)
pathname=newafepath
end
/* however, if it's the root directory we do want the "\" */
if right(pathname,1)==":" then do
pathname=''pathname'\'
end
/* make sure it's a real path */
call SysFileTree pathname,'file','d'
if file.0=0 then do
rc=SysMkDir(''pathname'')
if rc>0 then do
say '';say ' Path does not exist and can not be created !'
exit
end
end
call SysCls
say '';say ' Copying files...'
/* if we appended a "\" we now need to remove it */
if right(pathname,1)=="\" then do
pathlength=length(pathname)
pathlength=pathlength-1
newafepath=substr(pathname,1,pathlength)
pathname=newafepath
end
/* if there are already AFE files there let's make sure that they
can be overwritten */
over=Stream(''pathname'\afe*','c','query exists')<>''
if over>0 then do
call SysFileTree ''pathname'\afe*','files','f','*-*+*','-----'
/* if there is an old AFET.INI get rid of it */
if Stream(''pathname'\afet.ini','c','query exists')<>'' then do
call SysFileDelete ''pathname'\afet.ini';end
end
/* if this is the root we need that trailing "\" */
if right(pathname,1)==":" then do
pathname=''pathname'\'
end
/* copy the files */
'copy afeut.exe 'pathname''
'copy afeat.exe 'pathname''
'copy afeut.ico 'pathname''
'copy afeat.ico 'pathname''
'copy afet-cfg.exe 'pathname''
/* need to get rid of that trailing "\" again */
if right(pathname,1)=="\" then do
pathlength=length(pathname)
pathlength=pathlength-1
newafepath=substr(pathname,1,pathlength)
pathname=newafepath
end
call SysCls;say '';say ' Done!';SAY '';say ' Now I need a place to put the DLL';say ''
say ' Give me a full pathname (must be in your CONFIG.SYS LIBPATH statement)';say ''
say ' Example: c:\os2\dll'
say ''
/* now get the path to put the DLL file */
pull DLLpath
if dllpath='' then do
say '';say ' No path specified !'
exit
end
if right(DLLpath,1)=="\" then do
pathlength=length(DLLpath)
pathlength=pathlength-1
newDLLpath=substr(DLLpath,1,pathlength)
DLLpath=newDLLpath
end
if right(DLLpath,1)==":" then do
DLLpath=''DLLpath'\'
end
call SysFileTree dllpath,'file','d'
if file.0=0 then do
say ' Path does not exist !';exit;end
call SysCls
say '';say ' Copying files...'
if right(DLLpath,1)=="\" then do
pathlength=length(DLLpath)
pathlength=pathlength-1
newDLLpath=substr(DLLpath,1,pathlength)
DLLpath=newDLLpath
end
over=Stream(''DLLpath'\vrobj.dll','c','query exists')<>''
if over>0 then do
call SysFileTree ''DLLpath'\vrobj.dll','files','f','*-*+*','-----'
end
if right(DLLpath,1)==":" then do
DLLpath=''DLLpath'\'
end
'copy vrobj.dll 'dllpath''
call SysCls;say '';say ' Done!';say ''
Say ' Now creating Desktop objects...'
/* create a desktop objects for AFExT */
classname='WPProgram'
title='AFE aTiny 1.0'
location='<WP_DESKTOP>'
setup='MINIMIZED=YES;PROGTYPE=PM;EXENAME='pathname'\AFEAT.EXE;OBJECTID=<WP_DESKTOP_AFEAT>;ICONFILE='pathname'\AFEAT.ICO;STARTUPDIR='pathname';'
result=SysCreateObject(classname,title,location,setup,'r')
If result<>1 Then signal notcreated
classname='WPProgram'
title='AFE uTiny 1.0'
location='<WP_DESKTOP>'
setup='MINIMIZED=YES;PROGTYPE=PM;EXENAME='pathname'\AFEUT.EXE;OBJECTID=<WP_DESKTOP_AFEUT>;ICONFILE='pathname'\AFEUT.ICO;STARTUPDIR='pathname';'
result=SysCreateObject(classname,title,location,setup,'r')
If result<>1 Then signal notcreated
call SysCls
say '';say ' Objects created!';Say '';Say ' All done!';SAY ''
say ' The AFExT program objects are installed on your desktop.'
say '';say '';say ' Ready to start AFExT Configuration...'
say '';say ''
'pause'
/* start the program */
call SysCls
call syssetobjectdata '<WP_DESKTOP_AFEAT>','open=default'
'exit'
end
notcreated:
call SysCls
say '';say ' Not created! Return code='result
exit
end