/* 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
     call RexxInstDeSelect objectid,"JV131MZFiles"
  else
  do
     latestversion = keys.1

     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,"JV131MZFiles"
     else
     do
       if latestversion >= 6.0 then
       do
         path =  insert('\plugins',path,length(path))
         call RexxInstSetVariable objectid,"JV131MZFiles", "MZDRV", path
         call RexxInstSetVariable objectid,"JV131MZFiles" ,"CheckableMZ","1"
       end
       else
       do
         call RexxInstDeSelect objectid,"JV131MZFiles"
         call RexxInstSetVariable objectid,"JV131MZFiles" ,"CheckableMZ","0"
       end
     end
  end

exit 0


