home *** CD-ROM | disk | FTP | other *** search
- /* K.A.Ash (c) Copyright 1996 */
- /* install.cmd */
- /* ----------- */
- /* A very simple installation script. */
-
- options etmode
- options exmode
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call SysLoadFuncs
-
- programName = SysSearchPath('PATH', 'TaskBox.exe')
- if programName = '' then
- do
- say 'Error: Could not find TaskBox.exe in PATH directories.'
- exit
- end
-
- if stream('TaskBox.dll', 'command', 'query exists') = '' then
- do
- say 'Error: Could not find TaskBox.dll in the current directory.'
- exit 1
- end
-
- if SysCreateObject('WPProgram', 'TaskBox', '<WP_DESKTOP>',,
- 'EXENAME='programName';STARTUPDIR='directory() || ,
- ';PROGTYPE=PM;OBJECTID=<TaskBox>;PARAMETERS=/SILENT_EXIT /WATCH 90 /P:F:0%',,
- 'u') = 0 then
- say 'Error: Could not create object.'
- else
- say 'The program object was successfully created on the desktop.'
-
- CALL inst_modules
-
- exit 0
-
- inst_modules:
-
- IF SysFileTree( "module.1st", "file", "FOS" ) THEN DO
- SAY 'Error: SysFileTree failed'
- RETURN
- END
-
- DO i = 1 to file.0
- j = LASTPOS( '\', file.i )
- IF j ¬= 0 THEN j = j - 1
- CALL do_module SUBSTR( file.i, 1, j )
- END
-
- RETURN
-
- do_module: /* arg directory containing module.1st */
- ARG dir
- file = dir||'\module.1st'
- module = LINEIN( file )
- DO WHILE LINES( file )
- line =LINEIN( file )
- IF line = "COMMAND:" THEN LEAVE
- SAY line
- END
-
- Say 'Do you wish to install "'module'"(Yes/No) ?'
- PULL ans .
- IF SUBSTR(ans,1,1) = 'Y' THEN DO
- '@copy 'dir||'\'||module' . '
- IF rc = 0 THEN
- IF line = 'COMMAND:' THEN DO
- cur_dir = DIRECTORY()
- CALL DIRECTORY( dir )
- DO WHILE LINES( file )
- cmd = LINEIN( file )
- INTERPRET cmd
- END
- CALL DIRECTORY( cur_dir )
- END
- IF rc = 0 THEN SAY module' installed.'
- ELSE SAY 'Failed to install 'module
- END
- ELSE
- SAY 'Skiping this "'module'"'
- RETURN
-