home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: WPS_PM
/
WPS_PM.zip
/
fih113.zip
/
install.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-06-07
|
7KB
|
277 lines
/* Icon Heaven installation script */
/* (C)Copyright 1993-1996 by The Frobozz Magic Software Company */
Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
Call SysLoadFuncs
ver = '1.13'
app = 'IHeaven'
key = 'INSTDIR'
'@echo off'
Call SysCls
say 'Icon Heaven installation utility version 'ver
say '(C)Copyright 1993-1996 by the Frobozz Magic Software Company'
/* check to see if Icon Heaven is installed, if so update it */
res = SysIni(, app, key)
if res <> 'ERROR:' then do
instdir = res
call update
exit
end
ini = value('USER_INI',,'OS2ENVIRONMENT')
tDrive = left(ini,1)
instdir=tDrive':\IHeaven'
dll=tDrive':\os2\dll\fim.dll'
res=stream(dll,'c','query exists')
if res<>'' then do
call update100
exit
end
cur = directory()
prompt = 'Press [enter] to install in the default directory ['instdir']'
current = 0
if left(cur,1) >= 'C' then do
instdir = cur
prompt = 'Press [enter] to install in the current directory'
current = 1
end
say 'Please enter the path where Icon Heaven will be installed'
say prompt
pull newdir
if newdir <> '' then do
current = 0
instdir = newdir
end
if length(instdir) = 3 then do
if substr(instdir,3,1) ='\' then
instdir = left(instdir,2)
end
say 'Icon Heaven will be installed in ['instdir']'
'pause'
if \current then do
res = mkdir(instdir)
if res <> 0 then do
say 'The directory ['instdir'] you specified cannot be created'
say 'installation aborted'
exit
end
/* say 'copying fim.dll to 'instdir */
'copy fim.ico 'instdir' >nul'
'copy fim.dll 'instdir' >nul'
end
retval = SysCreateObject('WPFolder', 'Icon Heaven', '<WP_DESKTOP>', 'ICONFILE='instdir'\fim.ico;OBJECTID=<FIM_ICONS>', 'R')
if SysRegisterObjectClass('FIMTransIcon', instdir'\fim.dll') then
say 'FIMTransIcon registered'
else do
say 'FIMTransIcon registration failed'
call SysDestroyObject "<FIM_ICONS>"
if \current then do
'del 'instdir'\fim.dll 'instdir'\fim.ico'
call SysRmDir instdir
end
exit
end
if SysRegisterObjectClass('FIMFolder', instdir'\fim.dll') then
say 'FIMFolder registered'
else do
say 'FIMFolder registration failed'
call SysDeregisterObjectClass 'FIMTransIcon'
call SysDestroyObject "<FIM_ICONS>"
if \current then do
'del 'instdir'\fim.dll 'instdir'\fim.ico'
call SysRmDir instdir
end
exit
end
if \current then do
/* say 'copying fim.hlp to 'instdir */
'copy fim.hlp 'instdir' >nul'
'copy iconlib.exe 'instdir' >nul'
'copy iconlib.ico 'instdir' >nul'
'copy deinstal.cmd 'instdir' >nul'
'copy deinstal.ico 'instdir' >nul'
'copy reinst.cmd 'instdir' >nul'
'copy replace.exe 'instdir' >nul'
'copy readme.1st 'instdir' >nul'
'copy bmtorder.frm 'instdir' >nul'
end
retval = SysCreateObject('WPProgram', 'Icon Librarian', '<FIM_ICONS>', 'PROGTYPE=WINDOWABLEVIO;ASSOCFILTER=*.FIM;EXENAME='instdir'\iconlib.exe;ICONFILE='instdir'\iconlib.ico', 'R')
retval = SysCreateObject('WPProgram', 'De-Install', '<FIM_ICONS>', 'PROGTYPE=WINDOWABLEVIO;EXENAME='instdir'\deinstal.cmd;ICONFILE='instdir'\deinstal.ico', 'R')
retval = SysCreateObject('WPProgram', 'Read Me', '<FIM_ICONS>', 'PROGTYPE=PM;EXENAME=e.exe;PARAMETERS='instdir'\readme.1st', 'R')
call instlibs '.'
res = SysIni(, app, key, instdir)
say 'Installation has been succesfully completed.'
if current then
'pause'
else do
say 'Do you wish me to clean up the installation directory? [N/y]'
pull reply
if left(reply, 1) = 'Y' then do
call cleanup
end
end
Exit
instlibs:procedure expose current instdir
dir=ARG(1)
call SysFileTree dir'\*.fim', 'file.', 'FO'
say 'Installing icon libraries'
Do i=1 to file.0
if current then
targ = file.i
else do
targ = instdir'\'filespec('n',file.i)
'copy' file.i targ '>nul'
end
cookie1 = charin(targ)
cookie2 = charin(targ)
if cookie1 = 'L' & cookie2 = 'I' then do
dum = charin(targ,,8)
n = ''
c = charin(targ)
do until c2d(c) = 0
n = n''c
c= charin(targ)
end
retval = SysCreateObject('FIMFolder', n, '<FIM_ICONS>', 'ICONLIBRARY='targ, 'R')
say 'Library 'n' added'
call stream targ,'C','CLOSE'
end
else do
call stream targ,'C','CLOSE'
if \current then
'del 'targ
end
End
return
cleanup:
'del *.fim fim.ico fim.hlp fim.dll iconlib.exe iconlib.ico'
'del readme.1st install.cmd deinstal.cmd deinstal.ico reinst.cmd'
'del replace.exe bmtorder.frm'
return
update100:
/* update from 1.00 */
say ''
say 'Icon Heaven is installed in directory ['instdir']'
say 'Do you wish me to update it ? [Y/n]'
pull reply
if left(reply,1)='N' then return
/* use default directory */
res = SysIni(, app, key, instdir)
'copy fim.dll 'instdir' >nul'
'copy fim.hlp 'instdir' >nul'
'copy fim.ico 'instdir' >nul'
'copy iconlib.exe 'instdir' >nul'
'copy iconlib.ico 'instdir' >nul'
'copy readme.1st 'instdir' >nul'
'copy replace.exe 'instdir' >nul'
'copy deinstal.cmd 'instdir' >nul'
'copy deinstal.ico 'instdir' >nul'
'copy reinst.cmd 'instdir' >nul'
'copy bmtorder.frm 'instdir' > nul'
retval = SysCreateObject('WPProgram', 'Icon Librarian', '<FIM_ICONS>', 'PROGTYPE=WINDOWABLEVIO;ASSOCFILTER=*.FIM;EXENAME='instdir'\iconlib.exe;ICONFILE='instdir'\iconlib.ico', 'U')
retval = SysCreateObject('WPProgram', 'De-Install', '<FIM_ICONS>', 'PROGTYPE=WINDOWABLEVIO;EXENAME='instdir'\install.cmd;ICONFILE='instdir'\deinstal.ico', 'U')
retval = SysCreateObject('WPProgram', 'Read Me', '<FIM_ICONS>', 'PROGTYPE=PM;EXENAME=e.exe;PARAMETERS='instdir'\readme.1st', 'U')
'replace 'dll' 'instdir'\fim.dll'
'del 'dll
'del 'tDrive':\os2\help\fim.hlp'
say 'Icon Heaven has been updated.'
say 'You will need to reboot to make it available'
return
mkdir: procedure expose (Globals)
parse arg dir
if (length(dir) > 2) then do
call mkdir(substr(dir,1,lastpos('\',dir)-1))
res = SysMkDir(dir)
end
if res = 5 then res = 0
return res
update:
say ''
say 'Icon Heaven is installed in directory ['instdir']'
say 'Do you wish me to update it to version 'ver'? [Y/n]'
pull reply
if left(reply,1)='N' then return
dll=instdir'\fim.dll'
'replace 'dll
'copy fim.dll 'dll' >nul'
'copy fim.hlp 'instdir' >nul'
'copy fim.ico 'instdir' >nul'
'copy iconlib.exe 'instdir' >nul'
'copy iconlib.ico 'instdir' >nul'
'copy readme.1st 'instdir' >nul'
'copy replace.exe 'instdir' >nul'
'copy deinstal.cmd 'instdir' >nul'
'copy deinstal.ico 'instdir' >nul'
'copy reinst.cmd 'instdir' >nul'
say 'Icon Heaven has been updated, '
say 'You will need to reboot to make the new version available'
'pause'
return