home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
filefnd.zip
/
INSTALL.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-07-17
|
9KB
|
218 lines
/*rexx*/
/**********************************************************************/
/* Exec: Install utility */
/* Function: Install Heliotropic Systems, Inc. sharware */
/* History: 07/13/95 - LMK - Set up for FileFind */
/**********************************************************************/
/* */
"@ECHO OFF"
/* */
/* Ensure that you can use the REXXUTILs... */
/* */
if 0 < RxFuncQuery('SysLoadFuncs') then do
call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
end
/* */
/* Set up the global variables... */
/* */
bootdrive = translate(value('PATH',,'OS2ENVIRONMENT'))
thedrive = substr(bootdrive,pos('\OS2\SYSTEM',bootdrive)-2,2)
ObjMode = 'Replace'
returnRC = 0
/* */
/* Proceed with the installation... */
/* */
say ' '
say ' Installing FileFind Utility'
say ' '
call Drive_Check
result = VROBJ_Check()
if result \= 0 then
signal Done
result = File_Check()
if result \= 0 then
signal Done
result = Inst_Part1()
if result \= 0 then
signal Done
call Inst_Part2
call Create_Kit
call Create_FileFind
call Create_Register
call Create_Read
say ' '
say ' Installation completed.'
say ' '
Done:
EXIT
/* */
/* Determine all of the available Drive letters... */
/* */
Drive_Check:
all_drives = SysDriveMap(thedrive,'USED') /* can't see CD's empty!! */
i = 1
do forever
parse var all_drives d_letter.i all_drives
if all_drives = "" then
leave
i = i + 1
end
d_letter.0 = i
return
/* */
/* Check to see if there is a vrobj.dll to work with... */
/* */
VROBJ_Check:
say ' '
say ' Please wait while your system is checked for VROBJ.DLL...'
say ' '
dll_check = 0
do i = 1 to d_letter.0
say ' Checking Drive 'd_letter.i
saveRC = SysFileTree( d_letter.i || '\VROBJ.DLL', 'DLLs', 'FS' )
dll_check = dll_check + DLLs.0
if DLLs.0 > 0 then do
say ' VROBJ.DLL has been located.'
leave
end
end
if dll_check = 0 then do
say ' Warning: VROBJ.DLL was not found on this system! '
say ' You must download it and put it in your PATH to use FileFind.'
returnRC = 4
end
return returnRC
/* */
/* Make sure everything is here to work on... */
/* */
File_Check:
say ' '
say ' Checking to make sure all of the FileFind files are intact...'
say ' '
ifile.0 = 7
ifile.1 = 'filefind.exe'
ifile.2 = 'filefind.hlp'
ifile.3 = 'register.txt'
ifile.4 = 'file_id.diz'
ifile.5 = 'readme.1st'
ifile.6 = 'sun.ico'
ifile.7 = 'install.cmd'
do i = 1 to ifile.0 - 1
saveRC = SysFileTree( ifile.i, 'Files', 'F' )
if Files.0 = 0 then do
say ' Warning: 'ifile.i' was not found!'
say ' '
say ' All of the files are required for installation.'
say ' Use PKUNZIP again with the "-o" operand.'
returnRC = 4
leave
end
end
if returnRC = 0 then
say ' OK, everthing is intact.'
return returnRC
/* */
/* Find out where to put all of this... */
/* */
Inst_Part1:
UnPack_Dir = Directory()
say ' '
say ' Enter the complete name of the directory in which you want'
say ' FileFind installed (default: 'UnPack_Dir'):'
pull Install_Dir
if Install_Dir = "" then
Install_Dir = UnPack_Dir
/* */
/* If you need to, create the directory... */
/* */
saveRC = SysFileTree(Install_Dir, 'Dirs', 'D')
if Dirs.0 = 0 then do
if 0 < SysMkDir(Install_Dir) then do
say ' '
say ' Warning: Unable to create target directory.'
returnRC = 4
leave
end
end
say ' '
return returnRC
/* */
/* Install the puppy... */
/* */
Inst_Part2:
if Install_Dir \= UnPack_Dir then do
say ' Please wait will FileFind files are copied to 'Install_Dir'...'
do i = 1 to ifile.0
'@xcopy 'ifile.i Install_Dir || '\*.* > nul'
end
end
return
/* */
/* Create the folder for Heliotropic Systems... */
/* */
Create_Kit:
location = "<WP_DESKTOP>"
title = "Heliotropic^Systems^Utilities"
classname = "WPFolder"
SetupString = "OBJECTID=<WP_LMK_HSU>;"
SetupString = SetupString || "NOLINK=YES;"
SetupString = SetupString || "NOCOPY=YES;"
SetupString = SetupString || "NOPRINT=YES;"
SetupString = SetupString || "NORENAME=YES;"
SetupString = SetupString || "NOSHADOW=YES;"
SetupString = SetupString || "NOTDEFAULTICON=YES;"
SetupString = SetupString || "ICONFILE="Install_Dir"\SUN.ICO;"
call Make_Object
return
/* */
/* Create the object for FileFind */
/* */
Create_FileFind:
location = "<WP_LMK_HSU>"
title = "FileFind"
classname = "WPProgram"
SetupString = "OBJECTID=<LMK_HSU_FF>;"
SetupString = SetupString || "EXENAME="Install_Dir"\FileFind.EXE;"
SetupString = SetupString || "STARTUPDIR="Install_Dir";"
SetupString = SetupString || "PROGTYPE=PM;"
SetupString = SetupString || "AUTOCLOSE=YES;"
call Make_Object
return
/* */
/* Create the object for the registration form */
/* */
Create_Register:
location = "<WP_LMK_HSU>"
title = "Registration"
classname = "WPShadow"
SetupString = "OBJECTID=<LMK_HSU_REG>;"
SetupString = SetupString || "SHADOWID="Install_Dir"\Register.Txt;"
SetupString = SetupString || "AUTOCLOSE=YES;"
call Make_Object
return
/* */
/* Create the object for the readme file */
/* */
Create_Read:
location = "<WP_LMK_HSU>"
title = "Read Me First"
classname = "WPShadow"
SetupString = "OBJECTID=<LMK_HSU_1ST>;"
SetupString = SetupString || "SHADOWID="Install_Dir"\Readme.1st;"
SetupString = SetupString || "AUTOCLOSE=YES;"
call Make_Object
return
/* */
/* Build the objects for the desktop... */
/* */
Make_Object:
say ' '
say ' Creating 'title' at 'location' as 'classname
saveRC = 0
saveRC = SysCreateObject(classname,title,location,SetupString,ObjMode)
if saveRC \= 1 then
say ' Warning: Creation of new object returned 'saveRC
say ' '
return