/* REXX Script: creating WPS objects for CooLFM */

call rxFuncAdd "SysLoadFuncs" , "RexxUtil" , "SysLoadFuncs"
call SysLoadFuncs

name = "fm-radio"

Parse arg dir

if dir="" then dir = directory()
rc=directory(dir)

rc=SysCreateObject("WPFolder",name,"<WP_DESKTOP>",,
                   "OBJECTID=<COOLFMFOLDER>;OPEN=Default;","REPLACE" )

PRGOPTION="EXENAME="||dir||"\coolfm.EXE;OBJECTID=<COOLFM_EXE>"
rc=SysCreateObject("WPProgram",name,"<COOLFMFOLDER>",PRGOPTION,"REPLACE")

PRGOPTION="EXENAME=VIEW.EXE;PARAMETERS="||dir||"\coolfm.hlp;OBJECTID=<COOLFMHELP>"
rc=SysCreateObject("WPProgram","Manual","<COOLFMFOLDER>",PRGOPTION,"REPLACE")


/* Copy usbcalls.dll */

BootDrv = SysBootDrive()
if Stream(BootDrv||"\ecs\dll\usbcalls.dll" ,'c','query exists')\='' then 
  say "ok"
else 
  '@copy '||dir||'\Devices\usbcalls.dll '||BootDrv||'\ecs\dll' 
  