home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 9 Archive
/
09-Archive.zip
/
arcm30.zip
/
INSTALL.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-03-19
|
8KB
|
254 lines
/*
@echo off
cls
echo.
echo.
echo ERROR:
echo REXX support not installed
echo You must have REXX support installed to run this
echo program.
echo.
echo To run this program, run Selective Install from
echo your System Setup folder, and install REXX.
exit
*/
/*----------------------------------------------*/
/*-- REXX --*/
/*----------------------------------------------*/
/*-- PROGRAM NAME: --*/
/*-- install --*/
/*-- --*/
/*-- DESCRIPTION: --*/
/*-- Installs Archive Manager --*/
/*----------------------------------------------*/
/*-- AUTHOR: --*/
/*-- Kelly Schrock --*/
/*----------------------------------------------*/
/*-- DATE: --*/
/*-- 03.17.96 --*/
/*----------------------------------------------*/
TRACE n
signal on HALT
call LoadLibs
/*-- get the command line --*/
parse arg sourcedir destdir
/*-- Do the intro thing --*/
call SysCls
say ''
say ' Archive Manager Installation'
say ''
/*-- get dest dir --*/
if destdir = '' then do
say ''
say 'Please enter a directory name for Archive Manager'
say '(Default: C:\ARCMAN):'
parse pull destdir
/*-- if error --*/
if destdir = ' ' then do
destdir = 'C:\ARCMAN'
end
end
if sourcedir = ' ' then do
thisdir = directory()
say ''
say 'Please enter the directory where the program is being installed'
say 'from(Default: 'thisdir'):'
parse pull sourcedir
/*-- if another error --*/
if sourcedir = ' ' then do
sourcedir = thisdir
say 'using the current directory as the source directory.'
end
/*-- make sure path is good --*/
If substr( sourcedir, length(sourcedir), 1 ) \= '\' then
sourcedir = sourcedir||'\'
/*-- do main screen --*/
call SysCls
say
say ' Archive Manager Installation'
say
say 'Archive Manager will be Installed with the following settings:'
say
say 'Source directory: "'sourcedir'"'
say 'Destination directory: "'destdir'"'
say
say 'Okay to continue(Y/n)?'
k = SysGetKey('NOECHO')
if k = 'N' | k = 'n' then do
say
say 'Installation cancelled.'
exit
end
/*-- see if the dest directory exists --*/
Call SysFileTree destdir, file, 'D'
if file.0 = '0' then do
say 'The directory: 'destdir' does not exist. Create it(Y/n)?'
k = SysGetKey('NOECHO')
if k = 'N'| k = 'n' then do
say
say 'Installation cancelled.'
exit
end
/*-- create the dest. dir --*/
rc = SysMkDir(destdir)
if rc = 0 then do
say 'The directory ' destdir ' was created successfully.'
end
else do
say 'The directory ' destdir ' could not be created successfully; cancelling.'
exit
end
end
/*-- copy the files --*/
call SysCls
say
say 'Install is copying files, please wait...'
call CopyFile 'ARCMAN.EXE', sourcedir, destdir
call CopyFile 'ARCMAN.ICO', sourcedir, destdir
call CopyFile 'ARCMAN.INF', sourcedir, destdir
call CopyFile 'ARCMAN.HLP', sourcedir, destdir
call CopyFile 'README.TXT', sourcedir, destdir
call CopyFile 'AMFILE.DLL', sourcedir, destdir
call CopyFile 'AMFILE.HLP', sourcedir, destdir
call CopyFile 'LICENSE.TXT', sourcedir, destdir
call CopyFile 'REGISTER.TXT', sourcedir, destdir
/*-- create a program object --*/
call SysCls
say
say 'Archive Manager can be installed as an object on your desktop.'
say 'Do you want to create it now(Y/n)?'
k = SysGetKey('NOECHO')
if k = 'N' | k = 'n' then call GoodBye
say
say 'Creating the program folder,'
x = SysCreateObject("WPFolder",,
"Archive Manager",,
"<WP_DESKTOP>",,
"OBJECTID=<ARCMAN>;ICONFILE="||destdir||"\ARCMAN.ICO", "replace")
if x = 0 then do
say 'Unable to create folder; cancelling.'
exit
end
say 'Adding the'
say 'Manual,'
x = SysCreateObject("WPProgram",,
"Manual",,
"<ARCMAN>",,
"EXENAME=VIEW.EXE;PARAMETERS="||destdir||"\ARCMAN.INF About")
say 'ReadMe file,'
x = SysCreateObject("WPProgram",,
"Read Me",,
"<ARCMAN>",,
"EXENAME=E.EXE;PARAMETERS="||destdir||"\README.TXT")
say 'Liscense agreement,'
x = SysCreateObject("WPProgram",,
"License Agreement",,
"<ARCMAN>",,
"EXENAME=E.EXE;PARAMETERS="||destdir||"\LICENSE.TXT")
say 'Registration Form,'
x = SysCreateObject("WPProgram",,
"Registration Form",,
"<ARCMAN>",,
"EXENAME=E.EXE;PARAMETERS="||destdir||"\REGISTER.TXT")
say 'and the Program file.'
x = SysCreateObject("WPProgram",,
"Archive Manager",,
"<ARCMAN>",,
"EXENAME="||destdir||"\ARCMAN.EXE;STARTUPDIR="||destdir";ASSOCFILTER=*.ZIP,*.LZH")
say 'Setting up the Archive file template...'
system_dll=FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))||'\OS2\DLL';
system_hlp=FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))||'\OS2\HELP';
say 'Deregistering ArcmanFile class...';
rc=SysDeregisterObjectClass('ArcmanFile');
say 'Erasing the current DLL...';
Address CMD '@ERASE 'system_dll'\AMFILE.DLL 2>NUL';
say 'Copying the new DLL and help file...';
Address CMD '@COPY 'destdir'\AMFILE.DLL 'system_dll;
Address CMD '@COPY 'destdir'\AMFILE.HLP 'system_hlp;
If rc <> 0 Then Do
Say "ArcmanFile: Could not replace the ArcmanFile DLL, rc="rc".";
Say "Delete the object and the DLL from the "system_dll" directory.";
Say "Then copy "destdir"\AMFILE.DLL to the "system_dll" directory.";
End
Else
say 'Registering the new DLL...';
rc=SysRegisterObjectClass('ArcmanFile',system_dll||'\AMFILE.DLL');
If rc <> 1
Then Do;
Say "ArcmanFile: could not register ArcmanFile class, rc="rc".";
End;
End;
GoodBye:
/*-- exit with a goodbye --*/
say
say 'Done.'
say
say 'Archive Manager has been installed on your system.'
say
say 'Be sure to read the file README.TXT for up-to-date information.'
say
"@view "||destdir||"\arcman.inf Introduction"
exit
/*----------------------------------------------*/
/*-- FUNCTION: --*/
/*-- LoadLibs --*/
/*-- ACTION: --*/
/*-- loads the libraries needed by this REXX --*/
/*----------------------------------------------*/
LoadLibs:
if RxFuncQuery('SysLoadFuncs') THEN
do
/*-- load the load-function --*/
CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
/*-- load the Sys* utilities --*/
CALL SysLoadFuncs
end
return
HALT:
say
say 'Program cancelled; Interrupted by user.'
exit
/*-----------------------------------------------------------------------------*/
/*-- CopyFile --*/
/*-----------------------------------------------------------------------------*/
CopyFile: Arg ArgFile2Copy, ArgFloppyDir, ArgInstallDir
Say 'Copying 'ArgFloppyDir||ArgFile2Copy' to 'ArgInstallDir||'\'||ArgFile2Copy'...'
Command = '@Copy 'ArgFloppyDir||ArgFile2Copy' 'ArgInstallDir||'\'||ArgFile2Copy' >NUL'
Command
if rc \= 0 Then Do
say 'Error! 'ArgFile2Copy' was not installed properly.'
Pull ConfirmIt
End
Return
/* eof */