/* rexx  */
/************************************************************************/

call RxFuncAdd 'RexxInstSetVariable', 'WPINSTAL', 'RexxInstSetVariable'
call RxFuncAdd 'RexxInstResolveVariables', 'WPINSTAL', 'RexxInstResolveVariables'
call RxFuncAdd 'RexxInstDeselect', 'WPINSTAL', 'RexxInstDeselect'
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'sysLoadFuncs'
call SysLoadFuncs

parse arg objectid

  WSOD3 = RexxInstResolveVariables(objectid,"{WSOD3}",1)

  if WSOD3 = "YES" then
      exit 0

  path = SysIni(,'Netscape','ALL:',keys)

  if path == 'ERROR:' then
  do
     call RexxInstDeSelect objectid,"JV131NSFiles"
  end
  else
  do
     latestversion = keys.1

     if latestversion < 6.0 then
     do
        do i = 2 to keys.0
          if (keys.i > latestversion) & (keys.i < 6.0) then
          latestversion = keys.i
        end

        path = SysIni(,'Netscape',latestversion)
        if c2d(right(path,1)) = 0 then
           path=substr(path,1,length(path)-1)
        if path == 'ERROR:' then
           call RexxInstDeSelect objectid,"JV131NSFiles"
        else
        do
           path =  insert('\program\plugins',path,length(path))
           call RexxInstSetVariable objectid,"JV131NSFiles", "NSDRV", path
        end
     end

     else
        call RexxInstDeSelect objectid,"JV131NSFiles"

  end

exit 0


