home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 9 Archive
/
09-Archive.zip
/
kazip1.zip
/
install.exe
/
Install.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-10-18
|
3KB
|
107 lines
/* ---------------------------------------------------------------------------------
* K.A.Ash (c) June 17th 1996
*
* install script for KZipper
* --------------------------------------------------------------------------------- */
signal on halt name SignalHandler /* Exception handler */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
FileName = SysSearchPath('PATH', 'KAZip.exe')
if FileName = '' then
do
say 'Error: Cannot find KAZip.exe in PATH directories.'
exit
end
/* check if have unzip */
if SysSearchPath('PATH', 'unzip.exe') ='' then
do
Say " Info-Zip's unzip is required to extract files that aren't stored or deflated( method 8). ",,
"Unzip.exe will also be required to extract encrypted entries( unless you compile(",,
" or get hold of) a non dummy KACrypt.dll."
Say;
end
/*do until GOTDIR = 2*/
DEST=''
do while DEST=''
DEST = GetAnswer( "<WP_DESKTOP>", "Enter directory to install KAZip program objects" )
/* make dir fully qualified */
if( SubStr( DEST,1,1) \= '<' & SubStr( DEST,2,2)\=':\' ) then do
DEST = GetFullQualifiedPath( DEST )
end
/* should check if destination is valid dir */
if( DEST = '' ) then Say "Invalid directory selected"
end /* do while */
SAY DEST
/* should really check all return codes */
if ( SysCreateObject( 'WPFolder',,
'KAZip', DEST,,
'OBJECTID=<KZipperFolder>',,
'f' ) != 1 ) then do
Say "installation failed"
exit
end
rc=SysCreateObject('WPProgram',,
'KAZip', '<KZipperFolder>',,
'OBJECTID=<KZipper>;STARTUPDIR='directory()';ASSOCFILTER=*.ZIP;ASSOCTYPE=Zip Archive;EXENAME='FileName ,,
'u' )
rc=SysCreateObject('WPProgram',,
'KAZip Extract to', '<KZipperFolder>',,
'OBJECTID=<KZipperExtractTo>;STARTUPDIR='directory()';ASSOCFILTER=*.ZIP;ASSOCTYPE=Zip Archive;PARAMETERS=/EXTRACT;EXENAME='FileName ,,
'u' )
if SysSearchPath('PATH', 'e.exe') \='' then
do
ANS = SubStr( GetAnswer( "Y", "View KAZip.txt now(Y/N) ?" ), 1, 1)
if ( (ANS = 'Y') | (ANS = 'y') ) then
"e.exe KAZip.txt"
end
exit
GetAnswer:
parse arg DEFAULT, MSG
say;
call Charout, MSG '['DEFAULT'] : ';
parse pull ANS;
if (Length(ANS) > 0) then
return(ANS);
else
return(DEFAULT);
GetFullQualifiedPath:
parse arg SRC
DEST = ''
if( SubStr( SRC,2,1) = ':' ) then do
CURDIR = Directory()
NEWDIR = Directory( SubStr(SRC,1,2) )
if( Length( NEWDIR) = 3 & SubStr( NEWDIR,3,1) = '\' ) then
NEWDIR = SubStr( NEWDIR, 1,2 )
if( NEWDIR \= '' ) then do
DEST = NEWDIR'\'SubStr( SRC,3)
end /* Do */
call Directory CURDIR
end /* Do */
else do
DIR = Directory()
if( Length( DIR) = 3 & SubStr( DIR,3,1) = '\' ) then
DIR = SubStr( DIR, 1,2 )
DEST = DIR'\'SRC
end /* Do */
return (DEST)
SignalHandler:
call SysCls
Say ;
Say "error - exiting..."
exit