home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
sdwps.zip
/
install.cmd
next >
Wrap
OS/2 REXX Batch file
|
1993-08-15
|
5KB
|
176 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 SDWPS Shutdown program --*/
/*----------------------------------------------*/
/*-- AUTHOR: --*/
/*-- Kelly Schrock --*/
/*----------------------------------------------*/
/*-- DATE: --*/
/*-- 08.15.93 --*/
/*----------------------------------------------*/
TRACE n
signal on HALT
call LoadLibs
/*-- get the command line --*/
parse arg sourcedir destdir
/*-- get dest dir --*/
if destdir = '' then do
say ''
say 'Please enter a directory name for Shutdown'
say '(Default: C:\SDWPS):'
parse pull destdir
/*-- if error --*/
if destdir = ' ' then do
destdir = 'C:\SDWPS'
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 ' Shutdown Installation'
say
say 'Shutdown 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 on your hardfile. 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 'SDWPS.EXE', sourcedir, destdir
/*-- create a program object --*/
call SysCls
say
say 'Shutdown 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 object...'
x = SysCreateObject("WPProgram",,
"Shutdown",,
"<WP_DESKTOP>",,
"EXENAME="||destdir||"\SDWPS.EXE")
GoodBye:
/*-- exit with a goodbye --*/
say
say 'Done.'
say
say
say 'Shutdown has been installed on your system.'
say
say 'Press any key to exit installation...'
k = SysGetKey('NOECHO')
call SysCls
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 'User interrupted program.'
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