/*   REXX: INSTALLOS2.CMD                                                    */
/*   (installing WPS objects for JAVA programs)                              */
/*   made by                                                                 */
/*   helge nordmann                                                          */
/*   www.norrsken-data-teknik.com                                            */
/*                                                                           */

'@echo off'
esc= D2C(27)
cr = D2C(13)
vers = '2002-10-19'
testrun = 'FALSE'
source = 'JPhotoBrush'
say esc'[0;30;46m'esc'[K'esc'[2J' /* black on green */

say ''
say 'norrsken data teknik'
say ''
say 'InstallOS2.CMD version' vers
say ''
say 'now trying to create a WPS object for 'source' ...'
say ''

/*   the usual stuff   */

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

/*   getting own path   */

parse source . . this_cmd
this_drive  = filespec( 'drive', this_cmd )
this_path   = filespec( 'path', this_cmd )
this_in = this_drive || this_path

if (testrun == 'TRUE') then do
  say this_in
  call SysSleep 2
  end

/*   do it   */

/*   make OS/2 icon the one we're using   */

command = "copy OS2.ico StartJPB.ico"
command

/* Create Program Object */

setup='EXENAME='||this_in||'StartJPB.CMD;STARTUPDIR='||this_in';ICONFILE='
setup = setup||this_in||'StartJPB.ico;MINIMIZED=YES'

Call SysCreateObject 'WPProgram','JPhotoBrush','<WP_DESKTOP>',setup,'U'

/*   the END message   */
say ''
say ''
say 'Program object' source 'successfully created'
call SysSleep 5

exit
